https://github.com/sobotics/libapicache-py
Python interface library for APICache
https://github.com/sobotics/libapicache-py
Last synced: 12 months ago
JSON representation
Python interface library for APICache
- Host: GitHub
- URL: https://github.com/sobotics/libapicache-py
- Owner: SOBotics
- License: mit
- Created: 2017-05-17T01:17:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-17T14:01:18.000Z (about 9 years ago)
- Last Synced: 2025-06-10T21:19:15.649Z (12 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# libapicache
Python 3 interface library for [APICache](https://github.com/SOBotics/apicache)
## Installation
Use Python 3 `pip` (either with `--user` for a per-user install, or with `sudo` for a global install):
$ pip3 install libapicache --user
# OR #
$ sudo -H pip3 install libapicache
## Usage
```python
from libapicache import APICache
cache = APICache('https://cache.example.org') # no trailing slash
response = cache.posts_by_id(['38472654'], key='IQlbo34sc932sdrg23((', site='stackoverflow.com')
if not response.is_error():
for post in response.items:
print("Got post {} from Stack Overflow. Score: {}".format(post['post_id'], post['score']))
else:
print("Uh oh! Error: {} (ID: {})".format(response.error_message, response.error_id))
```
Refer to APICache's documentation (visit `/docs/quickstart` on your chosen APICache server) for further information
about the routes libapicache is calling.