lixinger-python 0.3.7__tar.gz → 0.3.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/PKG-INFO +1 -1
- lixinger_python-0.3.8/examples/fs_example.py +141 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/__init__.py +11 -1
- lixinger_python-0.3.8/lixinger/api/cn/company/fs/__init__.py +46 -0
- lixinger_python-0.3.8/lixinger/api/cn/company/fs/bank.py +132 -0
- lixinger_python-0.3.8/lixinger/api/cn/company/fs/insurance.py +132 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fs/non_financial.py +8 -2
- lixinger_python-0.3.8/lixinger/api/cn/company/fs/other_financial.py +131 -0
- lixinger_python-0.3.8/lixinger/api/cn/company/fs/security.py +132 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/namespace.py +46 -4
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/client.py +16 -0
- lixinger_python-0.3.8/lixinger/models/cn/company/fs/__init__.py +15 -0
- lixinger_python-0.3.8/lixinger/models/cn/company/fs/bank.py +20 -0
- lixinger_python-0.3.8/lixinger/models/cn/company/fs/insurance.py +20 -0
- lixinger_python-0.3.8/lixinger/models/cn/company/fs/other_financial.py +20 -0
- lixinger_python-0.3.8/lixinger/models/cn/company/fs/security.py +20 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/pyproject.toml +1 -1
- lixinger_python-0.3.8/tests/test_bank_statements.py +146 -0
- lixinger_python-0.3.8/tests/test_insurance_statements.py +109 -0
- lixinger_python-0.3.8/tests/test_other_financial_statements.py +109 -0
- lixinger_python-0.3.8/tests/test_security_statements.py +109 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/uv.lock +1 -1
- lixinger_python-0.3.7/lixinger/api/cn/company/fs/__init__.py +0 -5
- lixinger_python-0.3.7/lixinger/models/cn/company/fs/__init__.py +0 -5
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.claude/settings.local.json +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.env.example +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.github/copilot-instructions.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.github/workflows/README.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.github/workflows/pr-checks.yml +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.gitignore +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.pre-commit-config.yaml +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.python-version +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/.ruff.toml +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/ADD_NEW_API_QUICK.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/AGENTS.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/CHANGELOG.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/CLAUDE.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/DOCS.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/LICENSE +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/MANIFEST.in +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/PUBLISHING.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/README.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/SETUP.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/codecov.yml +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/client.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/announcement.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/candlestick.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/company.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/dividend.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/equity_change.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/fs/non_financial.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/fundamental/bank.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/fundamental/insurance.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/fundamental/non_financial.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/fundamental/other_financial.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/fundamental/security.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/indices.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/company/profile.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/announcement.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/asset_combination.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/asset_industry_combination.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/candlestick.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/fund.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/profile.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/fund/shareholdings.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/candlestick.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/constituent_weightings.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/constituents.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/drawdown.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/fundamental.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/index.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/index/tracking_fund.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/api/overview.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/development/code-style.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/development/contributing.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/development/testing.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/examples/company.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/examples/fund.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/examples/index.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/getting-started/configuration.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/getting-started/installation.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/getting-started/quickstart.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/docs/index.md +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/examples/company_example.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/examples/company_profile_example.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/examples/dividend_example.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/examples/index_constituent_weightings_example.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/examples/index_constituents_example.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/examples/index_info_example.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/fund_response.json +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/base.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/announcement.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/company.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/dividend.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/equity_change.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fundamental/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fundamental/bank.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fundamental/insurance.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fundamental/non_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fundamental/other_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/fundamental/security.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/indices.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/company/profile.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/announcement.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/asset_combination.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/asset_industry_combination.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/fund.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/profile.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/fund/shareholdings.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/constituent_weightings.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/constituents.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/drawdown.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/fs/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/fs/bank.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/fs/hybrid.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/fs/non_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/fs/security.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/fundamental.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/index.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/namespace.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/api/cn/index/tracking_fund.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/config.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/exceptions.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/announcement.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/company.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/dividend.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/equity_change.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fs/non_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fundamental/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fundamental/bank.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fundamental/insurance.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fundamental/non_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fundamental/other_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/fundamental/security.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/company/indices.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/announcement.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/asset_combination.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/asset_industry_combination.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/fund.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/profile.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/fund/shareholdings.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/constituent_weightings.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/constituents.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/drawdown.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/fs/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/fs/bank.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/fs/hybrid.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/fs/non_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/fs/security.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/fundamental.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/index.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/models/cn/index/tracking_fund.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/py.typed +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/utils/__init__.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/utils/api.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/utils/dataframe.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/utils/dict.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/utils/rate_limiter.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/lixinger/utils/retry.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/mkdocs.yml +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/mypy.ini +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/scripts/explore_api.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/scripts/generate_docs.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/scripts/publish.sh +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/api/cn/company/test_announcement.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/api/cn/company/test_dividend.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/api/cn/index/test_constituents.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/conftest.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_client.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_cn_index_candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_cn_index_constituent_weightings.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_company.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_company_profile.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_equity_change.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund_announcement.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund_asset_combination.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund_asset_industry_combination.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund_candlestick.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund_profile.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fund_shareholdings.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fundamental.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fundamental_bank.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_fundamental_security.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_constituents.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_drawdown.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_fs_bank.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_fs_hybrid.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_fs_non_financial.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_fs_security.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_index_fundamental.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_indices.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_integration.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_non_financial_statements.py +0 -0
- {lixinger_python-0.3.7 → lixinger_python-0.3.8}/tests/test_tracking_fund.py +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"""Example of fetching financial statements for all company types.
|
|
2
|
+
|
|
3
|
+
This example demonstrates how to fetch financial statements for the five
|
|
4
|
+
different company types supported by the Lixinger API:
|
|
5
|
+
|
|
6
|
+
- Non-financial companies (非金融企业)
|
|
7
|
+
- Banks (银行)
|
|
8
|
+
- Insurance companies (保险)
|
|
9
|
+
- Securities companies (证券)
|
|
10
|
+
- Other financial companies, e.g. leasing (其他金融)
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import asyncio
|
|
14
|
+
|
|
15
|
+
from lixinger import (
|
|
16
|
+
AsyncLixingerClient,
|
|
17
|
+
get_bank_statements,
|
|
18
|
+
get_insurance_statements,
|
|
19
|
+
get_non_financial_statements,
|
|
20
|
+
get_other_financial_statements,
|
|
21
|
+
get_security_statements,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
async def fetch_via_namespace():
|
|
26
|
+
"""Fetch each financial statement via the namespace pattern (recommended)."""
|
|
27
|
+
async with AsyncLixingerClient() as client:
|
|
28
|
+
# Non-financial company - 贵州茅台
|
|
29
|
+
print("[Non-financial] 贵州茅台 (600519)")
|
|
30
|
+
df = await client.cn_company.fs.non_financial.get_non_financial_statements(
|
|
31
|
+
stock_codes=["600519"],
|
|
32
|
+
metrics=["q.ps.toi.t", "q.ps.np.t"],
|
|
33
|
+
date="latest",
|
|
34
|
+
)
|
|
35
|
+
print(df)
|
|
36
|
+
print()
|
|
37
|
+
|
|
38
|
+
# Bank - 工商银行
|
|
39
|
+
print("[Bank] 工商银行 (601398)")
|
|
40
|
+
df = await client.cn_company.fs.bank.get_bank_statements(
|
|
41
|
+
stock_codes=["601398"],
|
|
42
|
+
metrics=["q.ps.oi.t"],
|
|
43
|
+
date="latest",
|
|
44
|
+
)
|
|
45
|
+
print(df)
|
|
46
|
+
print()
|
|
47
|
+
|
|
48
|
+
# Insurance - 中国平安
|
|
49
|
+
print("[Insurance] 中国平安 (601318)")
|
|
50
|
+
df = await client.cn_company.fs.insurance.get_insurance_statements(
|
|
51
|
+
stock_codes=["601318"],
|
|
52
|
+
metrics=["q.ps.toi.t"],
|
|
53
|
+
date="latest",
|
|
54
|
+
)
|
|
55
|
+
print(df)
|
|
56
|
+
print()
|
|
57
|
+
|
|
58
|
+
# Security - 中信证券
|
|
59
|
+
print("[Security] 中信证券 (600030)")
|
|
60
|
+
df = await client.cn_company.fs.security.get_security_statements(
|
|
61
|
+
stock_codes=["600030"],
|
|
62
|
+
metrics=["q.ps.toi.t"],
|
|
63
|
+
date="latest",
|
|
64
|
+
)
|
|
65
|
+
print(df)
|
|
66
|
+
print()
|
|
67
|
+
|
|
68
|
+
# Other financial - 江苏租赁
|
|
69
|
+
print("[Other Financial] 江苏租赁 (600901)")
|
|
70
|
+
df = await client.cn_company.fs.other_financial.get_other_financial_statements(
|
|
71
|
+
stock_codes=["600901"],
|
|
72
|
+
metrics=["q.ps.toi.t"],
|
|
73
|
+
date="latest",
|
|
74
|
+
)
|
|
75
|
+
print(df)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
async def fetch_via_functional_api():
|
|
79
|
+
"""Fetch each financial statement using the functional API (also async)."""
|
|
80
|
+
# Non-financial - 比亚迪 last 4 quarters
|
|
81
|
+
print("[Functional/Non-financial] 比亚迪 (002594) last 4 quarters")
|
|
82
|
+
df = await get_non_financial_statements(
|
|
83
|
+
stock_codes=["002594"],
|
|
84
|
+
metrics=["q.ps.toi.t", "q.ps.np.t"],
|
|
85
|
+
start_date="2024-01-01",
|
|
86
|
+
end_date="2024-12-31",
|
|
87
|
+
limit=4,
|
|
88
|
+
)
|
|
89
|
+
print(df)
|
|
90
|
+
print()
|
|
91
|
+
|
|
92
|
+
# Bank - 招商银行
|
|
93
|
+
print("[Functional/Bank] 招商银行 (600036)")
|
|
94
|
+
df = await get_bank_statements(
|
|
95
|
+
stock_codes=["600036"],
|
|
96
|
+
metrics=["q.ps.oi.t"],
|
|
97
|
+
date="latest",
|
|
98
|
+
)
|
|
99
|
+
print(df)
|
|
100
|
+
print()
|
|
101
|
+
|
|
102
|
+
# Insurance - 中国人寿
|
|
103
|
+
print("[Functional/Insurance] 中国人寿 (601628)")
|
|
104
|
+
df = await get_insurance_statements(
|
|
105
|
+
stock_codes=["601628"],
|
|
106
|
+
metrics=["q.ps.toi.t"],
|
|
107
|
+
date="latest",
|
|
108
|
+
)
|
|
109
|
+
print(df)
|
|
110
|
+
print()
|
|
111
|
+
|
|
112
|
+
# Security - 海通证券
|
|
113
|
+
print("[Functional/Security] 海通证券 (600837)")
|
|
114
|
+
df = await get_security_statements(
|
|
115
|
+
stock_codes=["600837"],
|
|
116
|
+
metrics=["q.ps.toi.t"],
|
|
117
|
+
date="latest",
|
|
118
|
+
)
|
|
119
|
+
print(df)
|
|
120
|
+
print()
|
|
121
|
+
|
|
122
|
+
# Other financial - 渤海租赁
|
|
123
|
+
print("[Functional/Other Financial] 渤海租赁 (000415)")
|
|
124
|
+
df = await get_other_financial_statements(
|
|
125
|
+
stock_codes=["000415"],
|
|
126
|
+
metrics=["q.ps.toi.t"],
|
|
127
|
+
date="latest",
|
|
128
|
+
)
|
|
129
|
+
print(df)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async def main():
|
|
133
|
+
print("=== Fetching financial statements via namespace ===\n")
|
|
134
|
+
await fetch_via_namespace()
|
|
135
|
+
|
|
136
|
+
print("\n=== Fetching financial statements via functional API ===\n")
|
|
137
|
+
await fetch_via_functional_api()
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
asyncio.run(main())
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
from lixinger.api.cn.company import get_company, get_equity_change, get_profile
|
|
2
2
|
from lixinger.api.cn.company.candlestick import get_candlestick
|
|
3
|
-
from lixinger.api.cn.company.fs
|
|
3
|
+
from lixinger.api.cn.company.fs import (
|
|
4
|
+
get_bank_statements,
|
|
5
|
+
get_insurance_statements,
|
|
6
|
+
get_non_financial_statements,
|
|
7
|
+
get_other_financial_statements,
|
|
8
|
+
get_security_statements,
|
|
9
|
+
)
|
|
4
10
|
from lixinger.api.cn.company.fundamental import (
|
|
5
11
|
get_bank_fundamental,
|
|
6
12
|
get_insurance_fundamental,
|
|
@@ -73,6 +79,10 @@ __all__ = [
|
|
|
73
79
|
"get_index_candlestick",
|
|
74
80
|
"get_index_drawdown",
|
|
75
81
|
"get_non_financial_statements",
|
|
82
|
+
"get_bank_statements",
|
|
83
|
+
"get_insurance_statements",
|
|
84
|
+
"get_security_statements",
|
|
85
|
+
"get_other_financial_statements",
|
|
76
86
|
"get_non_financial_fundamental",
|
|
77
87
|
"get_bank_fundamental",
|
|
78
88
|
"get_insurance_fundamental",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Financial statement APIs.
|
|
2
|
+
|
|
3
|
+
This module provides access to company financial statement APIs by company type:
|
|
4
|
+
|
|
5
|
+
- non_financial: Non-financial companies (非金融企业)
|
|
6
|
+
- bank: Banks (银行)
|
|
7
|
+
- insurance: Insurance companies (保险)
|
|
8
|
+
- security: Securities companies (证券)
|
|
9
|
+
- other_financial: Other financial companies (租赁、消费金融等)
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from lixinger.api.cn.company.fs.bank import (
|
|
13
|
+
BankStatementAPI,
|
|
14
|
+
get_bank_statements,
|
|
15
|
+
)
|
|
16
|
+
from lixinger.api.cn.company.fs.insurance import (
|
|
17
|
+
InsuranceStatementAPI,
|
|
18
|
+
get_insurance_statements,
|
|
19
|
+
)
|
|
20
|
+
from lixinger.api.cn.company.fs.non_financial import (
|
|
21
|
+
NonFinancialStatementAPI,
|
|
22
|
+
get_non_financial_statements,
|
|
23
|
+
)
|
|
24
|
+
from lixinger.api.cn.company.fs.other_financial import (
|
|
25
|
+
OtherFinancialStatementAPI,
|
|
26
|
+
get_other_financial_statements,
|
|
27
|
+
)
|
|
28
|
+
from lixinger.api.cn.company.fs.security import (
|
|
29
|
+
SecurityStatementAPI,
|
|
30
|
+
get_security_statements,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
# API Classes
|
|
35
|
+
"BankStatementAPI",
|
|
36
|
+
"InsuranceStatementAPI",
|
|
37
|
+
"NonFinancialStatementAPI",
|
|
38
|
+
"OtherFinancialStatementAPI",
|
|
39
|
+
"SecurityStatementAPI",
|
|
40
|
+
# Functional APIs
|
|
41
|
+
"get_bank_statements",
|
|
42
|
+
"get_insurance_statements",
|
|
43
|
+
"get_non_financial_statements",
|
|
44
|
+
"get_other_financial_statements",
|
|
45
|
+
"get_security_statements",
|
|
46
|
+
]
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Bank financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.bank import BankStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BankStatementAPI(BaseAPI):
|
|
15
|
+
"""Bank financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_bank_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股上市银行的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/bank
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/bank
|
|
31
|
+
|
|
32
|
+
获取A股上市银行的财务报表数据,包括利润表、资产负债表、现金流量表、
|
|
33
|
+
正常财务指标以及银行特有财务指标(净息差、净利差、资本充足率、
|
|
34
|
+
不良率、拨贷比等)。
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
38
|
+
时只能传入一个股票代码。
|
|
39
|
+
metrics: 指标列表,格式为
|
|
40
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
41
|
+
例如 ``"q.ps.oi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
42
|
+
指标;等于 1 时最多 128 个指标。
|
|
43
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
44
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
45
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
46
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
包含A股银行财务报表数据的 DataFrame。
|
|
50
|
+
|
|
51
|
+
Example:
|
|
52
|
+
获取民生银行和工商银行的营业收入::
|
|
53
|
+
|
|
54
|
+
from lixinger import AsyncLixingerClient
|
|
55
|
+
|
|
56
|
+
async with AsyncLixingerClient() as client:
|
|
57
|
+
df = await client.cn_company.fs.bank.get_bank_statements(
|
|
58
|
+
stock_codes=["600016", "601398"],
|
|
59
|
+
metrics=["q.ps.oi.t"],
|
|
60
|
+
date="2026-03-31",
|
|
61
|
+
)
|
|
62
|
+
print(df)
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
payload: dict[str, Any] = {
|
|
66
|
+
"stockCodes": stock_codes,
|
|
67
|
+
"metricsList": metrics,
|
|
68
|
+
}
|
|
69
|
+
if date is not None:
|
|
70
|
+
payload["date"] = date
|
|
71
|
+
if start_date is not None:
|
|
72
|
+
payload["startDate"] = start_date
|
|
73
|
+
if end_date is not None:
|
|
74
|
+
payload["endDate"] = end_date
|
|
75
|
+
if limit is not None:
|
|
76
|
+
payload["limit"] = limit
|
|
77
|
+
|
|
78
|
+
data = await self._request("POST", "/cn/company/fs/bank", json=payload)
|
|
79
|
+
|
|
80
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"oi": {"t": ...}}}})
|
|
81
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
82
|
+
|
|
83
|
+
return get_response_df(flattened_data, BankStatementSchema)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Functional API instance
|
|
87
|
+
_api_instance = BankStatementAPI()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@api
|
|
91
|
+
async def get_bank_statements( # noqa: PLR0913
|
|
92
|
+
stock_codes: list[str],
|
|
93
|
+
metrics: list[str],
|
|
94
|
+
date: str | None = None,
|
|
95
|
+
start_date: str | None = None,
|
|
96
|
+
end_date: str | None = None,
|
|
97
|
+
limit: int | None = None,
|
|
98
|
+
) -> pd.DataFrame:
|
|
99
|
+
"""获取A股上市银行的财务报表数据.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
stock_codes: 股票代码列表。
|
|
103
|
+
metrics: 指标列表。
|
|
104
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
105
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
106
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
107
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
包含A股银行财务报表数据的 DataFrame。
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
获取民生银行的营业收入::
|
|
114
|
+
|
|
115
|
+
from lixinger import get_bank_statements
|
|
116
|
+
|
|
117
|
+
df = await get_bank_statements(
|
|
118
|
+
stock_codes=["600016"],
|
|
119
|
+
metrics=["q.ps.oi.t"],
|
|
120
|
+
date="2026-03-31",
|
|
121
|
+
)
|
|
122
|
+
print(df)
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
return await _api_instance.get_bank_statements(
|
|
126
|
+
stock_codes=stock_codes,
|
|
127
|
+
metrics=metrics,
|
|
128
|
+
date=date,
|
|
129
|
+
start_date=start_date,
|
|
130
|
+
end_date=end_date,
|
|
131
|
+
limit=limit,
|
|
132
|
+
)
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Insurance financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.insurance import InsuranceStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class InsuranceStatementAPI(BaseAPI):
|
|
15
|
+
"""Insurance financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_insurance_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股保险公司的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/insurance
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/insurance
|
|
31
|
+
|
|
32
|
+
获取A股保险公司的财务报表数据,包括利润表、资产负债表、现金流量表、
|
|
33
|
+
正常财务指标以及保险公司特有财务指标(内含价值、新业务价值、
|
|
34
|
+
核心偿付能力充足率、综合偿付能力充足率等)。
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
38
|
+
时只能传入一个股票代码。
|
|
39
|
+
metrics: 指标列表,格式为
|
|
40
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
41
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
42
|
+
指标;等于 1 时最多 128 个指标。
|
|
43
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
44
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
45
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
46
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
包含A股保险公司财务报表数据的 DataFrame。
|
|
50
|
+
|
|
51
|
+
Example:
|
|
52
|
+
获取中国平安的营业总收入::
|
|
53
|
+
|
|
54
|
+
from lixinger import AsyncLixingerClient
|
|
55
|
+
|
|
56
|
+
async with AsyncLixingerClient() as client:
|
|
57
|
+
df = await client.cn_company.fs.insurance.get_insurance_statements(
|
|
58
|
+
stock_codes=["601318"],
|
|
59
|
+
metrics=["q.ps.toi.t"],
|
|
60
|
+
date="2026-03-31",
|
|
61
|
+
)
|
|
62
|
+
print(df)
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
payload: dict[str, Any] = {
|
|
66
|
+
"stockCodes": stock_codes,
|
|
67
|
+
"metricsList": metrics,
|
|
68
|
+
}
|
|
69
|
+
if date is not None:
|
|
70
|
+
payload["date"] = date
|
|
71
|
+
if start_date is not None:
|
|
72
|
+
payload["startDate"] = start_date
|
|
73
|
+
if end_date is not None:
|
|
74
|
+
payload["endDate"] = end_date
|
|
75
|
+
if limit is not None:
|
|
76
|
+
payload["limit"] = limit
|
|
77
|
+
|
|
78
|
+
data = await self._request("POST", "/cn/company/fs/insurance", json=payload)
|
|
79
|
+
|
|
80
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
|
|
81
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
82
|
+
|
|
83
|
+
return get_response_df(flattened_data, InsuranceStatementSchema)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Functional API instance
|
|
87
|
+
_api_instance = InsuranceStatementAPI()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@api
|
|
91
|
+
async def get_insurance_statements( # noqa: PLR0913
|
|
92
|
+
stock_codes: list[str],
|
|
93
|
+
metrics: list[str],
|
|
94
|
+
date: str | None = None,
|
|
95
|
+
start_date: str | None = None,
|
|
96
|
+
end_date: str | None = None,
|
|
97
|
+
limit: int | None = None,
|
|
98
|
+
) -> pd.DataFrame:
|
|
99
|
+
"""获取A股保险公司的财务报表数据.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
stock_codes: 股票代码列表。
|
|
103
|
+
metrics: 指标列表。
|
|
104
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
105
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
106
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
107
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
包含A股保险公司财务报表数据的 DataFrame。
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
获取中国平安的营业总收入::
|
|
114
|
+
|
|
115
|
+
from lixinger import get_insurance_statements
|
|
116
|
+
|
|
117
|
+
df = await get_insurance_statements(
|
|
118
|
+
stock_codes=["601318"],
|
|
119
|
+
metrics=["q.ps.toi.t"],
|
|
120
|
+
date="2026-03-31",
|
|
121
|
+
)
|
|
122
|
+
print(df)
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
return await _api_instance.get_insurance_statements(
|
|
126
|
+
stock_codes=stock_codes,
|
|
127
|
+
metrics=metrics,
|
|
128
|
+
date=date,
|
|
129
|
+
start_date=start_date,
|
|
130
|
+
end_date=end_date,
|
|
131
|
+
limit=limit,
|
|
132
|
+
)
|
|
@@ -14,13 +14,14 @@ from lixinger.utils.dict import flatten_dict
|
|
|
14
14
|
class NonFinancialStatementAPI(BaseAPI):
|
|
15
15
|
"""Non-financial statement APIs."""
|
|
16
16
|
|
|
17
|
-
async def get_non_financial_statements(
|
|
17
|
+
async def get_non_financial_statements( # noqa: PLR0913
|
|
18
18
|
self,
|
|
19
19
|
stock_codes: list[str],
|
|
20
20
|
metrics: list[str],
|
|
21
21
|
date: str | None = None,
|
|
22
22
|
start_date: str | None = None,
|
|
23
23
|
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
24
25
|
) -> pd.DataFrame:
|
|
25
26
|
"""获取非金融企业财务报表数据.
|
|
26
27
|
|
|
@@ -34,6 +35,7 @@ class NonFinancialStatementAPI(BaseAPI):
|
|
|
34
35
|
date: 日期 (YYYY-MM-DD), 与 startDate 二选一
|
|
35
36
|
start_date: 开始日期 (YYYY-MM-DD), 与 date 二选一
|
|
36
37
|
end_date: 结束日期 (YYYY-MM-DD), 可选
|
|
38
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效
|
|
37
39
|
|
|
38
40
|
"""
|
|
39
41
|
payload: dict[str, Any] = {
|
|
@@ -46,6 +48,8 @@ class NonFinancialStatementAPI(BaseAPI):
|
|
|
46
48
|
payload["startDate"] = start_date
|
|
47
49
|
if end_date is not None:
|
|
48
50
|
payload["endDate"] = end_date
|
|
51
|
+
if limit is not None:
|
|
52
|
+
payload["limit"] = limit
|
|
49
53
|
|
|
50
54
|
data = await self._request("POST", "/cn/company/fs/non_financial", json=payload)
|
|
51
55
|
|
|
@@ -60,12 +64,13 @@ _api_instance = NonFinancialStatementAPI()
|
|
|
60
64
|
|
|
61
65
|
|
|
62
66
|
@api
|
|
63
|
-
async def get_non_financial_statements(
|
|
67
|
+
async def get_non_financial_statements( # noqa: PLR0913
|
|
64
68
|
stock_codes: list[str],
|
|
65
69
|
metrics: list[str],
|
|
66
70
|
date: str | None = None,
|
|
67
71
|
start_date: str | None = None,
|
|
68
72
|
end_date: str | None = None,
|
|
73
|
+
limit: int | None = None,
|
|
69
74
|
) -> pd.DataFrame:
|
|
70
75
|
"""获取非金融企业财务报表数据."""
|
|
71
76
|
return await _api_instance.get_non_financial_statements(
|
|
@@ -74,4 +79,5 @@ async def get_non_financial_statements(
|
|
|
74
79
|
date=date,
|
|
75
80
|
start_date=start_date,
|
|
76
81
|
end_date=end_date,
|
|
82
|
+
limit=limit,
|
|
77
83
|
)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Other financial company financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.other_financial import OtherFinancialStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class OtherFinancialStatementAPI(BaseAPI):
|
|
15
|
+
"""Other financial company financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_other_financial_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股其他金融公司(租赁、消费金融等)的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/other_financial
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/other_financial
|
|
31
|
+
|
|
32
|
+
获取A股其他金融公司(租赁、消费金融等)的财务报表数据,包括利润表、
|
|
33
|
+
资产负债表、现金流量表以及各类财务指标。
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
37
|
+
时只能传入一个股票代码。
|
|
38
|
+
metrics: 指标列表,格式为
|
|
39
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
40
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
41
|
+
指标;等于 1 时最多 128 个指标。
|
|
42
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
43
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
44
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
45
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
包含A股其他金融公司财务报表数据的 DataFrame。
|
|
49
|
+
|
|
50
|
+
Example:
|
|
51
|
+
获取江苏租赁的营业总收入::
|
|
52
|
+
|
|
53
|
+
from lixinger import AsyncLixingerClient
|
|
54
|
+
|
|
55
|
+
async with AsyncLixingerClient() as client:
|
|
56
|
+
df = await client.cn_company.fs.other_financial.get_other_financial_statements(
|
|
57
|
+
stock_codes=["600901"],
|
|
58
|
+
metrics=["q.ps.toi.t"],
|
|
59
|
+
date="2026-03-31",
|
|
60
|
+
)
|
|
61
|
+
print(df)
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
payload: dict[str, Any] = {
|
|
65
|
+
"stockCodes": stock_codes,
|
|
66
|
+
"metricsList": metrics,
|
|
67
|
+
}
|
|
68
|
+
if date is not None:
|
|
69
|
+
payload["date"] = date
|
|
70
|
+
if start_date is not None:
|
|
71
|
+
payload["startDate"] = start_date
|
|
72
|
+
if end_date is not None:
|
|
73
|
+
payload["endDate"] = end_date
|
|
74
|
+
if limit is not None:
|
|
75
|
+
payload["limit"] = limit
|
|
76
|
+
|
|
77
|
+
data = await self._request("POST", "/cn/company/fs/other_financial", json=payload)
|
|
78
|
+
|
|
79
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
|
|
80
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
81
|
+
|
|
82
|
+
return get_response_df(flattened_data, OtherFinancialStatementSchema)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# Functional API instance
|
|
86
|
+
_api_instance = OtherFinancialStatementAPI()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@api
|
|
90
|
+
async def get_other_financial_statements( # noqa: PLR0913
|
|
91
|
+
stock_codes: list[str],
|
|
92
|
+
metrics: list[str],
|
|
93
|
+
date: str | None = None,
|
|
94
|
+
start_date: str | None = None,
|
|
95
|
+
end_date: str | None = None,
|
|
96
|
+
limit: int | None = None,
|
|
97
|
+
) -> pd.DataFrame:
|
|
98
|
+
"""获取A股其他金融公司(租赁、消费金融等)的财务报表数据.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
stock_codes: 股票代码列表。
|
|
102
|
+
metrics: 指标列表。
|
|
103
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
104
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
105
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
106
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
包含A股其他金融公司财务报表数据的 DataFrame。
|
|
110
|
+
|
|
111
|
+
Example:
|
|
112
|
+
获取江苏租赁的营业总收入::
|
|
113
|
+
|
|
114
|
+
from lixinger import get_other_financial_statements
|
|
115
|
+
|
|
116
|
+
df = await get_other_financial_statements(
|
|
117
|
+
stock_codes=["600901"],
|
|
118
|
+
metrics=["q.ps.toi.t"],
|
|
119
|
+
date="2026-03-31",
|
|
120
|
+
)
|
|
121
|
+
print(df)
|
|
122
|
+
|
|
123
|
+
"""
|
|
124
|
+
return await _api_instance.get_other_financial_statements(
|
|
125
|
+
stock_codes=stock_codes,
|
|
126
|
+
metrics=metrics,
|
|
127
|
+
date=date,
|
|
128
|
+
start_date=start_date,
|
|
129
|
+
end_date=end_date,
|
|
130
|
+
limit=limit,
|
|
131
|
+
)
|