Pydevice

Installation

Device Magic Resources API

Usage

>>> args = {'file_path': 'path/to/material_list.xlsx'}
>>> dm = DeviceMagic(args)
>>>
>>> cost_of_material = 7898 # Resource id
>>> customer_list = 9789
>>> old_resource = 6778
>>>
>>> dm.resource.all() # All organization resources
{'resources': [{'id': 6958, 'original_filename': 'Equipment List.xlsx...'}
>>>
>>> dm.resource.details(customer_list)
{'resource': {'id': 9789, 'identifier': '52945f50-408...'}
>>>
>>> dm.resource.download(customer_list) # Download file
>>>
>>> dm.resource.create('Copy of all materials', 'material_list.xlsx') # Create a resource
>>>
>>> dm.resource.update(cost_of_material, 'With updated pricing', 'cost_of_material.xlsx')
>>>
>>> dm.resource.delete(old_resource)

For a quick sample which doesn't utilize Pydevice, please visit this article.

Did this answer your question?