Skip to main content

API wrapper class for roam.plus

Project description

roamPy

A python library of API wrapper functions to retrieve data from the roam.plus platform. Includes the

Roam python class which has one method corresponding to each API endpoint including, Subscriptions, SubscriptionPeriods, Products and Licenses.

Full focumentaion can be found here: roampy.readthedocs.io

Installation

pip install roamPy

Get Started

How to test connection to the Roam server:


from roamPy import Roam



#API Key stored as system variable

token = = os.environ.get('Roam_API_Key')



#Instantiate object of Roam class

roam = Roam(url=<base url of roam instance>, token=token)



#Test connection

print(roam.checkHeartbeat())

Successful Connection Output


{'data': None, 'meta': {'message': 'API ready for requests'}}

Request metadata for a given subscription using its id number:


from roamPy import Roam



#API Key stored as system variable

token = = os.environ.get('Roam_API_Key')



#Instantiate object of Roam class

roam = Roam(url=<base url of roam instance>, token=token)



#Return Data for Subscription using ID.

sub = roam.getOneSubscription(id = 'id number')



print(sub)

Retreive data for all subscription periods between two dates:


from roamPy import Roam



#API Key stored as system variable

token = = os.environ.get('Roam_API_Key')



#Instantiate object of Roam class

roam = Roam(url=<base url of roam instance>, token=token)



allSPBetween = roam.getSubscriptionPeriodsBetween(startDate='2020-01-01', endDate='2021-01-01')



print(allSPBetween)

Retreive all licenses and relations:


from roamPy import Roam



#API Key stored as system variable

token = = os.environ.get('Roam_API_Key')



#Instantiate object of Roam class

roam = Roam(url=<base url of roam instance>, token=token)



licRel = roam.getLicenseswRels(['licensePeriods', 'publisher'])



print(licRel)

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

roamPy-0.1.4.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

roamPy-0.1.4-py3-none-any.whl (8.0 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