Python wrapper for using Apitalks API.
Project description
Apitalker
Table of Contents
About
Python3 library. Wrapper for Apitalks API calls. Enables simple call for api resource via query
method with optional use of available parameters, as specified in Apitalks documentation.
Codebase documentation is Here.
Getting Started
These instructions will get you up and running.
Prerequisites
What things you need to install the software.
- Python 3+
Installing
To install this package, simply use standard pip install apitalker
or clone this repo and run python setup.py install
.
Usage
apitalker is used as any other library.
from apitalker.api import API
api = API("yourAPIkeygoeshere")
r = api.query([resource], [...params])
Returned data are treated as instance of a class ApiResponse
.
Error messages in case there are some problems with api call, are handled by class ApiError
.
Examples
api.API.query()
Calls given API resource and returns one "page" of the data.
Call resource only, with no query parameters
As is specified in API documentation, without any query parameters provided, API call will return one "page" of results, which equals of maximum of 30 data entries and 0 "pages" will be skipped.
from apitalker.api import API
api = API("yourAPIkeygoeshere")
r = api.query("/czso.cz/lide-domy-byty")
Call resource with limited page size and skipped one page of the same size
from apitalker.api import API
api = API("yourAPIkeygoeshere")
r = api.query("/czso.cz/lide-domy-byty", limit=10, skip=10)
Returned data can be ordered
Pay attention to the quotes usage in the order
parameter values!
from apitalker.api import API
api = API("yourAPIkeygoeshere")
r = api.query("/czso.cz/lide-domy-byty", limit=10, skip=10, order='"nazev ASC, u01 DESC"')
Other filtering is possible using where
parameter
This is dependent on the data source.
from apitalker.api import API
api = API("yourAPIkeygoeshere")
r = api.query("/czso.cz/lide-domy-byty", where='"uzkod":568741, "year":1999')
api.API.get_all()
Calls given API resource utilizing api.API.query()
repeatedly and returns all data of given resource.
from apitalker.api import API
api = API("yourAPIkeygoeshere")
r = api.get_all("/czso.cz/lide-domy-byty")
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
Hashes for apitalker-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5f177aec9cdf8f39feb672183ef174389b876d282566beabb7300620615ec27 |
|
MD5 | 5a9b101489be09c7174f063202720f34 |
|
BLAKE2b-256 | 10a3be8c455174f637642755908d8c7ad4185d574727403d21e4457bde376746 |