Python API wrapper for WorldData.AI
- From pypi:
pip3 install worlddata
- From GitHub:
Clone our repository and
python3 setup.py install
Orpip install git+https://github.com/worlddata-ai/python-api.git
from pprint import pprint
from worlddata.worlddata import WorldData
worlddata = WorldData(auth_token = '1212312-12312312')
pprint(worlddata.search(search_text = 'worlddata'))
If you are going to make a couple of request, you can user connection pooling provided by requests
. This will save significant time by avoiding re-negotiation of TLS (SSL) with the chat server on each call.
from requests import sessions
from pprint import pprint
from worlddata.worlddata import WorldData
with sessions.Session() as session:
worlddata = WorldData(auth_token = '1212312-12312312')
pprint(worlddata.search('worlddata'))
Only required parameters are explicit on the WorldData class but you can still use all other parameters. For a detailed parameters list check the WorldData.AI
Most of the API methods are already implemented. If you are interested in a specific call just open an issue or open a pull request.
We are actively testing :)
You can contribute by doing Pull Requests. (It may take a while to merge your code but if it's good it will be merged). Please, try to implement tests for all your code and use a PEP8 compliant code style.
Reporting bugs and asking for features is also contributing ;) Feel free to help us grow by registering issues.
We hang out here if you want to talk.