Data cleansing and enrichment via Dadata API.
Project description
Dadata API Client
Data cleansing, enrichment and suggestions via Dadata API
Thin Python wrapper over Dadata API.
Installation
pip install dadata
Usage
Cleansing:
>>> import os
>>> from dadata import Dadata
>>> token = os.getenv("DADATA_API_KEY")
>>> secret = os.getenv("DADATA_SECRET_KEY")
>>> dadata = Dadata(token, secret)
>>> dadata.clean("address", "мск сухонская 11 89")
{'source': 'мск сухонская 11 89', 'result': 'г Москва, ул Сухонская, д 11, кв 89', ...}
Suggestions and other services:
>>> import os
>>> from dadata import Dadata
>>> token = os.getenv("DADATA_API_KEY")
>>> dadata = Dadata(token)
>>> dadata.geolocate(lat=55.8782557, lon=37.65372)
>>> dadata.iplocate("212.45.30.108")
>>> dadata.suggest("party", "моторика")
>>> dadata.find_by_id("party", "7719402047")
>>> dadata.find_affiliated("7736207543")
Development setup
$ pip install black coverage flake8 mypy pylint pytest requests requests-mock tox
$ tox
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Make sure to add or update tests as appropriate.
Use Black for code formatting and Conventional Commits for commit messages.
Changelog
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dadata-0.2.0.tar.gz
(6.7 kB
view hashes)
Built Distribution
dadata-0.2.0-py3-none-any.whl
(4.1 kB
view hashes)