Skip to main content

An API client for the Duro REST API

Project description

duro_rest

An API client for the Duro REST API.

Installation

Installing from PyPi

pip install duro_rest

Installing from conda-forge

TBD

Examples

The Duro client is a very minimal API client for reading data from the Duro v1 REST API. It does not define classes for each object type and instead returns plain dictionaries and lists.

Base Client

from duro_rest import Client

# Create a new client, providing your API key. By default clients will make calls to the public REST
# API, but the endpoint base can be overridden if needed
client = Client("your-api-key")

# Fetch a component by its Duro assigned id (as opposed to the CPN)
component = client.component("component-id")

# Fetch a list of all components in Duro
components = client.components()

# Fetch a list of all components in Duro filtered by status
components = client.components(status = "OBSOLETE")

BOM Client

The Duro API does not support pulling BOMs directly. The BOM Client is here to make that experience a little easier.

from duro_rest import BOMClient

# Create a new bom client for fetching full BOMs (either nested or flattened). It accepts the same
# arguments as the base client
client = Client("your-api-key")

# Get a nested BOM starting from a product
nested_product_bom = client.product_bom("product-id")

# Get a nested BOM starting from a component
nested_component_bom = client.component("component-id")

# Convert the nested BOMs into flattened BOMs
flattened_product_bom = nested_product_bom.flatten()
flattened_component_bom = nested_component_bom.flatten()

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

duro_rest-0.0.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

duro_rest-0.0.4-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file duro_rest-0.0.4.tar.gz.

File metadata

  • Download URL: duro_rest-0.0.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for duro_rest-0.0.4.tar.gz
Algorithm Hash digest
SHA256 610ffda4d0aaa444fb91e506c9942b587707cb2f937055eac9ca861440a34da5
MD5 8331bde8088e57d90b2c47f4e83c879d
BLAKE2b-256 06176c0eebf47445b4abe9a10a82df64cb303e4d173ae8f4e68880fddd4345e9

See more details on using hashes here.

File details

Details for the file duro_rest-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: duro_rest-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for duro_rest-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c31c20cfdbb1854a7f83fd6a37ee79aada17c6d0aa956f132af1201afe9bebc2
MD5 0ec99011e0b3a2280b788b137f1c8fa9
BLAKE2b-256 4826e0b31127973388cb00d46fade30685733dacc99866bb105588b9023c5d95

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