Skip to main content

pyinuse

pyinuse is the official Python client for InUse API.

It provides the following main API methods:

  • list
  • create
  • update
  • partial_update
  • retrieve
  • destroy

For main end points such as:

  • manufacturers
  • machine_models
  • machines
  • producers
  • sites
  • lines
  • machines
  • properties
  • multispans
  • csvs
  • posts
  • triggers
  • synoptics
  • files
  • agents
  • groups
  • favorites
  • notifications
  • alerts
  • sandboxes

Please refer to InUse API documentation (Accessible from the Studio) for more details.

API versioning

The actual API version is the internal API (not versioned) and is subject to changes. A versioned public API will be created in a later stage and used in this python client.

Example of usage

# Library used to type a password in a secured way.
import getpass
# Client library for the InUse API.
from pyinuse import InUse
# Library for logging
import logging
logging.basicConfig(format="%(asctime)s, %(name)s, %(levelname)s, %(message)s", level=logging.INFO)

manufacturer_code="mycompany" # replace with your manufacturer code

# login
inuse = InUse(base_url=f"https://studio.{manufacturer_code}.productinuse.com")
inuse.login(input("Username? "), getpass.getpass("Password? "))

# get my manufacturer
# each endpoint is accessible by its name as an attribute of InUse instance
manufacturer = inuse.manufacturers.list()[0]

# create a new machine_model
machine_model = inuse.machine_models.update_or_create(
    params={"manufacturer": manufacturer["pk"], "code": "my-machine-model"},
    data={
        "manufacturer": manufacturer["pk"],
        "code": "my-machine-model",
        "name": "my machine model",
    },
)

# logout once you're done
inuse.logout()

History

0.1.2

  • Add session headers

0.1.1

  • Handle response error

0.1.0

  • First version based on the internal API

Metadata

Release files for pyinuse 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyinuse 0.1.2
File Size Uploaded Provenance Actions
pyinuse-0.1.2.tar.gz 5.2 kB Without provenance Details for pyinuse-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyinuse 0.1.2
File Interpreter ABI Platform Actions
pyinuse-0.1.2-py3-none-any.whl Python 3 none any Details for pyinuse-0.1.2-py3-none-any.whl

Total release size: 9.8 kB

Release files / pyinuse-0.1.2.tar.gz

Download URL pyinuse-0.1.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
28765b47d9a0c57a96d96b4f49670f9e637e5b2973bff2f9a78a31d420216699
BLAKE2b-256 checksum
How to use checksums
3a29b749d41bc0fcc7f79a847eac163aa74537c00dcc867a0a83900c8642f779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Release files / pyinuse-0.1.2-py3-none-any.whl

Download URL pyinuse-0.1.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c583c4127b34c8a6be60724da73c52469be073bc24e1da2044b6536ad704f2d
BLAKE2b-256 checksum
How to use checksums
c35a3f76818ebf4342a8622298d74502d6ed286f1e99d64a7efe90c3e9b2d029
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Security for pyinuse 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page