Skip to main content

Sunbird dcTrack API client in Python

Project description

dcTrackClient GitHub Workflow Status PyPI PyPI - Downloads

Sunbird dcTrack API client in Python

Initialize a connection to the dcTrack API

Import the class:

from dcTrackClient import Client

Authenticate using a base URL (the same URL to access the GUI) and a username and password:

api = Client('https://dctrack.example.com/', username='user', password='pass')

Authenticate using a base URL and an API token:

api = Client('https://dctrack.example.com/', apiToken='asdf')

Usage Example

Create an item:

  • This example shows the minimum attributes required to create an item
  • See the official documentation for a comprehensive list of attributes
  • This function returns the JSON object for the newly created item
  • If it fails, the function will return a JSON object containing the error message
api.createItem({'cmbLocation': 'CRT > 2ND > IT', 'tiName': 'NEW-ITEM', 'cmbMake': 'Generic', 'cmbModel': 'Generic^Rackable^01'})

Retrieve item details:

item = api.getItem(1234)

Returns:

{
    "item": {
        ... // item attributes in here
    }
}

Modify an existing item:

api.modifyItem(1234, {'tiSerialNumber': 'SN-12345', 'tiAssetTag': 'DEV-12345'})

Delete an existing item:

api.deleteItem(1234)

Official DcTrack Documentation

Visit this link for the official documentation on request bodies and attrribute names.

https://www.sunbirddcim.com/help/dcTrack/v900/API/en/Default.htm

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

dctrackclient-0.1.2.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

dctrackclient-0.1.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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