Skip to main content

Wrappers for the Inventaire API

Project description

Inventaire

PyPI - Python Version PyPI PyPI - License

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

Inventaire docs

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

inventaire_python_api-0.1.6.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inventaire_python_api-0.1.6-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file inventaire_python_api-0.1.6.tar.gz.

File metadata

  • Download URL: inventaire_python_api-0.1.6.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for inventaire_python_api-0.1.6.tar.gz
Algorithm Hash digest
SHA256 9d4657bd6eb07cc53a079521b6b53c04a0e3960247f0f7045a5911a8c3a7ee93
MD5 48ed57e133373473f8d90f72285d74b2
BLAKE2b-256 ac39157f5ed28676d6f2ad0cf0b35fa644a8dea06926f660eb5fe2206fca9194

See more details on using hashes here.

File details

Details for the file inventaire_python_api-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for inventaire_python_api-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 be4055e3ee9dcbe907fd2491f0930fac58bfc87642af47cf5ef1993f44694ff9
MD5 b72c4038f1e63ed94bc167d3ec0daa2f
BLAKE2b-256 cde2c19b934552c49bc2d2514afb624eb4066e20ef39c7ac8d81bb15dd20610e

See more details on using hashes here.

Supported by

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