Wrappers for the Inventaire API
Project description
Inventaire
Project description
This package makes it easy to use Inventaire with Python. You can write simple scripts to manage your library and keep your database up to date automatically.
For more detailed information please see the project's documentation.
To be done:
- More usage examples
- Increase the tests coverage
- Convenient docs
- Implementing higher level wrappers
Installation
pip install inventaire-python-api
Authentication
Inventaire auth requires either the username or password or a cookie (see the how-to)
from inventaire import Inventaire
auth = {"username": "demo-user", "password": "abcde1-fghij2-klmno3"}
inv = Inventaire.server_api(**auth)
Usage
Then it is possible to interact with the low-level api wrappers:
# Get information about the authenticated user
auth_data = inv.api.user.get_authentified_user()
# Get the last public items modified
last_items = inv.api.items.get_last_public_items()
# Get shelves information based on their ids
shelves_ids = inv.api.shelves.get_shelves_by_ids(
["b30491238f4a79a466c27418a2280c12", "0c490f3bc5ea9ab450bc24ff55151814"]
)
# Create a new shelf
new_shelf = inv.api.shelves.create_shelf(
name="demo", listing="private", description="something"
# Get entity details and if it doesn't exist, try to create it
uri_details = inv.api.entities.get_entities_by_uris(
uris="isbn:9789735087180",
autocreate=True,
refresh=True,
)
Each Inventaire API wrapper group could be accessed as a property:
iapi = inv.api
# Items
items = iapi.items
# Shelves
shelves = iapi.shelves
License
This library is licensed under the Apache 2.0 License.
Links
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inventaire_python_api-0.1.2.tar.gz.
File metadata
- Download URL: inventaire_python_api-0.1.2.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15aa5dc480973cfb343d5614741dcab4416cc96824c6997f8ca1e4070bf89ed9
|
|
| MD5 |
6919adc2641bce167bad13fa99b6d072
|
|
| BLAKE2b-256 |
07db335d40db2d9a641bb9ee8ce1f57b8ccfc4823d56144a5365a4447c391e6b
|
File details
Details for the file inventaire_python_api-0.1.2-py3-none-any.whl.
File metadata
- Download URL: inventaire_python_api-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7157e8ddca998edab86eb725fa4f2dfa9c1dea736d43d812d41a5c009d3057ca
|
|
| MD5 |
cd8552b730925203b21e1231ff03ed3c
|
|
| BLAKE2b-256 |
6a9e90ddeacb968c8f959e0a2336ad88a2ca3eda1c388cb06898059f69c69e9c
|