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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dadata-0.2.0.tar.gz.
File metadata
- Download URL: dadata-0.2.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.23.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6c894d1b8f04c1da96e19f3d9712e6ceef6e92ada132228e678b2ce858eb1fd
|
|
| MD5 |
97482e1b03c46852d34c8b6e68b980eb
|
|
| BLAKE2b-256 |
1de7e0684f6ba46724b1954d764d7b091df6caaaca12f977539c576a15552ce9
|
File details
Details for the file dadata-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dadata-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.23.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bff4a4414dcaa41a7281b0a642670988d46a1b8f521e1aea655e7879fe71efd1
|
|
| MD5 |
79e1b74eaccbd973d5c076adfb59e4fc
|
|
| BLAKE2b-256 |
91c2b158b9db432f5ad5e40e84bb3dc0d8a56747cb3af2e2f5c9fb5f02a4c8e3
|