Skip to main content

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 aims to be released on PyPI in the near future. However, until then you will need to install the library manually:

$ 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


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.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

pysnipeit-0.0.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file pysnipeit-0.0.1.tar.gz.

File metadata

  • Download URL: pysnipeit-0.0.1.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

Hashes for pysnipeit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 26af7ac53e2454b4fb1b6f9331cd2e466bb18dee0967c41f389d72f9f69dfebd
MD5 86ad60516f35e4499c44b0bf64a8494c
BLAKE2b-256 89099b45de479c038a936a06e14d27d91cad8ceb6aea4bbf8123b350803a0aa5

See more details on using hashes here.

File details

Details for the file pysnipeit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pysnipeit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for pysnipeit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a6b512ef72ab24b32dc84a06ad53a579ba487742b5a5111c62b3e5d1a4f9004
MD5 6d04688d0f351818b507942a5c5422aa
BLAKE2b-256 9f9262d9b7bdb93765f3187fa29d097115b5776344e48c68e497896148d5623e

See more details on using hashes here.

Supported by

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