Banxico-SIE


NameBanxico-SIE JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryThis packages enables downloading economic and financial time series hosted on Banco de Mexico's Sistema de Informacion Economica (SIE) directly as a time-indexed Pandas DataFrame. Time series metadata is available on English and Spanish.
upload_time2023-09-11 23:45:04
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT License Copyright (c) 2023 Ezequiel Piedras Romero Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords banco de mexico banxico sistema de informacion economica sie economic time series economic data financial time series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Banxico-SIE

This packages enables downloading economic and financial time series hosted on Banco de Mexico's Sistema de Informacion Economica (SIE) directly as a time-indexed Pandas DataFrame. Time series metadata is available on English and Spanish.

Credentials are required by the website to download data. Visit [Banxico's Sistema de Informacion Economica API website](https://www.banxico.org.mx/SieAPIRest/service/v1/?locale=en) to request a token.

**Disclaimer: This package is not institutionally endorsed by Banco de Mexico and does not constitute an official Python package to access Banco de Mexico's data. Banco de Mexico does not provide any support to this package and is not liable by its use.**


## Installation

Install Banxico-SIE with pip

```bash
  pip install Banxico-SIE
```
## Usage

```python


## Firstly, obtain a token from Banxico's website:
# https://www.banxico.org.mx/SieAPIRest/service/v1/?locale=en
banxico_token = "..."  # 64 characters long

from siebanxico import SIEBanxico

# Choose language of metadata by choosing locale="es" (Spanish) or locale="en" (English).
api_client = SIEBanxico(token=banxico_token, locale="es")

## Get a single time series:
# Visit Banxico's website to find the id of a certain time series. E.g., "SP1" is Monthly CPI.
# https://www.banxico.org.mx/SieInternet/defaultEnglish.do
df = api_client.getSeriesData("SP1")  # Get whole CPI time series
df = api_client.getSeriesData("SP1", startDate="2020-01-01", endDate="2020-12-31")  # Get time series for a date range
# Note: startDate and endDate must be in the format YYYY-MM-DD.

# df is a time-indexed Pandas DataFrame.
# Use Pandas functionalities to manipulate data and perform transformations.
# For example:
df.head()
df.diff()
df.pct_change(12)

## Get multiple time series:

# This list must contain the ids of the time series. Visit Banxico's website to find this.
# https://www.banxico.org.mx/SieInternet/defaultEnglish.do
list_series = ["SP1", "SF311408", "SF311418", "SF311433"]  # CPI, M1, M2, M3 (all in monthly frequency)
# Note: Periodicity of the time series must be identical!

# This function requires a pandas.offsets object for the periodicity argument.
# For monthly data use: pandas.offsets.MonthBegin(1)
# This is important because the library uses this object to create the dataframe's time index.
import pandas as pd

df = api_client.getSeriesDataFrame(list_series, startDate="2000-01-01", endDate="2023-07-31",
                                   periodicity=pd.offsets.MonthBegin(1))
# Note: startDate and endDate must be in the format YYYY-MM-DD.

# df is a time-indexed Pandas DataFrame.
# Use Pandas functionalities to manipulate data and perform transformations.
# For example:
df.head()
df.diff()
df.pct_change(12)

## Get series metadata:
metadata_df = api_client.getSeriesMetaData(list_series)

## Get last values for a list of series:
lastvalues_df = api_client.getSeriesCurrentValue(list_series)


```


## Authors

- [Ezequiel Piedras Romero](https://www.github.com/chekecocol)


## License

[MIT](https://choosealicense.com/licenses/mit/)


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "Banxico-SIE",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Banco de Mexico,Banxico,Sistema de Informacion Economica,SIE,economic time series,economic data,financial time series",
    "author": "",
    "author_email": "Ezequiel Piedras Romero <epiedrasr@banxico.org.mx>",
    "download_url": "https://files.pythonhosted.org/packages/67/ae/9675e525ef93b0c761333005621f8c53f1db23b5e8280bf9909e729e2775/Banxico-SIE-1.0.0.tar.gz",
    "platform": null,
    "description": "\r\n# Banxico-SIE\r\n\r\nThis packages enables downloading economic and financial time series hosted on Banco de Mexico's Sistema de Informacion Economica (SIE) directly as a time-indexed Pandas DataFrame. Time series metadata is available on English and Spanish.\r\n\r\nCredentials are required by the website to download data. Visit [Banxico's Sistema de Informacion Economica API website](https://www.banxico.org.mx/SieAPIRest/service/v1/?locale=en) to request a token.\r\n\r\n**Disclaimer: This package is not institutionally endorsed by Banco de Mexico and does not constitute an official Python package to access Banco de Mexico's data. Banco de Mexico does not provide any support to this package and is not liable by its use.**\r\n\r\n\r\n## Installation\r\n\r\nInstall Banxico-SIE with pip\r\n\r\n```bash\r\n  pip install Banxico-SIE\r\n```\r\n## Usage\r\n\r\n```python\r\n\r\n\r\n## Firstly, obtain a token from Banxico's website:\r\n# https://www.banxico.org.mx/SieAPIRest/service/v1/?locale=en\r\nbanxico_token = \"...\"  # 64 characters long\r\n\r\nfrom siebanxico import SIEBanxico\r\n\r\n# Choose language of metadata by choosing locale=\"es\" (Spanish) or locale=\"en\" (English).\r\napi_client = SIEBanxico(token=banxico_token, locale=\"es\")\r\n\r\n## Get a single time series:\r\n# Visit Banxico's website to find the id of a certain time series. E.g., \"SP1\" is Monthly CPI.\r\n# https://www.banxico.org.mx/SieInternet/defaultEnglish.do\r\ndf = api_client.getSeriesData(\"SP1\")  # Get whole CPI time series\r\ndf = api_client.getSeriesData(\"SP1\", startDate=\"2020-01-01\", endDate=\"2020-12-31\")  # Get time series for a date range\r\n# Note: startDate and endDate must be in the format YYYY-MM-DD.\r\n\r\n# df is a time-indexed Pandas DataFrame.\r\n# Use Pandas functionalities to manipulate data and perform transformations.\r\n# For example:\r\ndf.head()\r\ndf.diff()\r\ndf.pct_change(12)\r\n\r\n## Get multiple time series:\r\n\r\n# This list must contain the ids of the time series. Visit Banxico's website to find this.\r\n# https://www.banxico.org.mx/SieInternet/defaultEnglish.do\r\nlist_series = [\"SP1\", \"SF311408\", \"SF311418\", \"SF311433\"]  # CPI, M1, M2, M3 (all in monthly frequency)\r\n# Note: Periodicity of the time series must be identical!\r\n\r\n# This function requires a pandas.offsets object for the periodicity argument.\r\n# For monthly data use: pandas.offsets.MonthBegin(1)\r\n# This is important because the library uses this object to create the dataframe's time index.\r\nimport pandas as pd\r\n\r\ndf = api_client.getSeriesDataFrame(list_series, startDate=\"2000-01-01\", endDate=\"2023-07-31\",\r\n                                   periodicity=pd.offsets.MonthBegin(1))\r\n# Note: startDate and endDate must be in the format YYYY-MM-DD.\r\n\r\n# df is a time-indexed Pandas DataFrame.\r\n# Use Pandas functionalities to manipulate data and perform transformations.\r\n# For example:\r\ndf.head()\r\ndf.diff()\r\ndf.pct_change(12)\r\n\r\n## Get series metadata:\r\nmetadata_df = api_client.getSeriesMetaData(list_series)\r\n\r\n## Get last values for a list of series:\r\nlastvalues_df = api_client.getSeriesCurrentValue(list_series)\r\n\r\n\r\n```\r\n\r\n\r\n## Authors\r\n\r\n- [Ezequiel Piedras Romero](https://www.github.com/chekecocol)\r\n\r\n\r\n## License\r\n\r\n[MIT](https://choosealicense.com/licenses/mit/)\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Ezequiel Piedras Romero  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "This packages enables downloading economic and financial time series hosted on Banco de Mexico's Sistema de Informacion Economica (SIE) directly as a time-indexed Pandas DataFrame. Time series metadata is available on English and Spanish.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/chekecocol/siebanxico"
    },
    "split_keywords": [
        "banco de mexico",
        "banxico",
        "sistema de informacion economica",
        "sie",
        "economic time series",
        "economic data",
        "financial time series"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "975d6cccf635f64184e891d426bfc5f39d81f5979466a11c54410bf87f0c3ecf",
                "md5": "bb0a1e1200ce0e90617a5c4db31e1997",
                "sha256": "4c92e865edfda0567b1a1f83e45f42d4e720cc15e44935a4066f91f6cc28f7c9"
            },
            "downloads": -1,
            "filename": "Banxico_SIE-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bb0a1e1200ce0e90617a5c4db31e1997",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5798,
            "upload_time": "2023-09-11T23:45:02",
            "upload_time_iso_8601": "2023-09-11T23:45:02.396390Z",
            "url": "https://files.pythonhosted.org/packages/97/5d/6cccf635f64184e891d426bfc5f39d81f5979466a11c54410bf87f0c3ecf/Banxico_SIE-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67ae9675e525ef93b0c761333005621f8c53f1db23b5e8280bf9909e729e2775",
                "md5": "f5e474d11bfc2dd7d241bb39c322af6b",
                "sha256": "6fbb0c6324f3c19db9046f0b5c6ec220f76e83a5e95bcca1ddc80887ce187c45"
            },
            "downloads": -1,
            "filename": "Banxico-SIE-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f5e474d11bfc2dd7d241bb39c322af6b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4989,
            "upload_time": "2023-09-11T23:45:04",
            "upload_time_iso_8601": "2023-09-11T23:45:04.697476Z",
            "url": "https://files.pythonhosted.org/packages/67/ae/9675e525ef93b0c761333005621f8c53f1db23b5e8280bf9909e729e2775/Banxico-SIE-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-11 23:45:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "chekecocol",
    "github_project": "siebanxico",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "banxico-sie"
}
        
Elapsed time: 0.10894s