API for get all statistics data from BPS
Project description
STADATA
Introduction
The Indonesian Statistics provides statistical data for the Indonesian government and its citizens. To facilitate public access to the data generated by the Indonesian Statistics, an API has been created to access the data. This package simplifies the process for Python users to access the API using Python. With the existence of this package, it is hoped that the public will no longer need to visit the Indonesian Statistics website to download data.
Table of Contents
Installation
pip install stadata
Requirements
- Written for Python 3.7+
- Requires requests, html, pandas, tqdm
API
Setup Client
import stadata
client = stadata.Client('token')
token
- Required
- Token can be get from https://webapi.bps.go.id/developer/
API Methods
The following API methods are available:
- List Domain: return list of domain BPS's webpage from national level until city level. Domain used to get get data from spesific region.
- List Static Table: return all static table from BPS's webpage.
- List Dynamic Table: return all dynamic table from BPS's webpage.
- View Static Table: returns data of one static table.
- View Dynamic Table: returns data of one dynamic table.
List Domain
import stadata
client = stadata.Client('token')
client.list_domain()
List Static Table
import stadata
client = stadata.Client('token')
client.list_statictable(all=False, domain=[])
-
all
- optional
- Boolean
- True: get all static table from all domain, False: get static table from spesific domain
-
domain
- if all = True : optional else required
- Array
- List domain where static table from
List Dynamic Table
import stadata
client = stadata.Client('token')
client.list_dynamictable(all=False, domain=[])
-
all
- optional
- Boolean
- True: get all dynamic table from all domain, False: get dynamic table from spesific domain
-
domain
- if all = True : optional else required
- Array
- List domain where dynamic table from
View Static Table
import stadata
client = stadata.Client('token')
client.view_statictable(domain,table_id,lang='ind')
-
domain
- required
- string
- domain id where static table from
-
table_id
- required
- string
- table id from spesific static table that you want to see. Table id get be get from list static table
-
lang
- optional, default : 'ind'
- 'ind' or 'eng'
- language to display static table
View Dynamic Table
import stadata
client = stadata.Client('token')
client.view_dynamictable(domain,var,th='')
-
domain
- required
- string
- domain id where dynamic table from
-
var
- required
- string
- variable id, get it from list dynamic table
-
th
- optional, default : ''
- string
- period of dynamic table in year
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
stadata-0.0.2.tar.gz
(11.9 MB
view hashes)
Built Distribution
stadata-0.0.2-py3-none-any.whl
(12.1 MB
view hashes)