Coder Social home page Coder Social logo

dadata-python's Introduction

Unofficial Python dadata.ru Client Build Status

Install

$ pip install -e git+https://github.com/tigrus/dadata-python#egg=dadata

Usage

>>> from dadata import DaDataClient
>>> client = DaDataClient(
    key = '',
    secret = '',
)

>>> # You can assign one address
>>> client.address = "мск сухонска 11/-89"

>>> # You can assign multiple addresses
>>> client.address = ["мск сухонска 11/-89", "спб невский 18"]

>>> #Now let's perform request..
>>> client.address.request()

>>> #Now we will have first result in `client.result`
>>> client.result.region_kladr_id
'7700000000000'

>>> #However we can reprocess data by our own desire - result from API saved in 
>>> client.response.content

Usage With Django

In settings.py:

DADATA_KEY = ""
DADATA_SECRET = ""

In project:

>>> from dadata.plugins.django import DjangoDaDataClient
>>> client = DjangoDaDataClient()

>>> # Now using as regular client..
>>> client.address = "мск сухонска 11/-89"
...

Suggestions Usage

>>> client.suggest_address = "194292, Санкт-Петербург г, 1-й Верхний пер, дом № 12, литера Б"
>>> client.suggestions.address.request()
>>> # Now we have list of suggestions in client.result
>>> client.result.suggestions[0].get('data').get('kladr_id')
'7800000000015870028'

dadata-python's People

Contributors

defance avatar silvercorvin avatar tigrus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.