https://github.com/phpdude/attune-python
Attune (http://attune.co/) REST python client
https://github.com/phpdude/attune-python
Last synced: about 1 year ago
JSON representation
Attune (http://attune.co/) REST python client
- Host: GitHub
- URL: https://github.com/phpdude/attune-python
- Owner: phpdude
- Created: 2016-01-15T17:18:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-02T02:51:54.000Z (over 10 years ago)
- Last Synced: 2025-01-24T11:25:53.124Z (over 1 year ago)
- Language: Python
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
attune-python
==========
Attune (http://attune.co/) api client for python.
What is Attune?
----------------
Attune instantly and automatically optimizes the presentation of your catalog items and marketing content.
Each visitor sees a site that is built uniquely for them every time.
More information at http://attune.co/.
Features
--------
Library supports synchronous and asynchronous api calls to attune.co executed in configurable thread poll
executor with circuit breaker and auto-retries on errors.
Requirements
------------
It depends on:
* [requests](https://pypi.python.org/pypi/requests/) - Python HTTP for Humans.
* [six](https://pypi.python.org/pypi/six/) - Six is a Python 2 and 3 compatibility library.
* [certifi](https://pypi.python.org/pypi/certifi/) - Python package for providing Mozilla's CA Bundle.
* [python-dateutil](https://pypi.python.org/pypi/python-dateutil/) - Extensions to the standard Python datetime module.
* [pybreaker](https://pypi.python.org/pypi/pybreaker/) - Python implementation of the Circuit Breaker pattern.
Installation
------------
To install, simply:
```
pip install attune-python
```
Tests
-----
```
python setup.py test
```
If you want run tests - don't forget to use source code cloned version.
Hello world
-----------
Library supports one Configuration object cross all created clients (Singleton pattern), but you can pass
your custom settings project to init function of client object.
```python
from attune.client.client import Client
from attune.client.configuration import Settings
config = Settings()
client = Client(config)
token = client.get_auth_token('#user#', '#key#')
```
More exampels you can check in tests folder. A lot of api usage examples placed at tests/api.py.