Installation

PyPi:

pip install pydevice

Git:

git clone https://github.com/aseli1/pydevice.git
cd pydevice
python setup.py install

Tested on Python 3.6.3 -- works on Mac

Usage

>>> from pydevice import DeviceMagic
>>> args = {'org_id': 3000,'database_id': 580, 'form_id': 6000, 'resource_id': 103, 'file_path': 'path/to/file'}
>>> dm = DeviceMagic(args)
>>> dm.form.all() # destination, device, resource, group, and dispatch also have this method
{'forms': [{'id': 40015631, 'name': 'Daily Report'...}

Authentication

Authentication is handled by the DeviceMagic class. The class can handle authentication automatically if the environment variable DEVICEMAGIC_API_KEY is set with your api key.

>>> import os
>>> os.environ['DEVICEMAGIC_API_KEY'] = 'Basic c3ppZhh39fj3Wjk6eA=='
>>> dm = DeviceMagic(args)

In preference, you can pass the key explicitly:

>>> dm = DeviceMagic({'api_key': 'Basic c3ppZhh39fj3Wjk6eA=='})

Currently supportsĀ 

Did this answer your question?