an implementation of the Snipe-IT api for python
Project description
pySnipeIt is a wrapper for Snipe-It's REST API. It aims to have 1:1 compatibility with that api.
Installation
This library is available on PyPi. To install:
$ pip install pysnipeit
to install from source:
$ git clone git@github.com:4kmartin/pysnipeit.git
$ cd pysnipeit
$ pip install .
Examples
to get a user by their ID:
from pysnipeit import SnipeItConnection, get_user_by_id
from returns.result import Success,Failure
from dotenv import dotenv_values
secrets = dotenv_values('.env')
conn = SnipeItConnection()
conn.connect(secrets['URL'],secrets['API'])
user = get_user_by_id(conn, 1)
match user:
case Success(usr):
print(usr.name)
case Failure(why):
print(f"This attempt failed to get a User\n{why}")
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
pysnipeit-0.0.3.tar.gz
(9.7 kB
view details)
File details
Details for the file pysnipeit-0.0.3.tar.gz.
File metadata
- Download URL: pysnipeit-0.0.3.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a37a2d1e9945ecf34375dbb9baf5141213d8e3a8aa0372f8fc383d3c10a639d0
|
|
| MD5 |
057616a30865f0fde0aa4320f161bffe
|
|
| BLAKE2b-256 |
e59998cb59fa6532ead60eac63bff4db0188ba72c1b25d688405ad5b3bd84029
|