Metadata-Version: 2.1
Name: stadata
Version: 0.0.2
Summary: API for get all statistics data from BPS
Author-email: Ignatius Sandyawan <isandyawan@gmail.com>
License: MIT
Project-URL: homepage, https://github.com/bps-statistics/stadata
Keywords: bps dataset utility indonesia
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests (>=2.0)
Requires-Dist: pandas (>=0.25)
Requires-Dist: tqdm

# 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](#installation)

* [API](#api)

  * [API Methods](#api-methods)
    * [List Domain](#list-domain)
    * [List Static Table](#list-static-table)
    * [List Dynamic Table](#list-dynamictable)
    * [View Static Table](#view-statictable)
    * [View Dynamic Table](#view-dynamictable)

## Installation

    pip install stadata

## Requirements

* Written for Python 3.7+
* Requires requests, html, pandas, tqdm

<sub><sup>[back to top](#pytrends)</sub></sup>

## API

### Setup Client

    import stadata
    client = stadata.Client('token')

* `token`
    - *Required*
    - Token can be get from https://webapi.bps.go.id/developer/


<sub><sup>[back to top](#API)</sub></sup>

## API Methods

The following API methods are available:

* [List Domain](#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](#list-static-table): return all static table from BPS's webpage.
* [List Dynamic Table](#list-dynamic-table): return all dynamic table from BPS's webpage.
* [View Static Table](#view-static-table): returns data of one static table. 
* [View Dynamic Table](#view-dynamic-table): returns data of one dynamic table. 

<sub><sup>[back to top](#api-methods)</sub></sup>

## 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
