diff --git a/Modules/Company/CompanyObject.py b/Modules/Company/CompanyObject.py index 44fa100..d55f87d 100644 --- a/Modules/Company/CompanyObject.py +++ b/Modules/Company/CompanyObject.py @@ -3,6 +3,40 @@ from Utils.ValidateUtil import ValidateAttr, Validate class BasicBusinessInfo(SpecObject): + """工商信息""" + + class ShareholderInformation(SpecObject): + """股东信息""" + name = ValidateAttr(field="name", type=str) + ratio = ValidateAttr(field="ratio", type=str) + nature = ValidateAttr(field="nature", type=str) + quantity = ValidateAttr(field="quantity", type=[str, int, float]) + + fields_map = { + "name": "股东名称", + "ratio": "持股比例", + "nature": "股东性质", + "quantity": "持股数量(股)" + } + + class ExecutiveInformation(SpecObject): + """高管信息""" + name = ValidateAttr(field="name", type=str) + position = ValidateAttr(field="position", type=str) + education = ValidateAttr(field="education", type=str) + birth_data = ValidateAttr(field="birth_data", func=Validate.date_format) + political_status = ValidateAttr(field="political_status", type=str) + industry_experience = ValidateAttr(field="industry_experience", type=[str, float, int]) + + fields_map = { + "name": "姓名", + "position": "职务", + "education": "学历", + "birth_data": "出生日期", + "political_status": "政治面貌", + "industry_experience": "行业经验" + } + cid = ValidateAttr(field="cid", type=str) company_name = ValidateAttr(field="company_name", type=str) enterprise_abbreviation = ValidateAttr(field="enterprise_abbreviation", type=str) @@ -24,8 +58,8 @@ class BasicBusinessInfo(SpecObject): company_positioning = ValidateAttr(field="company_positioning", type=str) legal_representative = ValidateAttr(field="legal_representative", type=str) the_actual_controller = ValidateAttr(field="the_actual_controller", type=str) - shareholder_information = ValidateAttr(field="shareholder_information", type=str) - executive_information = ValidateAttr(field="executive_information", type=str) + shareholder_information = ValidateAttr(field="shareholder_information", type=ShareholderInformation) + executive_information = ValidateAttr(field="executive_information", type=ExecutiveInformation) fields_map = { "cid": "企业ID", @@ -78,76 +112,75 @@ class CompanyOverviewInfo(SpecObject): class FinancialData(SpecObject): class BalanceSheet(SpecObject): """资产负债表""" - money_funds = ValidateAttr(field="", type=[str, float, int]) - entrusted_loans = ValidateAttr(field="", type=[str, float, int]) - other_receivables = ValidateAttr(field="", type=[str, float, int]) - reimbursement_receivable = ValidateAttr(field="", type=[str, float, int]) - total_current_assets = ValidateAttr(field="", type=[str, float, int]) - available_sale_financial_assets = ValidateAttr(field="", type=[str, float, int]) - long_term_equity_investment = ValidateAttr(field="", type=[str, float, int]) - fixed_assets = ValidateAttr(field="", type=[str, float, int]) - foreclosed_assets = ValidateAttr(field="", type=[str, float, int]) - other_non_current_assets = ValidateAttr(field="", type=[str, float, int]) - total_non_current_assets = ValidateAttr(field="", type=[str, float, int]) - total_assets = ValidateAttr(field="", type=[str, float, int]) - short_term_borrowing = ValidateAttr(field="", type=[str, float, int]) - other_payables = ValidateAttr(field="", type=[str, float, int]) - total_current_liabilities = ValidateAttr(field="", type=[str, float, int]) - long_term_borrowing = ValidateAttr(field="", type=[str, float, int]) - interest_bearing_liabilities = ValidateAttr(field="", type=[str, float, int]) - total_non_current_liabilities = ValidateAttr(field="", type=[str, float, int]) - total_liabilities = ValidateAttr(field="", type=[str, float, int]) - paid_capital = ValidateAttr(field="", type=[str, float, int]) - capital_reserve = ValidateAttr(field="", type=[str, float, int]) - undistributed_profit = ValidateAttr(field="", type=[str, float, int]) - total_Owner_equity = ValidateAttr(field="", type=[str, float, int]) - net_worth = ValidateAttr(field="", type=[str, float, int]) + money_funds = ValidateAttr(field="money_funds", type=[float, int]) + entrusted_loans = ValidateAttr(field="entrusted_loans", type=[float, int]) + other_receivables = ValidateAttr(field="other_receivables", type=[float, int]) + reimbursement_receivable = ValidateAttr(field="reimbursement_receivable", type=[float, int]) + total_current_assets = ValidateAttr(field="total_current_assets", type=[float, int]) + available_sale_financial_assets = ValidateAttr(field="available_sale_financial_assets", type=[float, int]) + long_term_equity_investment = ValidateAttr(field="long_term_equity_investment", type=[float, int]) + fixed_assets = ValidateAttr(field="fixed_assets", type=[float, int]) + foreclosed_assets = ValidateAttr(field="foreclosed_assets", type=[float, int]) + other_non_current_assets = ValidateAttr(field="other_non_current_assets", type=[float, int]) + total_non_current_assets = ValidateAttr(field="total_non_current_assets", type=[float, int]) + total_assets = ValidateAttr(field="total_assets", type=[float, int]) + short_term_borrowing = ValidateAttr(field="short_term_borrowing", type=[float, int]) + other_payables = ValidateAttr(field="other_payables", type=[float, int]) + total_current_liabilities = ValidateAttr(field="total_current_liabilities", type=[float, int]) + long_term_borrowing = ValidateAttr(field="long_term_borrowing", type=[float, int]) + interest_bearing_liabilities = ValidateAttr(field="interest_bearing_liabilities", type=[float, int]) + total_non_current_liabilities = ValidateAttr(field="total_non_current_liabilities", type=[float, int]) + total_liabilities = ValidateAttr(field="total_liabilities", type=[float, int]) + paid_capital = ValidateAttr(field="paid_capital", type=[float, int]) + capital_reserve = ValidateAttr(field="capital_reserve", type=[float, int]) + undistributed_profit = ValidateAttr(field="undistributed_profit", type=[float, int]) + total_Owner_equity = ValidateAttr(field="total_Owner_equity", type=[float, int]) + net_worth = ValidateAttr(field="net_worth", type=[float, int]) fields_map = { - money_funds: "货币资金", - entrusted_loans: "委托贷款", - other_receivables: "其他应收款", - reimbursement_receivable: "应收代偿款", - total_current_assets: "流动资产合计", - available_sale_financial_assets: "可供出售金融资产", - long_term_equity_investment: "长期股权投资", - fixed_assets: "固定资产", - foreclosed_assets: "抵债资产", - other_non_current_assets: "其他非流动资产", - total_non_current_assets: "非流动资产合计", - total_assets: "资产总额", - short_term_borrowing: "短期借款", - other_payables: "其他应付款", - total_current_liabilities: "流动负债合计", - long_term_borrowing: "长期借款", - interest_bearing_liabilities: "有息负债", - total_non_current_liabilities: "非流动负债合计", - total_liabilities: "负债合计", - paid_capital: "实收资本", - capital_reserve: "资本公积", - undistributed_profit: "未分配利润", - total_Owner_equity: "所有者权益合计", - net_worth: "净资产" + "money_funds": "货币资金", + "entrusted_loans": "委托贷款", + "other_receivables": "其他应收款", + "reimbursement_receivable": "应收代偿款", + "total_current_assets": "流动资产合计", + "available_sale_financial_assets": "可供出售金融资产", + "long_term_equity_investment": "长期股权投资", + "fixed_assets": "固定资产", + "foreclosed_assets": "抵债资产", + "other_non_current_assets": "其他非流动资产", + "total_non_current_assets": "非流动资产合计", + "total_assets": "资产总额", + "short_term_borrowing": "短期借款", + "other_payables": "其他应付款", + "total_current_liabilities": "流动负债合计", + "long_term_borrowing": "长期借款", + "interest_bearing_liabilities": "有息负债", + "total_non_current_liabilities": "非流动负债合计", + "total_liabilities": "负债合计", + "paid_capital": "实收资本", + "capital_reserve": "资本公积", + "undistributed_profit": "未分配利润", + "total_Owner_equity": "所有者权益合计", + "net_worth": "净资产" } class IncomeSheet(SpecObject): """利润表""" - operating_income = ValidateAttr(field="operating_income", type=[str, float, int]) - guarantee_fee_income = ValidateAttr(field="guarantee_fee_income", type=[str, float, int]) - loan_interest_income = ValidateAttr(field="loan_interest_income", type=[str, float, int]) - investment_business_income = ValidateAttr(field="investment_business_income", type=[str, float, int]) - other_business_income = ValidateAttr(field="other_business_income", type=[str, float, int]) - main_business_cost = ValidateAttr(field="main_business_cost", type=[str, float, int]) - taxes_surcharges = ValidateAttr(field="taxes_surcharges", type=[str, float, int]) - operating_administrative_expenses = ValidateAttr(field="operating_administrative_expenses", - type=[str, float, int]) - interest_income = ValidateAttr(field="interest_income", type=[str, float, int]) - interest_expense = ValidateAttr(field="interest_expense", type=[str, float, int]) - asset_impairment_loss = ValidateAttr(field="asset_impairment_loss", type=[str, float, int]) - investment_income = ValidateAttr(field="investment_income", type=[str, float, int]) - operating_profit = ValidateAttr(field="operating_profit", type=[str, float, int]) - other_income = ValidateAttr(field="other_income", type=[str, float, int]) - net_profit = ValidateAttr(field="net_profit", type=[str, float, int]) + operating_income = ValidateAttr(field="operating_income", type=[float, int]) + guarantee_fee_income = ValidateAttr(field="guarantee_fee_income", type=[float, int]) + loan_interest_income = ValidateAttr(field="loan_interest_income", type=[float, int]) + investment_business_income = ValidateAttr(field="investment_business_income", type=[float, int]) + other_business_income = ValidateAttr(field="other_business_income", type=[float, int]) + main_business_cost = ValidateAttr(field="main_business_cost", type=[float, int]) + taxes_surcharges = ValidateAttr(field="taxes_surcharges", type=[float, int]) + operating_administrative_expenses = ValidateAttr(field="operating_administrative_expenses", type=[float, int]) + interest_income = ValidateAttr(field="interest_income", type=[float, int]) + interest_expense = ValidateAttr(field="interest_expense", type=[float, int]) + asset_impairment_loss = ValidateAttr(field="asset_impairment_loss", type=[float, int]) + investment_income = ValidateAttr(field="investment_income", type=[float, int]) + operating_profit = ValidateAttr(field="operating_profit", type=[float, int]) + other_income = ValidateAttr(field="other_income", type=[float, int]) + net_profit = ValidateAttr(field="net_profit", type=[float, int]) fields_map = { "operating_income": "营业收入", @@ -169,40 +202,40 @@ class FinancialData(SpecObject): class AppendixSheet(SpecObject): """补充数据表""" - current_compensation_amount = ValidateAttr(field="current_compensation_amount", type=[str, float, int]) + current_compensation_amount = ValidateAttr(field="current_compensation_amount", type=[float, int]) current_compensation_recycle_amount = ValidateAttr(field="current_compensation_recycle_amount", - type=[str, float, int]) - guarantee_liability = ValidateAttr(field="guarantee_liability", type=[str, float, int]) - accumulated_compensation_amount = ValidateAttr(field="accumulated_compensation_amount", type=[str, float, int]) + type=[float, int]) + guarantee_liability = ValidateAttr(field="guarantee_liability", type=[float, int]) + accumulated_compensation_amount = ValidateAttr(field="accumulated_compensation_amount", type=[float, int]) cumulative_compensation_recovery_amount = ValidateAttr(field="cumulative_compensation_recovery_amount", - type=[str, float, int]) - cumulative_amount = ValidateAttr(field="cumulative_amount", type=[str, float, int]) - largest_financing = ValidateAttr(field="largest_financing", type=[str, float, int]) - financing_guarantee_liabilities = ValidateAttr(field="financing_guarantee_liabilities", type=[str, float, int]) + type=[float, int]) + cumulative_amount = ValidateAttr(field="cumulative_amount", type=[float, int]) + largest_financing = ValidateAttr(field="largest_financing", type=[float, int]) + financing_guarantee_liabilities = ValidateAttr(field="financing_guarantee_liabilities", type=[float, int]) financial_guarantee_responsibility_balance = ValidateAttr(field="financial_guarantee_responsibility_balance", - type=[str, float, int]) - risk_weighted_assets = ValidateAttr(field="risk_weighted_assets", type=[str, float, int]) - guaranteed_risk_reserve_balance = ValidateAttr(field="guaranteed_risk_reserve_balance", type=[str, float, int]) + type=[float, int]) + risk_weighted_assets = ValidateAttr(field="risk_weighted_assets", type=[float, int]) + guaranteed_risk_reserve_balance = ValidateAttr(field="guaranteed_risk_reserve_balance", type=[float, int]) top_five_financing_guarantee_liabilities = ValidateAttr(field="top_five_financing_guarantee_liabilities", - type=[str, float, int]) + type=[float, int]) maximum_enterprise_financing_guarantee = ValidateAttr(field="maximum_enterprise_financing_guarantee", - type=[str, float, int]) - guarantee_compensation_reserve = ValidateAttr(field="guarantee_compensation_reserve", type=[str, float, int]) - unexpired_liability_reserve = ValidateAttr(field="unexpired_liability_reserve", type=[str, float, int]) - counter_guarantee_amount = ValidateAttr(field="counter_guarantee_amount", type=[str, float, int]) - bank_credit_limit = ValidateAttr(field="bank_credit_limit", type=[str, float, int]) - unused_credit_limit = ValidateAttr(field="unused_credit_limit", type=[str, float, int]) - number_cooperative_banks = ValidateAttr(field="number_cooperative_banks", type=[str, float, int]) - deposit_margin = ValidateAttr(field="deposit_margin", type=[str, float, int]) - save_margin = ValidateAttr(field="save_margin", type=[str, float, int]) - guaranteed_balance = ValidateAttr(field="guaranteed_balance", type=[str, float, int]) + type=[float, int]) + guarantee_compensation_reserve = ValidateAttr(field="guarantee_compensation_reserve", type=[float, int]) + unexpired_liability_reserve = ValidateAttr(field="unexpired_liability_reserve", type=[float, int]) + counter_guarantee_amount = ValidateAttr(field="counter_guarantee_amount", type=[float, int]) + bank_credit_limit = ValidateAttr(field="bank_credit_limit", type=[float, int]) + unused_credit_limit = ValidateAttr(field="unused_credit_limit", type=[float, int]) + number_cooperative_banks = ValidateAttr(field="number_cooperative_banks", type=[float, int]) + deposit_margin = ValidateAttr(field="deposit_margin", type=[float, int]) + save_margin = ValidateAttr(field="save_margin", type=[float, int]) + guaranteed_balance = ValidateAttr(field="guaranteed_balance", type=[float, int]) current_guarantee_business_income = ValidateAttr(field="current_guarantee_business_income", - type=[str, float, int]) + type=[float, int]) last_period_guarantee_business_income = ValidateAttr(field="last_period_guarantee_business_income", - type=[str, float, int]) - one_assets = ValidateAttr(field="one_assets", type=[str, float, int]) - two_assets = ValidateAttr(field="two_assets", type=[str, float, int]) - three_assets = ValidateAttr(field="three_assets", type=[str, float, int]) + type=[float, int]) + one_assets = ValidateAttr(field="one_assets", type=[float, int]) + two_assets = ValidateAttr(field="two_assets", type=[float, int]) + three_assets = ValidateAttr(field="three_assets", type=[float, int]) fields_map = { "current_compensation_amount": "当期代偿金额", @@ -237,79 +270,79 @@ class FinancialData(SpecObject): class FinancialIndicator(SpecObject): """财务指标""" guaranteed_insured_balance_growth_rate = ValidateAttr(field="guaranteed_insured_balance_growth_rate", - type=[str, float, int]) - guaranteed_revenue_growth_rate = ValidateAttr(field="guaranteed_revenue_growth_rate", type=[str, float, int]) - growth_rate_of_total_assets = ValidateAttr(field="growth_rate_of_total_assets", type=[str, float, int]) - cash_assets_ratio = ValidateAttr(field="cash_assets_ratio", type=[str, float, int]) - current_ratio = ValidateAttr(field="current_ratio", type=[str, float, int]) - compensation_reserve_ratio = ValidateAttr(field="compensation_reserve_ratio", type=[str, float, int]) - compensation_rate = ValidateAttr(field="compensation_rate", type=[str, float, int]) - risk_reserve_adequacy_ratio = ValidateAttr(field="risk_reserve_adequacy_ratio", type=[str, float, int]) - single_customer_concentration = ValidateAttr(field="single_customer_concentration", type=[str, float, int]) + type=[float, int]) + guaranteed_revenue_growth_rate = ValidateAttr(field="guaranteed_revenue_growth_rate", type=[float, int]) + growth_rate_of_total_assets = ValidateAttr(field="growth_rate_of_total_assets", type=[float, int]) + cash_assets_ratio = ValidateAttr(field="cash_assets_ratio", type=[float, int]) + current_ratio = ValidateAttr(field="current_ratio", type=[float, int]) + compensation_reserve_ratio = ValidateAttr(field="compensation_reserve_ratio", type=[float, int]) + compensation_rate = ValidateAttr(field="compensation_rate", type=[float, int]) + risk_reserve_adequacy_ratio = ValidateAttr(field="risk_reserve_adequacy_ratio", type=[float, int]) + single_customer_concentration = ValidateAttr(field="single_customer_concentration", type=[float, int]) current_guarantee_compensation_rate = ValidateAttr(field="current_guarantee_compensation_rate", - type=[str, float, int]) + type=[float, int]) current_compensation_recovery_rate = ValidateAttr(field="current_compensation_recovery_rate", - type=[str, float, int]) + type=[float, int]) financing_guarantee_magnification = ValidateAttr(field="financing_guarantee_magnification", - type=[str, float, int]) - industry_concentration = ValidateAttr(field="industry_concentration", type=[str, float, int]) - return_total_assets = ValidateAttr(field="return_total_assets", type=[str, float, int]) - operating_margin = ValidateAttr(field="operating_margin", type=[str, float, int]) - roe = ValidateAttr(field="roe", type=[str, float, int]) - actual_asset_liability_ratio = ValidateAttr(field="actual_asset_liability_ratio", type=[str, float, int]) - capital_adequacy_ratio = ValidateAttr(field="capital_adequacy_ratio", type=[str, float, int]) - paid_capital = ValidateAttr(field="paid_capital", type=[str, float, int]) - guarantee_business_income = ValidateAttr(field="guarantee_business_income", type=[str, float, int]) + type=[float, int]) + industry_concentration = ValidateAttr(field="industry_concentration", type=[float, int]) + return_total_assets = ValidateAttr(field="return_total_assets", type=[float, int]) + operating_margin = ValidateAttr(field="operating_margin", type=[float, int]) + roe = ValidateAttr(field="roe", type=[float, int]) + actual_asset_liability_ratio = ValidateAttr(field="actual_asset_liability_ratio", type=[float, int]) + capital_adequacy_ratio = ValidateAttr(field="capital_adequacy_ratio", type=[float, int]) + paid_capital = ValidateAttr(field="paid_capital", type=[float, int]) + guarantee_business_income = ValidateAttr(field="guarantee_business_income", type=[float, int]) cumulative_guarantee_compensation_rate = ValidateAttr(field="cumulative_guarantee_compensation_rate", - type=[str, float, int]) + type=[float, int]) cumulative_compensation_recovery_rate = ValidateAttr(field="cumulative_compensation_recovery_rate", - type=[str, float, int]) - risk_coverage_ratio = ValidateAttr(field="risk_coverage_ratio", type=[str, float, int]) - cash_asset_compensation_rate = ValidateAttr(field="cash_asset_compensation_rate", type=[str, float, int]) - margin_ratio = ValidateAttr(field="margin_ratio", type=[str, float, int]) + type=[float, int]) + risk_coverage_ratio = ValidateAttr(field="risk_coverage_ratio", type=[float, int]) + cash_asset_compensation_rate = ValidateAttr(field="cash_asset_compensation_rate", type=[float, int]) + margin_ratio = ValidateAttr(field="margin_ratio", type=[float, int]) proportion_investment_business_income = ValidateAttr(field="proportion_investment_business_income", - type=[str, float, int]) - investment_income_growth_rate = ValidateAttr(field="investment_income_growth_rate", type=[str, float, int]) - one_proportion_class_assets = ValidateAttr(field="one_proportion_class_assets", type=[str, float, int]) - customer_concentration = ValidateAttr(field="customer_concentration", type=[str, float, int]) + type=[float, int]) + investment_income_growth_rate = ValidateAttr(field="investment_income_growth_rate", type=[float, int]) + one_proportion_class_assets = ValidateAttr(field="one_proportion_class_assets", type=[float, int]) + customer_concentration = ValidateAttr(field="customer_concentration", type=[float, int]) proportion_income_guarantee_business = ValidateAttr(field="proportion_income_guarantee_business", - type=[str, float, int]) - two_proportion_class_assets = ValidateAttr(field="two_proportion_class_assets", type=[str, float, int]) - three_proportion_class_assets = ValidateAttr(field="three_proportion_class_assets", type=[str, float, int]) + type=[float, int]) + two_proportion_class_assets = ValidateAttr(field="two_proportion_class_assets", type=[float, int]) + three_proportion_class_assets = ValidateAttr(field="three_proportion_class_assets", type=[float, int]) fields_map = { - guaranteed_insured_balance_growth_rate: "担保在保余额增长率(%)", - guaranteed_revenue_growth_rate: "担保收入增长率(%)", - growth_rate_of_total_assets: "资产总额增长率(%)", - cash_assets_ratio: "现金类资产比率(%)", - current_ratio: "流动比率(%)", - compensation_reserve_ratio: "代偿准备金比率(%)", - compensation_rate: "代偿保障率(%)", - risk_reserve_adequacy_ratio: "风险准备金充足率(%)", - single_customer_concentration: "单一客户集中度(%)", - current_guarantee_compensation_rate: "当期担保代偿率(%)", - current_compensation_recovery_rate: "当期代偿回收率(%)", - financing_guarantee_magnification: "融资担保放大倍数(倍)", - industry_concentration: "行业集中度(%)", - return_total_assets: "总资产收益率(%)", - operating_margin: "营业利润率(%)", - roe: "净资产收益率(%)", - actual_asset_liability_ratio: "实际资产负债率(%)", - capital_adequacy_ratio: "资本充足率(%)", - paid_capital: "实收资本(亿元)", - guarantee_business_income: "担保业务收入(万元)", - cumulative_guarantee_compensation_rate: "近三年累计担保代偿率(%)", - cumulative_compensation_recovery_rate: "近三年累计代偿回收率(%)", - risk_coverage_ratio: "风险覆盖率(%)", - cash_asset_compensation_rate: "现金类资产代偿保障率(%)", - margin_ratio: "保证金比率(%)", - proportion_investment_business_income: "投资业务收入占比(%)", - investment_income_growth_rate: "投资收益增长率(%)", - one_proportion_class_assets: "I类资产占比(%)", - customer_concentration: "客户集中度(%)", - proportion_income_guarantee_business: "担保业务收入占比(%)", - two_proportion_class_assets: "II类资产占比(%)", - three_proportion_class_assets: "III类资产占比(%)" + "guaranteed_insured_balance_growth_rate": "担保在保余额增长率(%)", + "guaranteed_revenue_growth_rate": "担保收入增长率(%)", + "growth_rate_of_total_assets": "资产总额增长率(%)", + "cash_assets_ratio": "现金类资产比率(%)", + "current_ratio": "流动比率(%)", + "compensation_reserve_ratio": "代偿准备金比率(%)", + "compensation_rate": "代偿保障率(%)", + "risk_reserve_adequacy_ratio": "风险准备金充足率(%)", + "single_customer_concentration": "单一客户集中度(%)", + "current_guarantee_compensation_rate": "当期担保代偿率(%)", + "current_compensation_recovery_rate": "当期代偿回收率(%)", + "financing_guarantee_magnification": "融资担保放大倍数(倍)", + "industry_concentration": "行业集中度(%)", + "return_total_assets": "总资产收益率(%)", + "operating_margin": "营业利润率(%)", + "roe": "净资产收益率(%)", + "actual_asset_liability_ratio": "实际资产负债率(%)", + "capital_adequacy_ratio": "资本充足率(%)", + "paid_capital": "实收资本(亿元)", + "guarantee_business_income": "担保业务收入(万元)", + "cumulative_guarantee_compensation_rate": "近三年累计担保代偿率(%)", + "cumulative_compensation_recovery_rate": "近三年累计代偿回收率(%)", + "risk_coverage_ratio": "风险覆盖率(%)", + "cash_asset_compensation_rate": "现金类资产代偿保障率(%)", + "margin_ratio": "保证金比率(%)", + "proportion_investment_business_income": "投资业务收入占比(%)", + "investment_income_growth_rate": "投资收益增长率(%)", + "one_proportion_class_assets": "I类资产占比(%)", + "customer_concentration": "客户集中度(%)", + "proportion_income_guarantee_business": "担保业务收入占比(%)", + "two_proportion_class_assets": "II类资产占比(%)", + "three_proportion_class_assets": "III类资产占比(%)" } """财务数据""" @@ -339,10 +372,10 @@ class CustomerInfo(SpecObject): report_period = ValidateAttr(field="report_period", type=str) client_name = ValidateAttr(field="client_name", type=str) guarantee_type = ValidateAttr(field="guarantee_type", type=str) - balance_under_insurance = ValidateAttr(field="balance_under_insurance", type=[str, float, int]) - financing_guarantee_balance = ValidateAttr(field="financing_guarantee_balance", type=[str, float, int]) - guarantee_start_date = ValidateAttr(field="guarantee_start_date", type=[str, float, int]) - guarantee_end_date = ValidateAttr(field="guarantee_end_date", type=[str, float, int]) + balance_under_insurance = ValidateAttr(field="balance_under_insurance", type=[float, int]) + financing_guarantee_balance = ValidateAttr(field="financing_guarantee_balance", type=[float, int]) + guarantee_start_date = ValidateAttr(field="guarantee_start_date", func=Validate.date_format) + guarantee_end_date = ValidateAttr(field="guarantee_end_date", func=Validate.date_format) fields_map = { "cid": "企业ID", @@ -363,10 +396,10 @@ class RegionalDistribution(SpecObject): company_name = ValidateAttr(field="company_name", type=str) report_period = ValidateAttr(field="report_period", type=str) region = ValidateAttr(field="region", type=str) - year_end_insured_balance = ValidateAttr(field="year_end_insured_balance", type=[str, float, int]) - year_end_insured_liability_balance = ValidateAttr(field="year_end_insured_balance", type=[str, float, int]) - insured_balance_newly_added = ValidateAttr(field="insured_balance_newly_added", type=[str, float, int]) - insured_liability_newly_added = ValidateAttr(field="insured_liability_newly_added", type=[str, float, int]) + year_end_insured_balance = ValidateAttr(field="year_end_insured_balance", type=[float, int]) + year_end_insured_liability_balance = ValidateAttr(field="year_end_insured_balance", type=[float, int]) + insured_balance_newly_added = ValidateAttr(field="insured_balance_newly_added", type=[float, int]) + insured_liability_newly_added = ValidateAttr(field="insured_liability_newly_added", type=[float, int]) fields_map = { "cid": "企业ID", @@ -386,10 +419,10 @@ class IndustryDistribution(SpecObject): company_name = ValidateAttr(field="company_name", type=str) report_period = ValidateAttr(field="report_period", type=str) industry = ValidateAttr(field="industry", type=str) - year_end_insured_balance = ValidateAttr(field="year_end_insured_balance", type=[str, float, int]) - year_end_insured_liability_balance = ValidateAttr(field="year_end_insured_balance", type=[str, float, int]) - insured_balance_newly_added = ValidateAttr(field="insured_balance_newly_added", type=[str, float, int]) - insured_liability_newly_added = ValidateAttr(field="insured_liability_newly_added", type=[str, float, int]) + year_end_insured_balance = ValidateAttr(field="year_end_insured_balance", type=[float, int]) + year_end_insured_liability_balance = ValidateAttr(field="year_end_insured_balance", type=[float, int]) + insured_balance_newly_added = ValidateAttr(field="insured_balance_newly_added", type=[float, int]) + insured_liability_newly_added = ValidateAttr(field="insured_liability_newly_added", type=[float, int]) fields_map = { "cid": "企业ID", @@ -408,15 +441,15 @@ class GuaranteedBalanceDistribution(SpecObject): class GuaranteeBalance(SpecObject): """担保金额相关""" - one_million = ValidateAttr(field="one_million", type=[str, float, int]) - five_million = ValidateAttr(field="five_million", type=[str, float, int]) - ten_million = ValidateAttr(field="ten_million", type=[str, float, int]) - thirty_million = ValidateAttr(field="thirty_million", type=[str, float, int]) - fifty_million = ValidateAttr(field="fifty_million", type=[str, float, int]) - eighty_million = ValidateAttr(field="eighty_million", type=[str, float, int]) - one_hundred_million = ValidateAttr(field="one_hundred_million", type=[str, float, int]) - more_than_one_hundred_million = ValidateAttr(field="more_than_one_hundred_million", type=[str, float, int]) - total = ValidateAttr(field="total", type=[str, float, int]) + one_million = ValidateAttr(field="one_million", type=int) + five_million = ValidateAttr(field="five_million", type=int) + ten_million = ValidateAttr(field="ten_million", type=int) + thirty_million = ValidateAttr(field="thirty_million", type=int) + fifty_million = ValidateAttr(field="fifty_million", type=int) + eighty_million = ValidateAttr(field="eighty_million", type=int) + one_hundred_million = ValidateAttr(field="one_hundred_million", type=int) + more_than_one_hundred_million = ValidateAttr(field="more_than_one_hundred_million", type=int) + total = ValidateAttr(field="total", type=int) fields_map = { "one_million": "金额<=100w", @@ -463,4 +496,4 @@ class RatingRecord(SpecObject): "level": "信用等级", "rating_date": "评级日期", "rating_report": "评级报告" - } \ No newline at end of file + }