Skip to main content

Download macroeconomic data from China's National Bureau of Statistics (data.stats.gov.cn).

Project description

cnstats-py

PyPI

A Python package to easily download macroeconomic data from the National Bureau of Statistics of China (https://data.stats.gov.cn).

Installation

pip install cnstats-py
# or
pipenv install cnstats-py

Basic Usage

import cnstats

# Example: Get data for a specific indicator and year
data: pd.DataFrame = cnstats.query_data(DBCode.hgyd, "A01010G", "2024")
print(data.shape)

In terminal:

python -m cnstats query_data --dbcode hgyd --zbcode A01010G --sj 2024

Features

  • Fetch data from the National Bureau of Statistics of China
  • Support for multiple databases and indicators
  • Easy to use command line interface
  • Data is returned as a pandas DataFrame for easy manipulation and analysis
  • Support for multiple data formats (CSV, DTA, etc.)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cnstats_py-0.0.4.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cnstats_py-0.0.4-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file cnstats_py-0.0.4.tar.gz.

File metadata

  • Download URL: cnstats_py-0.0.4.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cnstats_py-0.0.4.tar.gz
Algorithm Hash digest
SHA256 c14cb79d54754924b2ace80ac245408f880f5c247336a8ed9807845be3f0b349
MD5 0e966a3ef307028fd0cd2a1390a104c4
BLAKE2b-256 e92132d37f1a21144d757f935cc477451eed5250b61c2e9703e4a406442ba59c

See more details on using hashes here.

Provenance

The following attestation bundles were made for cnstats_py-0.0.4.tar.gz:

Publisher: publish.yml on clsrfish/cnstats-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cnstats_py-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: cnstats_py-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cnstats_py-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e235990119d7e70b83013434b679957c4a9fccf3c49945aa113acf445d670ee0
MD5 28d5b949a2604bb43e058928c6d26508
BLAKE2b-256 c9bb6b20c81179fb0536879f0ae8942a3332a9d23496f00a2423a17c54bed695

See more details on using hashes here.

Provenance

The following attestation bundles were made for cnstats_py-0.0.4-py3-none-any.whl:

Publisher: publish.yml on clsrfish/cnstats-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page