Python client library for HasOffers API
Project description
PyOffers
Python client library for HasOffers API.
Installation
PyOffers can be obtained with pip:
$ pip install pyoffers
Usage example
Initialize API client:
>>> from pyoffers.api import HasOffersAPI
>>> hasoffers = HasOffersAPI(
endpoint='https://api.hasoffers.com/Apiv3/json',
network_token='<your_network_token>',
network_id='<your_network_id>',
)
Execute queries:
>>> # Get all offers with ID greater than 100, sorted by ID and with loaded `Country` data
>>> hasoffers.offers.find_all(id__gt=100, sort='id', contain=['Country'])
[<Offer: 102>,
<Offer: 104>,
<Offer: 106>,
<Offer: 108>,
<Offer: 110>,
<Offer: 112>]
>>> # Get all clicks records for 2016-09-20
>>> hasoffers.raw_logs.clicks.find_all('20160920')
[<LogRecord: 7 (1027a606128bd067105f0b0921840f)>, ...]
>>> # Get all conversions for specific offer
>>> offer = hasoffers.offers.get_by_id(100)
>>> offer.conversions.find_all()
[<Conversion: 70532>]
Documentation
You can view documentation online at:
Or you can look at the docs/ directory in the repository.
Python support
PyOffers supports Python 3.5+.
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
pyoffers-0.7.0.tar.gz
(13.7 kB
view details)
Built Distribution
pyoffers-0.7.0-py3-none-any.whl
(16.2 kB
view details)
File details
Details for the file pyoffers-0.7.0.tar.gz
.
File metadata
- Download URL: pyoffers-0.7.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 067d4fa2de6fb078133ff5918163d694e7674ebffac7a3b154d6cc7a559bffd3 |
|
MD5 | 56a83f772d8e56ea3800240a6f37fa5d |
|
BLAKE2b-256 | a6fe0393df358e2fedb040ec1baed2994c74a1d6fefb2e1f2d6fd5ba65402d97 |
File details
Details for the file pyoffers-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: pyoffers-0.7.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d624ee5aeced3e8392ec281b0f6b036a1e871e83d91169ee8940b110fdd4b74c |
|
MD5 | 9a1505f0367664ee3127e8c95046072f |
|
BLAKE2b-256 | 868f92c99997ffaf114c8ff7c85f938076b314f99d4d7eaf0a3aa0f3ab2798c0 |