A python library for accessing official statistics of Japan.
Project description
jpstat
A python package for accessing the official statistics of Japan.
Features
Install
pip install jpstat
estat API
Functions
All functions return one or multiple pandas DataFrames.
To see a list of statistics offered by estat api
import jpstat
stat = jpstat.estat.get_stat()
To search data by either the code of a statistic or some key words
data = jpstat.estat.get_list(statsCode="00400001")
data = jpstat.estat.get_list(searchWord="企業")
To dowload data
data, note = jpstat.estat.statsDataId(statsCode="0000040001")
Configuration
You can pass the estat api key to each function. Or you can set a configuration
jpstat.options["estat.api_key"] = "MY_API_KEY"
You can also set the language from Japanese (default: J) to English
jpstat.options["estat.lang"] = "E"
To see a list of valid configuration options
jpstat.config.describe_options()
estat File
Many statistics and datasets in estat can not be accessed through API, but are excel, csv, or pdf files and can be downloaded.
Functions
To see a list of all statistics in estat that have downloadable files
data = jpstat.estatFile.get_stat()
It will take some time to scraping the website of estat at the first time and then save the list to options["estat.data_dir"]
. From then on, the function would first try to read the local file. You can force to scrape again by setting update=True
.
To search data files by code of a statistic and the survey year (optional)
data = jpstat.estatFile.get_list(statsCode="00400001")
data = jpstat.estatFile.get_list(statsCode="00400001", year="1950")
Use the information of data id and file type ("EXCEL"/"CSV"/"PDF") in estatFile.get_list
to download the file
data = jpstat.estatFile.get_file(statsDataId="000029094935", file_type="EXCEL")
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
Built Distribution
File details
Details for the file jpstat-0.0.2.tar.gz
.
File metadata
- Download URL: jpstat-0.0.2.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9ea3ddf0c0c58b3be061347d5c9d11fc4f94464a33c49262ca69e9f6e53faa1 |
|
MD5 | fcfa63a2fae9e032f4287a5055a63f82 |
|
BLAKE2b-256 | 9ad8740b88d7e8d7d4c0eb6eb313a573f075f49f0179904fefe9f3cb0bd6c070 |
File details
Details for the file jpstat-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: jpstat-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45a0de0b4d9a3d3215e11a2bfe9b4dc1d75a06cbf354941b8051d2707497b66a |
|
MD5 | 4917e530cd1fdf2ebcbcde8b880de690 |
|
BLAKE2b-256 | cdaed1a6168e45eaf65657006530324c8cf6df0b45ad02577cb8c94f7b3834c4 |