Package: istacpy
istacpyis a Python package for obtaining open data fromInstituto Canario de Estadística (ISTAC). It provides a wrapper to theopen API catalog.Installationpip install istacpyUsageThe package is divided into several modules depending on the resource you want to retrieve.IndicatorsExample 1: Get a list of all available indicators:>>>fromistacpy.indicatorsimportindicators>>>indicators.get_indicators()Example 2: Get a list of geographic granularities treated in the ISTAC-indicators database. For example provincial, insular or municipal granularity:>>>fromistacpy.indicatorsimportgeographic>>>geographic.get_indicators_geographic_granularities()istacpy.indicators.liteThis 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:>>>fromistacpy.indicators.liteimportindicators>>>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  Yaiza2010     58156   5249          18161    20105  19869    5655  142422011     57357   5203          18468    20788  20102    5728  148712012     56284   5190          18487    21096  20228    5716  151312013     55673   4782          18541    21152  20451    5783  155712014     56880   4736          18689    21101  19658    5808  150682015     56940   4755          18402    21454  20019    5824  158152016     58537   4767          18151    21724  20037    5924  159442017     59771   4858          18249    21896  19964    6028  162572018     61351   4969          18327    22122  20006    6119  162892019     62988   5123          18816    22342  20170    6279  165712020     64645   5263          19099    22703  20628    6434  17040Statistical resourcesExample 1: Get all existing statistical data cubes:>>>fromistacpy.statisticalresourcesimportcubes>>>cubes.get_statisticalresources_datasets()Example 2: Get all the data sets maintained by a certain organization:>>>fromistacpy.statisticalresourcesimportcubes>>>cubes.get_statisticalresources_datasets_agency(agencyid='ISTAC')Structural resourcesExample 1: Get a list of classifications:>>>fromistacpy.structuralresourcesimportclassifications>>>classifications.get_structuralresources_codelists()Example 2: Get a list of geographic coordinate fromIcod de los Vinos:>>>fromistacpy.structuralresourcesimportvariables>>>variables.get_structuralresources_geoinfo('VR_TERRITORIO','MUN_ICOD_VINOS')DocumentationFor a full documentation of all available functions within the package, please seehttp://istacpy.readthedocs.io/Bugs/RequestsPlease use theGitHub issue trackerto submit bugs or request features.ChangelogConsult theChangelogpage for bugfixes and feature in each version.ContactYou can also contact us via email atedatos.istac@gobiernodecanarias.org.LicenseCopyright Instituto Canario de Estadística (ISTAC), 2018.Distributed under the terms of theAGPLv3license, istacpy is free and open source software.