Skip to main content

Python package for obtaining open data from Instituto Canario de Estadística (ISTAC)

Project description

Logo istacpy

istacpy is a Python package for obtaining open data from Instituto Canario de Estadística (ISTAC). It provides a wrapper to the open API catalog.

Installation

pip install istacpy

Usage

The package is divided into several modules depending on the resource you want to retrieve.

Indicators

Example 1: Get a list of all available indicators:

>>> from istacpy.indicators import indicators
>>> indicators.get_indicators()

Example 2: Get a list of geographic granularities treated in the ISTAC-indicators database. For example provincial, insular or municipal granularity:

>>> from istacpy.indicators import geographic
>>> geographic.get_indicators_geographic_granularities()

istacpy.indicators.lite

This is a lite version of the rest of the indicators API. It’s a kind of wrapper to facilitate the access to indicators data. It’s not as powerful as the above functions but it hides a lot of the business logic of the API, so it’s quite suitable to quickly retrieve information.

Example: Get (absolute yearly) population of Lanzarote municipalities between 2010 and 2020:

>>> from istacpy.indicators.lite import indicators

>>> indicator = indicators.get_indicator('POBLACION')
>>> data = indicator.get_data(geo='M|Lanzarote', time='Y|2010:2020')

>>> data.as_dataframe()
      Arrecife  Haría  San Bartolomé  Teguise   Tías  Tinajo  Yaiza
2010     58156   5249          18161    20105  19869    5655  14242
2011     57357   5203          18468    20788  20102    5728  14871
2012     56284   5190          18487    21096  20228    5716  15131
2013     55673   4782          18541    21152  20451    5783  15571
2014     56880   4736          18689    21101  19658    5808  15068
2015     56940   4755          18402    21454  20019    5824  15815
2016     58537   4767          18151    21724  20037    5924  15944
2017     59771   4858          18249    21896  19964    6028  16257
2018     61351   4969          18327    22122  20006    6119  16289
2019     62988   5123          18816    22342  20170    6279  16571
2020     64645   5263          19099    22703  20628    6434  17040

Statistical resources

Example 1: Get all existing statistical data cubes:

>>> from istacpy.statisticalresources import cubes
>>> cubes.get_statisticalresources_datasets()

Example 2: Get all the data sets maintained by a certain organization:

>>> from istacpy.statisticalresources import cubes
>>> cubes.get_statisticalresources_datasets_agency(agencyid='ISTAC')

Structural resources

Example 1: Get a list of classifications:

>>> from istacpy.structuralresources import classifications
>>> classifications.get_structuralresources_codelists()

Example 2: Get a list of geographic coordinate from Icod de los Vinos:

>>> from istacpy.structuralresources import variables
>>> variables.get_structuralresources_geoinfo('VR_TERRITORIO', 'MUN_ICOD_VINOS')

Documentation

For a full documentation of all available functions within the package, please see http://istacpy.readthedocs.io/

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

Changelog

Consult the Changelog page for bugfixes and feature in each version.

Contact

You can also contact us via email at edatos.istac@gobiernodecanarias.org.

License

Copyright Instituto Canario de Estadística (ISTAC), 2018.

Distributed under the terms of the AGPLv3 license, istacpy is free and open source software.

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

istacpy-0.6.5.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

istacpy-0.6.5-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file istacpy-0.6.5.tar.gz.

File metadata

  • Download URL: istacpy-0.6.5.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for istacpy-0.6.5.tar.gz
Algorithm Hash digest
SHA256 bdeb9c2a8c16f3687bd9303bddfacb534f4d3f783d5b457d59563b4719166165
MD5 c3972ffec0ca813189aedf343e3a903f
BLAKE2b-256 adb53084af3278ff5a122d84e041e1277fd6c19aa80d782aa9cd7d5f1502bfb0

See more details on using hashes here.

File details

Details for the file istacpy-0.6.5-py3-none-any.whl.

File metadata

  • Download URL: istacpy-0.6.5-py3-none-any.whl
  • Upload date:
  • Size: 37.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for istacpy-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fe347b42fc1b2686981253b15a51915be3e97553be9b1f174405d807115ce75b
MD5 3373d4eff3581d19f07bace287600486
BLAKE2b-256 a829719129651c5c814c9850246043e7ddbd5e8e92a3848f3928fa9b194e9a3f

See more details on using hashes here.

Supported by

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