lixinger-python 0.3.6__tar.gz → 0.3.7__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.6 → lixinger_python-0.3.7}/PKG-INFO +1 -1
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/__init__.py +9 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/__init__.py +19 -0
- lixinger_python-0.3.7/lixinger/api/cn/index/fs/__init__.py +38 -0
- lixinger_python-0.3.7/lixinger/api/cn/index/fs/bank.py +130 -0
- lixinger_python-0.3.7/lixinger/api/cn/index/fs/hybrid.py +130 -0
- lixinger_python-0.3.7/lixinger/api/cn/index/fs/non_financial.py +130 -0
- lixinger_python-0.3.7/lixinger/api/cn/index/fs/security.py +130 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/namespace.py +57 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/client.py +16 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/__init__.py +11 -0
- lixinger_python-0.3.7/lixinger/models/cn/index/fs/__init__.py +13 -0
- lixinger_python-0.3.7/lixinger/models/cn/index/fs/bank.py +20 -0
- lixinger_python-0.3.7/lixinger/models/cn/index/fs/hybrid.py +20 -0
- lixinger_python-0.3.7/lixinger/models/cn/index/fs/non_financial.py +20 -0
- lixinger_python-0.3.7/lixinger/models/cn/index/fs/security.py +20 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/pyproject.toml +1 -1
- lixinger_python-0.3.7/tests/test_index_fs_bank.py +109 -0
- lixinger_python-0.3.7/tests/test_index_fs_hybrid.py +109 -0
- lixinger_python-0.3.7/tests/test_index_fs_non_financial.py +154 -0
- lixinger_python-0.3.7/tests/test_index_fs_security.py +109 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/uv.lock +1 -1
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.claude/settings.local.json +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.env.example +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.github/copilot-instructions.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.github/workflows/README.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.github/workflows/pr-checks.yml +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.gitignore +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.pre-commit-config.yaml +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.python-version +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/.ruff.toml +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/ADD_NEW_API_QUICK.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/AGENTS.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/CHANGELOG.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/CLAUDE.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/DOCS.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/LICENSE +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/MANIFEST.in +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/PUBLISHING.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/README.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/SETUP.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/codecov.yml +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/client.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/announcement.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/candlestick.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/company.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/dividend.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/equity_change.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/fs/non_financial.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/fundamental/bank.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/fundamental/insurance.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/fundamental/non_financial.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/fundamental/other_financial.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/fundamental/security.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/indices.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/company/profile.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/announcement.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/asset_combination.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/asset_industry_combination.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/candlestick.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/fund.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/profile.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/fund/shareholdings.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/candlestick.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/constituent_weightings.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/constituents.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/drawdown.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/fundamental.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/index.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/index/tracking_fund.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/api/overview.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/development/code-style.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/development/contributing.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/development/testing.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/examples/company.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/examples/fund.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/examples/index.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/getting-started/configuration.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/getting-started/installation.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/getting-started/quickstart.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/docs/index.md +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/examples/company_example.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/examples/company_profile_example.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/examples/dividend_example.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/examples/index_constituent_weightings_example.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/examples/index_constituents_example.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/examples/index_info_example.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/fund_response.json +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/base.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/announcement.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/company.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/dividend.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/equity_change.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fs/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fs/non_financial.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fundamental/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fundamental/bank.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fundamental/insurance.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fundamental/non_financial.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fundamental/other_financial.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/fundamental/security.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/indices.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/namespace.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/company/profile.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/announcement.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/asset_combination.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/asset_industry_combination.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/fund.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/profile.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/fund/shareholdings.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/constituent_weightings.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/constituents.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/drawdown.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/fundamental.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/index.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/api/cn/index/tracking_fund.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/config.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/exceptions.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/announcement.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/company.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/dividend.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/equity_change.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fs/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fs/non_financial.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fundamental/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fundamental/bank.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fundamental/insurance.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fundamental/non_financial.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fundamental/other_financial.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/fundamental/security.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/company/indices.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/announcement.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/asset_combination.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/asset_industry_combination.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/fund.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/profile.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/fund/shareholdings.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/constituent_weightings.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/constituents.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/drawdown.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/fundamental.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/index.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/models/cn/index/tracking_fund.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/py.typed +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/utils/__init__.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/utils/api.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/utils/dataframe.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/utils/dict.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/utils/rate_limiter.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/lixinger/utils/retry.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/mkdocs.yml +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/mypy.ini +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/scripts/explore_api.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/scripts/generate_docs.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/scripts/publish.sh +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/api/cn/company/test_announcement.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/api/cn/company/test_dividend.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/api/cn/index/test_constituents.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/conftest.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_client.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_cn_index_candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_cn_index_constituent_weightings.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_company.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_company_profile.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_equity_change.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund_announcement.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund_asset_combination.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund_asset_industry_combination.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund_candlestick.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund_profile.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fund_shareholdings.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fundamental.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fundamental_bank.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_fundamental_security.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_index.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_index_constituents.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_index_drawdown.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_index_fundamental.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_indices.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_integration.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_non_financial_statements.py +0 -0
- {lixinger_python-0.3.6 → lixinger_python-0.3.7}/tests/test_tracking_fund.py +0 -0
|
@@ -25,7 +25,11 @@ from lixinger.api.cn.index import (
|
|
|
25
25
|
get_constituent_weightings,
|
|
26
26
|
get_constituents,
|
|
27
27
|
get_index,
|
|
28
|
+
get_index_bank_statements,
|
|
28
29
|
get_index_fundamental,
|
|
30
|
+
get_index_hybrid_statements,
|
|
31
|
+
get_index_non_financial_statements,
|
|
32
|
+
get_index_security_statements,
|
|
29
33
|
get_tracking_fund,
|
|
30
34
|
)
|
|
31
35
|
from lixinger.api.cn.index import (
|
|
@@ -74,4 +78,9 @@ __all__ = [
|
|
|
74
78
|
"get_insurance_fundamental",
|
|
75
79
|
"get_security_fundamental",
|
|
76
80
|
"get_other_financial_fundamental",
|
|
81
|
+
# Index financial statements
|
|
82
|
+
"get_index_non_financial_statements",
|
|
83
|
+
"get_index_bank_statements",
|
|
84
|
+
"get_index_security_statements",
|
|
85
|
+
"get_index_hybrid_statements",
|
|
77
86
|
]
|
|
@@ -7,6 +7,16 @@ from lixinger.api.cn.index.constituent_weightings import (
|
|
|
7
7
|
)
|
|
8
8
|
from lixinger.api.cn.index.constituents import ConstituentsAPI, get_constituents
|
|
9
9
|
from lixinger.api.cn.index.drawdown import DrawdownAPI, get_drawdown
|
|
10
|
+
from lixinger.api.cn.index.fs import (
|
|
11
|
+
IndexBankStatementAPI,
|
|
12
|
+
IndexHybridStatementAPI,
|
|
13
|
+
IndexNonFinancialStatementAPI,
|
|
14
|
+
IndexSecurityStatementAPI,
|
|
15
|
+
get_index_bank_statements,
|
|
16
|
+
get_index_hybrid_statements,
|
|
17
|
+
get_index_non_financial_statements,
|
|
18
|
+
get_index_security_statements,
|
|
19
|
+
)
|
|
10
20
|
from lixinger.api.cn.index.fundamental import (
|
|
11
21
|
IndexFundamentalAPI,
|
|
12
22
|
get_index_fundamental,
|
|
@@ -29,4 +39,13 @@ __all__ = [
|
|
|
29
39
|
"get_index_fundamental",
|
|
30
40
|
"TrackingFundAPI",
|
|
31
41
|
"get_tracking_fund",
|
|
42
|
+
# Index financial statements
|
|
43
|
+
"IndexBankStatementAPI",
|
|
44
|
+
"IndexHybridStatementAPI",
|
|
45
|
+
"IndexNonFinancialStatementAPI",
|
|
46
|
+
"IndexSecurityStatementAPI",
|
|
47
|
+
"get_index_bank_statements",
|
|
48
|
+
"get_index_hybrid_statements",
|
|
49
|
+
"get_index_non_financial_statements",
|
|
50
|
+
"get_index_security_statements",
|
|
32
51
|
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Index financial statement APIs.
|
|
2
|
+
|
|
3
|
+
This module provides access to index financial statement APIs by index type:
|
|
4
|
+
- Non-financial indices (非金融类指数)
|
|
5
|
+
- Bank indices (银行类指数)
|
|
6
|
+
- Security indices (证券类指数)
|
|
7
|
+
- Hybrid indices (混合型指数)
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from lixinger.api.cn.index.fs.bank import (
|
|
11
|
+
IndexBankStatementAPI,
|
|
12
|
+
get_index_bank_statements,
|
|
13
|
+
)
|
|
14
|
+
from lixinger.api.cn.index.fs.hybrid import (
|
|
15
|
+
IndexHybridStatementAPI,
|
|
16
|
+
get_index_hybrid_statements,
|
|
17
|
+
)
|
|
18
|
+
from lixinger.api.cn.index.fs.non_financial import (
|
|
19
|
+
IndexNonFinancialStatementAPI,
|
|
20
|
+
get_index_non_financial_statements,
|
|
21
|
+
)
|
|
22
|
+
from lixinger.api.cn.index.fs.security import (
|
|
23
|
+
IndexSecurityStatementAPI,
|
|
24
|
+
get_index_security_statements,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
# API Classes
|
|
29
|
+
"IndexBankStatementAPI",
|
|
30
|
+
"IndexHybridStatementAPI",
|
|
31
|
+
"IndexNonFinancialStatementAPI",
|
|
32
|
+
"IndexSecurityStatementAPI",
|
|
33
|
+
# Functional APIs
|
|
34
|
+
"get_index_bank_statements",
|
|
35
|
+
"get_index_hybrid_statements",
|
|
36
|
+
"get_index_non_financial_statements",
|
|
37
|
+
"get_index_security_statements",
|
|
38
|
+
]
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Index bank 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.index.fs.bank import IndexBankStatementSchema
|
|
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 IndexBankStatementAPI(BaseAPI):
|
|
15
|
+
"""Index bank 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
|
+
"""获取银行类指数的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/index/fs/bank
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/bank
|
|
31
|
+
|
|
32
|
+
获取银行类大陆指数(样本仅包含银行)的财务数据,包括利润表、
|
|
33
|
+
资产负债表、现金流量表、财务指标。
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
|
|
37
|
+
传入一个指数代码。
|
|
38
|
+
metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
|
|
39
|
+
例如 ``"q.ps.oi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
|
|
40
|
+
等于 1 时最多 128 个指标。
|
|
41
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
42
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
43
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
44
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
包含银行类指数财务报表数据的 DataFrame。
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
获取中证银行指数的营业收入::
|
|
51
|
+
|
|
52
|
+
from lixinger import AsyncLixingerClient
|
|
53
|
+
|
|
54
|
+
async with AsyncLixingerClient() as client:
|
|
55
|
+
df = await client.index.fs.bank.get_bank_statements(
|
|
56
|
+
stock_codes=["399986"],
|
|
57
|
+
metrics=["q.ps.oi.t"],
|
|
58
|
+
date="2026-03-31",
|
|
59
|
+
)
|
|
60
|
+
print(df)
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
payload: dict[str, Any] = {
|
|
64
|
+
"stockCodes": stock_codes,
|
|
65
|
+
"metricsList": metrics,
|
|
66
|
+
}
|
|
67
|
+
if date is not None:
|
|
68
|
+
payload["date"] = date
|
|
69
|
+
if start_date is not None:
|
|
70
|
+
payload["startDate"] = start_date
|
|
71
|
+
if end_date is not None:
|
|
72
|
+
payload["endDate"] = end_date
|
|
73
|
+
if limit is not None:
|
|
74
|
+
payload["limit"] = limit
|
|
75
|
+
|
|
76
|
+
data = await self._request("POST", "/cn/index/fs/bank", json=payload)
|
|
77
|
+
|
|
78
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"oi": {"t": ...}}}})
|
|
79
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
80
|
+
|
|
81
|
+
return get_response_df(flattened_data, IndexBankStatementSchema)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Functional API instance
|
|
85
|
+
_api_instance = IndexBankStatementAPI()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@api
|
|
89
|
+
async def get_index_bank_statements( # noqa: PLR0913
|
|
90
|
+
stock_codes: list[str],
|
|
91
|
+
metrics: list[str],
|
|
92
|
+
date: str | None = None,
|
|
93
|
+
start_date: str | None = None,
|
|
94
|
+
end_date: str | None = None,
|
|
95
|
+
limit: int | None = None,
|
|
96
|
+
) -> pd.DataFrame:
|
|
97
|
+
"""获取银行类指数的财务报表数据.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
stock_codes: 指数代码列表。
|
|
101
|
+
metrics: 指标列表。
|
|
102
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
103
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
104
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
105
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
包含银行类指数财务报表数据的 DataFrame。
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
获取中证银行指数的营业收入::
|
|
112
|
+
|
|
113
|
+
from lixinger import get_index_bank_statements
|
|
114
|
+
|
|
115
|
+
df = await get_index_bank_statements(
|
|
116
|
+
stock_codes=["399986"],
|
|
117
|
+
metrics=["q.ps.oi.t"],
|
|
118
|
+
date="2026-03-31",
|
|
119
|
+
)
|
|
120
|
+
print(df)
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
return await _api_instance.get_bank_statements(
|
|
124
|
+
stock_codes=stock_codes,
|
|
125
|
+
metrics=metrics,
|
|
126
|
+
date=date,
|
|
127
|
+
start_date=start_date,
|
|
128
|
+
end_date=end_date,
|
|
129
|
+
limit=limit,
|
|
130
|
+
)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Index hybrid 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.index.fs.hybrid import IndexHybridStatementSchema
|
|
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 IndexHybridStatementAPI(BaseAPI):
|
|
15
|
+
"""Index hybrid statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_hybrid_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
|
+
"""获取混合型指数的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/index/fs/hybrid
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/hybrid
|
|
31
|
+
|
|
32
|
+
获取混合型大陆指数(样本同时包含金融公司和非金融公司)的财务数据,
|
|
33
|
+
包括利润表、资产负债表、现金流量表、财务指标。
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
|
|
37
|
+
传入一个指数代码。
|
|
38
|
+
metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
|
|
39
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
|
|
40
|
+
等于 1 时最多 128 个指标。
|
|
41
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
42
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
43
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
44
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
包含混合型指数财务报表数据的 DataFrame。
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
获取上证 50 的营业总收入::
|
|
51
|
+
|
|
52
|
+
from lixinger import AsyncLixingerClient
|
|
53
|
+
|
|
54
|
+
async with AsyncLixingerClient() as client:
|
|
55
|
+
df = await client.index.fs.hybrid.get_hybrid_statements(
|
|
56
|
+
stock_codes=["000016"],
|
|
57
|
+
metrics=["q.ps.toi.t"],
|
|
58
|
+
date="2026-03-31",
|
|
59
|
+
)
|
|
60
|
+
print(df)
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
payload: dict[str, Any] = {
|
|
64
|
+
"stockCodes": stock_codes,
|
|
65
|
+
"metricsList": metrics,
|
|
66
|
+
}
|
|
67
|
+
if date is not None:
|
|
68
|
+
payload["date"] = date
|
|
69
|
+
if start_date is not None:
|
|
70
|
+
payload["startDate"] = start_date
|
|
71
|
+
if end_date is not None:
|
|
72
|
+
payload["endDate"] = end_date
|
|
73
|
+
if limit is not None:
|
|
74
|
+
payload["limit"] = limit
|
|
75
|
+
|
|
76
|
+
data = await self._request("POST", "/cn/index/fs/hybrid", json=payload)
|
|
77
|
+
|
|
78
|
+
# Flatten nested metrics
|
|
79
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
80
|
+
|
|
81
|
+
return get_response_df(flattened_data, IndexHybridStatementSchema)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Functional API instance
|
|
85
|
+
_api_instance = IndexHybridStatementAPI()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@api
|
|
89
|
+
async def get_index_hybrid_statements( # noqa: PLR0913
|
|
90
|
+
stock_codes: list[str],
|
|
91
|
+
metrics: list[str],
|
|
92
|
+
date: str | None = None,
|
|
93
|
+
start_date: str | None = None,
|
|
94
|
+
end_date: str | None = None,
|
|
95
|
+
limit: int | None = None,
|
|
96
|
+
) -> pd.DataFrame:
|
|
97
|
+
"""获取混合型指数的财务报表数据.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
stock_codes: 指数代码列表。
|
|
101
|
+
metrics: 指标列表。
|
|
102
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
103
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
104
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
105
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
包含混合型指数财务报表数据的 DataFrame。
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
获取上证 50 的营业总收入::
|
|
112
|
+
|
|
113
|
+
from lixinger import get_index_hybrid_statements
|
|
114
|
+
|
|
115
|
+
df = await get_index_hybrid_statements(
|
|
116
|
+
stock_codes=["000016"],
|
|
117
|
+
metrics=["q.ps.toi.t"],
|
|
118
|
+
date="2026-03-31",
|
|
119
|
+
)
|
|
120
|
+
print(df)
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
return await _api_instance.get_hybrid_statements(
|
|
124
|
+
stock_codes=stock_codes,
|
|
125
|
+
metrics=metrics,
|
|
126
|
+
date=date,
|
|
127
|
+
start_date=start_date,
|
|
128
|
+
end_date=end_date,
|
|
129
|
+
limit=limit,
|
|
130
|
+
)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Index non-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.index.fs.non_financial import IndexNonFinancialStatementSchema
|
|
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 IndexNonFinancialStatementAPI(BaseAPI):
|
|
15
|
+
"""Index non-financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_non_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
|
+
"""获取非金融类指数的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/index/fs/non_financial
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/non_financial
|
|
31
|
+
|
|
32
|
+
获取非金融类大陆指数(样本仅包含非金融公司)的财务数据,包括利润表、
|
|
33
|
+
资产负债表、现金流量表、财务指标。
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
|
|
37
|
+
传入一个指数代码。
|
|
38
|
+
metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
|
|
39
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
|
|
40
|
+
等于 1 时最多 128 个指标。
|
|
41
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
42
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
43
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
44
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
包含非金融类指数财务报表数据的 DataFrame。
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
获取中证白酒指数的营业总收入::
|
|
51
|
+
|
|
52
|
+
from lixinger import AsyncLixingerClient
|
|
53
|
+
|
|
54
|
+
async with AsyncLixingerClient() as client:
|
|
55
|
+
df = await client.index.fs.non_financial.get_non_financial_statements(
|
|
56
|
+
stock_codes=["000932"],
|
|
57
|
+
metrics=["q.ps.toi.t"],
|
|
58
|
+
date="2026-03-31",
|
|
59
|
+
)
|
|
60
|
+
print(df)
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
payload: dict[str, Any] = {
|
|
64
|
+
"stockCodes": stock_codes,
|
|
65
|
+
"metricsList": metrics,
|
|
66
|
+
}
|
|
67
|
+
if date is not None:
|
|
68
|
+
payload["date"] = date
|
|
69
|
+
if start_date is not None:
|
|
70
|
+
payload["startDate"] = start_date
|
|
71
|
+
if end_date is not None:
|
|
72
|
+
payload["endDate"] = end_date
|
|
73
|
+
if limit is not None:
|
|
74
|
+
payload["limit"] = limit
|
|
75
|
+
|
|
76
|
+
data = await self._request("POST", "/cn/index/fs/non_financial", json=payload)
|
|
77
|
+
|
|
78
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
|
|
79
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
80
|
+
|
|
81
|
+
return get_response_df(flattened_data, IndexNonFinancialStatementSchema)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Functional API instance
|
|
85
|
+
_api_instance = IndexNonFinancialStatementAPI()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@api
|
|
89
|
+
async def get_index_non_financial_statements( # noqa: PLR0913
|
|
90
|
+
stock_codes: list[str],
|
|
91
|
+
metrics: list[str],
|
|
92
|
+
date: str | None = None,
|
|
93
|
+
start_date: str | None = None,
|
|
94
|
+
end_date: str | None = None,
|
|
95
|
+
limit: int | None = None,
|
|
96
|
+
) -> pd.DataFrame:
|
|
97
|
+
"""获取非金融类指数的财务报表数据.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
stock_codes: 指数代码列表。
|
|
101
|
+
metrics: 指标列表。
|
|
102
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
103
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
104
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
105
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
包含非金融类指数财务报表数据的 DataFrame。
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
获取中证白酒指数的营业总收入::
|
|
112
|
+
|
|
113
|
+
from lixinger import get_index_non_financial_statements
|
|
114
|
+
|
|
115
|
+
df = await get_index_non_financial_statements(
|
|
116
|
+
stock_codes=["000932"],
|
|
117
|
+
metrics=["q.ps.toi.t"],
|
|
118
|
+
date="2026-03-31",
|
|
119
|
+
)
|
|
120
|
+
print(df)
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
return await _api_instance.get_non_financial_statements(
|
|
124
|
+
stock_codes=stock_codes,
|
|
125
|
+
metrics=metrics,
|
|
126
|
+
date=date,
|
|
127
|
+
start_date=start_date,
|
|
128
|
+
end_date=end_date,
|
|
129
|
+
limit=limit,
|
|
130
|
+
)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Index security 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.index.fs.security import IndexSecurityStatementSchema
|
|
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 IndexSecurityStatementAPI(BaseAPI):
|
|
15
|
+
"""Index security statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_security_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
|
+
"""获取证券类指数的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/index/fs/security
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/security
|
|
31
|
+
|
|
32
|
+
获取证券类大陆指数(样本仅包含证券公司)的财务数据,包括利润表、
|
|
33
|
+
资产负债表、现金流量表、财务指标。
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
|
|
37
|
+
传入一个指数代码。
|
|
38
|
+
metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
|
|
39
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
|
|
40
|
+
等于 1 时最多 128 个指标。
|
|
41
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
42
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
43
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
44
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
包含证券类指数财务报表数据的 DataFrame。
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
获取证券公司指数的营业总收入::
|
|
51
|
+
|
|
52
|
+
from lixinger import AsyncLixingerClient
|
|
53
|
+
|
|
54
|
+
async with AsyncLixingerClient() as client:
|
|
55
|
+
df = await client.index.fs.security.get_security_statements(
|
|
56
|
+
stock_codes=["399975"],
|
|
57
|
+
metrics=["q.ps.toi.t"],
|
|
58
|
+
date="2026-03-31",
|
|
59
|
+
)
|
|
60
|
+
print(df)
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
payload: dict[str, Any] = {
|
|
64
|
+
"stockCodes": stock_codes,
|
|
65
|
+
"metricsList": metrics,
|
|
66
|
+
}
|
|
67
|
+
if date is not None:
|
|
68
|
+
payload["date"] = date
|
|
69
|
+
if start_date is not None:
|
|
70
|
+
payload["startDate"] = start_date
|
|
71
|
+
if end_date is not None:
|
|
72
|
+
payload["endDate"] = end_date
|
|
73
|
+
if limit is not None:
|
|
74
|
+
payload["limit"] = limit
|
|
75
|
+
|
|
76
|
+
data = await self._request("POST", "/cn/index/fs/security", json=payload)
|
|
77
|
+
|
|
78
|
+
# Flatten nested metrics
|
|
79
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
80
|
+
|
|
81
|
+
return get_response_df(flattened_data, IndexSecurityStatementSchema)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Functional API instance
|
|
85
|
+
_api_instance = IndexSecurityStatementAPI()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@api
|
|
89
|
+
async def get_index_security_statements( # noqa: PLR0913
|
|
90
|
+
stock_codes: list[str],
|
|
91
|
+
metrics: list[str],
|
|
92
|
+
date: str | None = None,
|
|
93
|
+
start_date: str | None = None,
|
|
94
|
+
end_date: str | None = None,
|
|
95
|
+
limit: int | None = None,
|
|
96
|
+
) -> pd.DataFrame:
|
|
97
|
+
"""获取证券类指数的财务报表数据.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
stock_codes: 指数代码列表。
|
|
101
|
+
metrics: 指标列表。
|
|
102
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
103
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
104
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
105
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
包含证券类指数财务报表数据的 DataFrame。
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
获取证券公司指数的营业总收入::
|
|
112
|
+
|
|
113
|
+
from lixinger import get_index_security_statements
|
|
114
|
+
|
|
115
|
+
df = await get_index_security_statements(
|
|
116
|
+
stock_codes=["399975"],
|
|
117
|
+
metrics=["q.ps.toi.t"],
|
|
118
|
+
date="2026-03-31",
|
|
119
|
+
)
|
|
120
|
+
print(df)
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
return await _api_instance.get_security_statements(
|
|
124
|
+
stock_codes=stock_codes,
|
|
125
|
+
metrics=metrics,
|
|
126
|
+
date=date,
|
|
127
|
+
start_date=start_date,
|
|
128
|
+
end_date=end_date,
|
|
129
|
+
limit=limit,
|
|
130
|
+
)
|