Skip to main content

Structured way to interface with Simpro

Project description

SimproAPI

Intended to be a Structured way to interface with Simpro's API.
Its currently focused on the Plants & Equipment section of Simpro.

Has classes and methods for:

  • Token Management - Get/Load/save/update
  • Iterating over Plants & equipment to find trackable's

Usage

Firstly you need to make up an instance of the TokenManager Class.
This Class will be used to pass the retrieved Token to other methods later

simpro_token=SimproAPI.TokenManager(
	server='https://XXXXXXXX.simprocloud.com'
	client_id='XXXXXXXXXXXXXXXXXXXXX'
	client_secret='XXXXXXXXXXXXXXXXXXXXX'
	username='XXXXXXXXXXXXXXXXXXXXX'
	password='XXXXXXXXXXXXXXXXXXXXX'
	save_location='simpro_token.json'
)
simpro_token.load_token() #Loads any token information in the save_location json file
simpro_token.update_token() # Check if the token is expired and renews if so.

Once the above is done we can actually pull some information from Simpro

with SimproAPI.trackables(simpro_token.server,simpro_token.access_token) as trackables:
    trackables.get_companies(
        9000, #your_company_id
        [Serial,Location ] #list of custom_fields you are tracking
    )

The above Method is a big one. It will use sessions to iterate over the company and all plant types within.
If the plant type has the custom fields specified it will then iterate over all plants and return the custom fields specified.

Installation

pip install SimproAPI

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

SimproAPI-0.1.8.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

SimproAPI-0.1.8-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file SimproAPI-0.1.8.tar.gz.

File metadata

  • Download URL: SimproAPI-0.1.8.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.6

File hashes

Hashes for SimproAPI-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f216d464fde0a5eb50bed80561972288d3ddf8ab5060ad289304ab3199a9b115
MD5 01d04a51629aa247834d33cac1a6bd7f
BLAKE2b-256 36b07d0c8af7addc32b8690aef5ef17f7a848364ec511c69575b724b851f457b

See more details on using hashes here.

File details

Details for the file SimproAPI-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: SimproAPI-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.6

File hashes

Hashes for SimproAPI-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8c26144c288a4f34f11e240092c7d70d55012389e2a2edd927c170c64d01e373
MD5 13e0294aac8a23791c4b734f589efd32
BLAKE2b-256 7d5825da268b6b3ab68f802c83fa6fca856f394d5bac68669cdbc169cfd23546

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