zypl-macro


Namezypl-macro JSON
Version 1.0.4 PyPI version JSON
download
home_page
Summaryzypl.ai alternative data API interface lib
upload_time2023-05-19 14:38:31
maintainer
docs_urlNone
authorMe
requires_python>=3.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Introduction

This here is a Python interface module meant to streamline obtaining macroeconomic data from Zypl.ai's alternative data API macro endpoint. It offers a few simple methods to obtain the data from server and store it locally for future usage, whatever that may be.

Please keep in mind that for succesfull usage of this module it is absolutely essential for you to be in a good mood and healthy disposition, otherwise it might not work. To be fair, it might not work either way, but if you meet the requirement stated above you, at the very least, won't get upset by this fact nearly as much.

## Usage

This module is obtained from pip with the usual installation line:
```
pip install zypl_macro
```
If you're not running your machine under Windows or do not know how to use pip, please refer [here](https://pip.pypa.io/en/stable/) for pointers. It is all very straightforward.

After installing the module first order of business is to import and instantiate its utility class, like so:
```
from zypl_macro.library import DataGetter

getter_instance = DataGetter()
```

After this you're going to have to provide authorization token aka API key in order to be allowed to query data endpoint. It is done via a dedicated method:
```
getter_instance.auth('your-very-very-secret-token')
```
You can get an API key from zypl's alternative data API server administration, if they'll feel like providing you with one. Please don't lose it.
Once you succesfully got an instance of the class in your code and provided it with the token, you can start querying data. For now there are three main methods you can utilize.

### get_countries

You can obtain the list of all the countries supported in alt data system calling this method.
```
getter_instance.get_countries()
```

### get_indicators

Works similar to the previous one and provides you with a list of all the macroeconomic indicators in the database. You can call with a country specified in order to get only indicators pertaining to that country, otherwise you're gonna get them all.
```
getter_instance.get_indicators(country='Uzbekistan')
```

### get_data

This is the main method that allows you to obtain the data itself. The only mandatory argument is the country you want your data on:
```
getter_instance.get_data(country='Tajikistan')
```

You can also provide it with `start` and `end` arguments to specify the date range you want to get your data in. Dates must be in iso format, e.g. YYYY-MM-DD.
```
getter_instance.get_data(country='Tajikistan', start='2020-02-01', end='2022-02-01')
```
You can provide either of these arguments or both of them or none, it'll be fine.

`frequency` argument lets you pick the frequency (duh) of the data you're going to get. Indicators are grouped by frequencies of their collection, which goes as follows: Daily, Monthly, Quarterly, Yearly. You'll get different sets of indicators depending on this argument.
```
getter_instance.get_data(country='Tajikistan', frequency='Monthly')
```

`indicators` argument lets you specify exact list of indicators you want to obtain. It should be passed as a list or tuple containing names of desired indicators as strings. These are case sensitive and should match exactly what you get from get_indicators(), so keep it in mind.
```
getter_instance.get_data(country='Tajikistan', indicators=['GDP', 'Inflation Food'])
```
Take care if you specify indicators together with frequency. The latter takes priority, so you might not get all the indicators you asked for if some of them aren't in selected frequency group.

## Misc
All the utility functions return either pandas dataframe or stringified message of the error occured, if any. You're free to do with them what you will, just don't forget to actually check what you got returned.

If alt data API endpoint gets changed or moved somewhere (it shouldn't, but weirder things has been known to happen), this module is not going to work properly. In this case, and if you happen to know its new living address, you can call _set_url method to point the module there. Please don't touch this method otherwise, things will break.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "zypl-macro",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Me",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/fd/d5/af38df9c074196d2965e0a495c68a17ff3fc682e33dbdd9cd818571350e7/zypl_macro-1.0.4.tar.gz",
    "platform": null,
    "description": "## Introduction\r\n\r\nThis here is a Python interface module meant to streamline obtaining macroeconomic data from Zypl.ai's alternative data API macro endpoint. It offers a few simple methods to obtain the data from server and store it locally for future usage, whatever that may be.\r\n\r\nPlease keep in mind that for succesfull usage of this module it is absolutely essential for you to be in a good mood and healthy disposition, otherwise it might not work. To be fair, it might not work either way, but if you meet the requirement stated above you, at the very least, won't get upset by this fact nearly as much.\r\n\r\n## Usage\r\n\r\nThis module is obtained from pip with the usual installation line:\r\n```\r\npip install zypl_macro\r\n```\r\nIf you're not running your machine under Windows or do not know how to use pip, please refer [here](https://pip.pypa.io/en/stable/) for pointers. It is all very straightforward.\r\n\r\nAfter installing the module first order of business is to import and instantiate its utility class, like so:\r\n```\r\nfrom zypl_macro.library import DataGetter\r\n\r\ngetter_instance = DataGetter()\r\n```\r\n\r\nAfter this you're going to have to provide authorization token aka API key in order to be allowed to query data endpoint. It is done via a dedicated method:\r\n```\r\ngetter_instance.auth('your-very-very-secret-token')\r\n```\r\nYou can get an API key from zypl's alternative data API server administration, if they'll feel like providing you with one. Please don't lose it.\r\nOnce you succesfully got an instance of the class in your code and provided it with the token, you can start querying data. For now there are three main methods you can utilize.\r\n\r\n### get_countries\r\n\r\nYou can obtain the list of all the countries supported in alt data system calling this method.\r\n```\r\ngetter_instance.get_countries()\r\n```\r\n\r\n### get_indicators\r\n\r\nWorks similar to the previous one and provides you with a list of all the macroeconomic indicators in the database. You can call with a country specified in order to get only indicators pertaining to that country, otherwise you're gonna get them all.\r\n```\r\ngetter_instance.get_indicators(country='Uzbekistan')\r\n```\r\n\r\n### get_data\r\n\r\nThis is the main method that allows you to obtain the data itself. The only mandatory argument is the country you want your data on:\r\n```\r\ngetter_instance.get_data(country='Tajikistan')\r\n```\r\n\r\nYou can also provide it with `start` and `end` arguments to specify the date range you want to get your data in. Dates must be in iso format, e.g. YYYY-MM-DD.\r\n```\r\ngetter_instance.get_data(country='Tajikistan', start='2020-02-01', end='2022-02-01')\r\n```\r\nYou can provide either of these arguments or both of them or none, it'll be fine.\r\n\r\n`frequency` argument lets you pick the frequency (duh) of the data you're going to get. Indicators are grouped by frequencies of their collection, which goes as follows: Daily, Monthly, Quarterly, Yearly. You'll get different sets of indicators depending on this argument.\r\n```\r\ngetter_instance.get_data(country='Tajikistan', frequency='Monthly')\r\n```\r\n\r\n`indicators` argument lets you specify exact list of indicators you want to obtain. It should be passed as a list or tuple containing names of desired indicators as strings. These are case sensitive and should match exactly what you get from get_indicators(), so keep it in mind.\r\n```\r\ngetter_instance.get_data(country='Tajikistan', indicators=['GDP', 'Inflation Food'])\r\n```\r\nTake care if you specify indicators together with frequency. The latter takes priority, so you might not get all the indicators you asked for if some of them aren't in selected frequency group.\r\n\r\n## Misc\r\nAll the utility functions return either pandas dataframe or stringified message of the error occured, if any. You're free to do with them what you will, just don't forget to actually check what you got returned.\r\n\r\nIf alt data API endpoint gets changed or moved somewhere (it shouldn't, but weirder things has been known to happen), this module is not going to work properly. In this case, and if you happen to know its new living address, you can call _set_url method to point the module there. Please don't touch this method otherwise, things will break.\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "zypl.ai alternative data API interface lib",
    "version": "1.0.4",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a63cb99b8c5e41195f5b1320637707c9b8d445bc6b7f477ae50db61b0d64b66c",
                "md5": "8af5d66c9b8ea8b1c354a6fd00ddb4a0",
                "sha256": "0cc6d0ce94fb9947b7a127436c6385dfd2d1fd6bf86d32f56c9c3f4245dfaf3f"
            },
            "downloads": -1,
            "filename": "zypl_macro-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8af5d66c9b8ea8b1c354a6fd00ddb4a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 5619,
            "upload_time": "2023-05-19T14:38:27",
            "upload_time_iso_8601": "2023-05-19T14:38:27.781311Z",
            "url": "https://files.pythonhosted.org/packages/a6/3c/b99b8c5e41195f5b1320637707c9b8d445bc6b7f477ae50db61b0d64b66c/zypl_macro-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdd5af38df9c074196d2965e0a495c68a17ff3fc682e33dbdd9cd818571350e7",
                "md5": "d3f19df53eb908821d95f13b5c39dd0b",
                "sha256": "8cf10774323602c3e85fafd27cf8852721771108c40aab83c8e6a1ea7dbea41c"
            },
            "downloads": -1,
            "filename": "zypl_macro-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d3f19df53eb908821d95f13b5c39dd0b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 5297,
            "upload_time": "2023-05-19T14:38:31",
            "upload_time_iso_8601": "2023-05-19T14:38:31.619928Z",
            "url": "https://files.pythonhosted.org/packages/fd/d5/af38df9c074196d2965e0a495c68a17ff3fc682e33dbdd9cd818571350e7/zypl_macro-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-19 14:38:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "zypl-macro"
}
        
Me
Elapsed time: 0.06574s