Skip to main content

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

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

Base URL

The package allows you to consult data from any eDatos API catalog instance. To change default instance (https://datos.canarias.es/api/estadisticas/), use the change_api_url method.

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.

Metadata

Release files for istacpy 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for istacpy 0.8.1
File Size Uploaded
istacpy-0.8.1.tar.gz 39.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for istacpy 0.8.1
File Interpreter ABI Platform
istacpy-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 81.2 kB

Release files / istacpy-0.8.1.tar.gz

Download URL istacpy-0.8.1.tar.gz
Size 39.6 kB
Tags Source
SHA-256 checksum
How to use checksums
96b3c293e19c6e82a8f321ce234f5a70a1b580590293e3e4b9578e3b430fdd83
BLAKE2b-256 checksum
How to use checksums
cd32f606b501e960dbbb1b01c5ee3af1f9cd625551364e467a6bf5afa901a532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / istacpy-0.8.1-py3-none-any.whl

Download URL istacpy-0.8.1-py3-none-any.whl
Size 41.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1220a674470886e006c74290843969fb820d6af67b712082898a461368134dc8
BLAKE2b-256 checksum
How to use checksums
2f69a468d7f61c91e767a8b30896d669ebb8b365e2e601e89569ca542c0b90f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page