istacpy


Nameistacpy JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://www.gobiernodecanarias.org/istac/api/
SummaryPython package for obtaining open data from Instituto Canario de Estadística (ISTAC)
upload_time2025-07-11 12:28:25
maintainerNone
docs_urlNone
authorInstituto Canario de Estadistica (ISTAC)
requires_python>=3.6
licensegpl-3.0
keywords istacpy istac instituto canario de estadistica api json
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Logo istacpy](https://raw.githubusercontent.com/eDatos/istacpy/master/istacpy-logo.svg)

`istacpy` is a Python package for obtaining open data from [Instituto Canario de Estadística (ISTAC)](http://www.gobiernodecanarias.org/istac/). It provides a wrapper to the [open API catalog](https://www3.gobiernodecanarias.org/aplicaciones/appsistac/api).

## Installation

```console
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:

```pycon
>>> 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:

```pycon
>>> 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:

```pycon
>>> 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:

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

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

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

### Structural resources

**Example 1**: Get a list of classifications:

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

**Example 2**: Get a list of geographic coordinate from [Icod de los Vinos](https://www.icoddelosvinos.es/):

```pycon
>>> 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:

* [istacpy.indicators](docs/md/indicators.md): Systems, instances, granularities and subjects of indicators.
* [istacpy.statisticalresources](docs/md/statisticalresources.md): Datasets and queries of cubes.
* [istacpy.structuralresources](docs/md/structuralresources.md): Categories, schemes, classifications, families and concepts for normalize statistical resources.
* [Error handling](docs/md/error_handling.md)

> **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](https://github.com/eDatos/istacpy/issues) to submit bugs or request features.

## Changelog

Consult the [Changelog](CHANGELOG.md) page for bugfixes and feature in each version.

## Contact

You can also contact us via email at [edatos.istac@gobiernodecanarias.org](mailto:edatos.istac@gobiernodecanarias.org).

## License

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

Distributed under the terms of the [AGPLv3](LICENSE) license, istacpy is free and open source software.

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.gobiernodecanarias.org/istac/api/",
    "name": "istacpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "istacpy, ISTAC, Instituto Canario de Estadistica, API, JSON",
    "author": "Instituto Canario de Estadistica (ISTAC)",
    "author_email": "consultas.istac@gobiernodecanarias.org",
    "download_url": "https://files.pythonhosted.org/packages/c7/39/9ebcb8b45b035188c7befa4bc61cf659f01d755184d52e2224844784cf71/istacpy-0.8.0.tar.gz",
    "platform": null,
    "description": "![Logo istacpy](https://raw.githubusercontent.com/eDatos/istacpy/master/istacpy-logo.svg)\r\n\r\n`istacpy` is a Python package for obtaining open data from [Instituto Canario de Estad\u00c3\u00adstica (ISTAC)](http://www.gobiernodecanarias.org/istac/). It provides a wrapper to the [open API catalog](https://www3.gobiernodecanarias.org/aplicaciones/appsistac/api).\r\n\r\n## Installation\r\n\r\n```console\r\npip install istacpy\r\n```\r\n\r\n## Usage\r\n\r\nThe package is divided into several modules depending on the resource you want to retrieve.\r\n\r\n### Indicators\r\n\r\n**Example 1**: Get a list of all available indicators:\r\n\r\n```pycon\r\n>>> from istacpy.indicators import indicators\r\n>>> indicators.get_indicators()\r\n```\r\n\r\n**Example 2**: Get a list of geographic granularities treated in the ISTAC-indicators database. For example provincial, insular or municipal granularity:\r\n\r\n```pycon\r\n>>> from istacpy.indicators import geographic\r\n>>> geographic.get_indicators_geographic_granularities()\r\n```\r\n\r\n#### `istacpy.indicators.lite`\r\n\r\nThis is a lite version of the rest of the indicators API. It\u00e2\u20ac\u2122s a kind of wrapper to facilitate the access to indicators data. It\u00e2\u20ac\u2122s not as powerful as the above functions but it hides a lot of the business logic of the API, so it\u00e2\u20ac\u2122s quite suitable to quickly retrieve information.\r\n\r\n**Example**: Get (absolute yearly) population of Lanzarote municipalities between 2010 and 2020:\r\n\r\n```pycon\r\n>>> from istacpy.indicators.lite import indicators\r\n\r\n>>> indicator = indicators.get_indicator('POBLACION')\r\n>>> data = indicator.get_data(geo='M|Lanzarote', time='Y|2010:2020')\r\n\r\n>>> data.as_dataframe()\r\n      Arrecife  Har\u00c3\u00ada  San Bartolom\u00c3\u00a9  Teguise   T\u00c3\u00adas  Tinajo  Yaiza\r\n2010     58156   5249          18161    20105  19869    5655  14242\r\n2011     57357   5203          18468    20788  20102    5728  14871\r\n2012     56284   5190          18487    21096  20228    5716  15131\r\n2013     55673   4782          18541    21152  20451    5783  15571\r\n2014     56880   4736          18689    21101  19658    5808  15068\r\n2015     56940   4755          18402    21454  20019    5824  15815\r\n2016     58537   4767          18151    21724  20037    5924  15944\r\n2017     59771   4858          18249    21896  19964    6028  16257\r\n2018     61351   4969          18327    22122  20006    6119  16289\r\n2019     62988   5123          18816    22342  20170    6279  16571\r\n2020     64645   5263          19099    22703  20628    6434  17040\r\n```\r\n\r\n### Statistical resources\r\n\r\n**Example 1**: Get all existing statistical data cubes:\r\n\r\n```pycon\r\n>>> from istacpy.statisticalresources import cubes\r\n>>> cubes.get_statisticalresources_datasets()\r\n```\r\n\r\n**Example 2**: Get all the data sets maintained by a certain organization:\r\n\r\n```pycon\r\n>>> from istacpy.statisticalresources import cubes\r\n>>> cubes.get_statisticalresources_datasets_agency(agencyid='ISTAC')\r\n```\r\n\r\n### Structural resources\r\n\r\n**Example 1**: Get a list of classifications:\r\n\r\n```pycon\r\n>>> from istacpy.structuralresources import classifications\r\n>>> classifications.get_structuralresources_codelists()\r\n```\r\n\r\n**Example 2**: Get a list of geographic coordinate from [Icod de los Vinos](https://www.icoddelosvinos.es/):\r\n\r\n```pycon\r\n>>> from istacpy.structuralresources import variables\r\n>>> variables.get_structuralresources_geoinfo('VR_TERRITORIO', 'MUN_ICOD_VINOS')\r\n```\r\n\r\n## Documentation\r\n\r\nThe package is divided into several modules depending on the resource you want to retrieve:\r\n\r\n* [istacpy.indicators](docs/md/indicators.md): Systems, instances, granularities and subjects of indicators.\r\n* [istacpy.statisticalresources](docs/md/statisticalresources.md): Datasets and queries of cubes.\r\n* [istacpy.structuralresources](docs/md/structuralresources.md): Categories, schemes, classifications, families and concepts for normalize statistical resources.\r\n* [Error handling](docs/md/error_handling.md)\r\n\r\n> **Base URL**\r\n>\r\n> 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.\r\n\r\n## Bugs/Requests\r\n\r\nPlease use the [GitHub issue tracker](https://github.com/eDatos/istacpy/issues) to submit bugs or request features.\r\n\r\n## Changelog\r\n\r\nConsult the [Changelog](CHANGELOG.md) page for bugfixes and feature in each version.\r\n\r\n## Contact\r\n\r\nYou can also contact us via email at [edatos.istac@gobiernodecanarias.org](mailto:edatos.istac@gobiernodecanarias.org).\r\n\r\n## License\r\n\r\nCopyright Instituto Canario de Estad\u00c3\u00adstica (ISTAC), 2018.\r\n\r\nDistributed under the terms of the [AGPLv3](LICENSE) license, istacpy is free and open source software.\r\n",
    "bugtrack_url": null,
    "license": "gpl-3.0",
    "summary": "Python package for obtaining open data from Instituto Canario de Estad\u00edstica (ISTAC)",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://www.gobiernodecanarias.org/istac/api/"
    },
    "split_keywords": [
        "istacpy",
        " istac",
        " instituto canario de estadistica",
        " api",
        " json"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "98e6182d60a519baa2157425d4c1fcce0019d830be2c5493b960801fef07efb0",
                "md5": "7ffe853e46a1e43f2be0ea40780eb1a6",
                "sha256": "f9e8ba455f0f24308331b1e2b5484d658bac9fd7d2f94f30a6966bf0438fc231"
            },
            "downloads": -1,
            "filename": "istacpy-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ffe853e46a1e43f2be0ea40780eb1a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 41604,
            "upload_time": "2025-07-11T12:28:24",
            "upload_time_iso_8601": "2025-07-11T12:28:24.277789Z",
            "url": "https://files.pythonhosted.org/packages/98/e6/182d60a519baa2157425d4c1fcce0019d830be2c5493b960801fef07efb0/istacpy-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c7399ebcb8b45b035188c7befa4bc61cf659f01d755184d52e2224844784cf71",
                "md5": "d95b79874f3fe02d0e3774945cf7cd12",
                "sha256": "9a856f0666bf1a9d31f324825c1e0aec1f4d552ad2e373f15fcc967ddf1fd2a8"
            },
            "downloads": -1,
            "filename": "istacpy-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d95b79874f3fe02d0e3774945cf7cd12",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 39587,
            "upload_time": "2025-07-11T12:28:25",
            "upload_time_iso_8601": "2025-07-11T12:28:25.963869Z",
            "url": "https://files.pythonhosted.org/packages/c7/39/9ebcb8b45b035188c7befa4bc61cf659f01d755184d52e2224844784cf71/istacpy-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 12:28:25",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "istacpy"
}
        
Elapsed time: 1.02499s