Skip to main content

Python wrapper for using Apitalks API.

Project description

Apitalker

Upload Python Package

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.

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. You can access following attributes:

ApiResponse.response - complete json-decoded call return
ApiResponse.data - data part of json-decoded call return
ApiResponse.skip - skip value
ApiResponse.count - count value
ApiResponse.limit - limit value
ApiResponse.info - info value
ApiResponse.provider - provider value

Examples

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 several pages

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')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apitalker-0.2.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

apitalker-0.2.1-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page