Package: pyrus-api-mod
A python 3 client for the Pyrus API.Support custom URL for API and http proxy-serverThe full documentation for API can be foundhere.InstallationTo get the latest version:pip(preffrered)$ pip install –upgrade pyrus-api-modSetuptools: Use the easy_install tool included in the setuptools package:$ easy_install –upgrade pyrus-api-modManual installation:Download the latest version of pyrus-api client, unpack the code, and run$ python setup.py installUsageTo start with the module:>>>  from pyrus import client
>>>  import pyrus.models
>>>  pyrus_client = client.PyrusAPI(login='login@example.com', security_key='sadf2R5Wrdkn..',proxy='http://proxy:3128',api_addr='api.pyrus.com')ExamplesAuthenticate:>>> pyrus_client.auth()Get all form templates:>>> forms_response = pyrus_client.get_forms()
>>> forms = forms_response.formsGet list of tasks created using specified form:>>> form_register_response = pyrus_client.get_registry(forms[0].id)
>>> tasks = form_register_response.tasksYou can also filter registry by specific field value, status or current step number:>>> request = pyrus.models.requests.FormRegisterRequest(
        include_archive=True,
        steps=[1,2],
        filters=[pyrus.models.entities.EqualsFilter(1, "hello world")])
>>> form_register_response = pyrus_client.get_registry(forms[0].id, request)Get task with all comments:>>> task = pyrus_client.get_task(tasks[0].id).taskAdd new comment to the task:>>> request = pyrus.models.requests.TaskCommentRequest(text="hello", action="finished")
>>> task = pyrus_client.comment_task(tasks[0].id, request).taskUpload a file:>>> response = myclient.upload_file('C:\\path\\to\\file.txt').guidCreate a task:>>> request = CreateTaskRequest(
        text="Task from python client",
        participants=['colleague@email.com', 10196] #you can specify person id, email, or pyrus.models.entities.Person object
        attachments = [guid])
>>> task = pyrus_client.create_task(request).taskGet all available contacts:>>> contacts = pyrus_client.get_contacts()Get catalog with all items:>>> catalog_id = 1525
>>> catalog_response = pyrus_client.get_catalog(catalog_id)
>>> items = catalog_response.itemsGet profile:>>> profile_response = pyrus_client.get_profile()Get inbox:>>> inbox_response = pyrus_client.get_inbox(tasks_count=100)Get calendar:>>> calendar_response = (pyrus_client.get_calendar_tasks(req.CalendarRequest(
            datetime.datetime.utcnow() - datetime.timedelta(days=30),
            datetime.datetime.utcnow() + datetime.timedelta(days=30),
            all_accessed_tasks=True,
            item_count=55,
            filter_mask=0b0111)))Get announcement with all comments:>>> announcement = pyrus_client.get_announcement(12321321).announcementGet announcements with all comments:>>> announcements = pyrus_client.get_announcements().announcementsAdd new comment to the announcement:>>> request = pyrus.models.requests.AnnouncementCommentRequest(text="hello", attachments = ['BEFCE22E-AEFF-4771-83D4-2A4B78FB05C6'])
>>> announcement = pyrus_client.comment_announcement(12321321, request).announcementCreate an announcement:>>> request = CreateAnnouncementRequest(
        text="Announcement from python client",
        attachments = [guid])
>>> announcement = pyrus_client.create_announcement(request).announcementGet form permissions:>>> permissions = pyrus_client.get_permissions(123)Change form permissions:>>> request = pyrus.models.requests.ChangePermissionsRequest({1733:'member'})
>>> changed_permissions = pyrus_client.change_permissions(123, request)SupportIf you have any questions or comments please send an email totailgrabik@gmail.com