### Install Pyrus API Python Client Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Instructions for installing the pyrus-api library using pip, setuptools, or manual installation. Pip is the preferred method. ```bash $ pip install --upgrade pyrus-api ``` ```bash $ easy_install --upgrade pyrus-api ``` ```bash $ python setup.py install ``` -------------------------------- ### Install pyrus-api manually Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Installs the pyrus-api client manually by downloading the latest version, unpacking the code, and running the setup script. ```bash python setup.py install ``` -------------------------------- ### Install pyrus-api using easy_install Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Installs or upgrades the pyrus-api package using the easy_install tool, which is part of the setuptools package. ```bash easy_install --upgrade pyrus-api ``` -------------------------------- ### Install pyrus-api using pip Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Installs or upgrades the pyrus-api package to the latest version using pip, the preferred package installer for Python. ```bash pip install --upgrade pyrus-api ``` -------------------------------- ### Get All Pyrus Lists Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Fetches a list of all available lists in Pyrus. ```python response = pyrus_client.get_lists() lists = response.lists ``` -------------------------------- ### Get all announcements Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves a list of all announcements, including their comments. ```python announcements = pyrus_client.get_announcements().announcements ``` -------------------------------- ### Get All Pyrus Organization Roles Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Fetches a list of all roles defined within the Pyrus organization. ```python roles_response = pyrus_client.get_roles() roles = roles_response.roles ``` -------------------------------- ### Upload File to Pyrus Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Uploads a file to Pyrus and returns its unique identifier (GUID). ```python response = pyrus_client.upload_file('C:\\path\\to\\file.txt').guid ``` -------------------------------- ### Get Pyrus Catalog Items Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves all items from a specified catalog by its ID. ```python catalog_id = 1525 catalog_response = pyrus_client.get_catalog(catalog_id) items = catalog_response.items ``` -------------------------------- ### Upload a file Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Uploads a file to the Pyrus service and returns its unique identifier (GUID). ```python response = myclient.upload_file('C:\\path\\to\\file.txt').guid ``` -------------------------------- ### Get Pyrus User Profile Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves the profile information for the current Pyrus user. ```python profile_response = pyrus_client.get_profile() ``` -------------------------------- ### Get All Pyrus Contacts Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves a list of all available contacts within the Pyrus system. ```python contacts = pyrus_client.get_contacts() ``` -------------------------------- ### Get all contacts Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves a list of all available contacts from the Pyrus service. ```python contacts = pyrus_client.get_contacts() ``` -------------------------------- ### Get All Form Templates Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves all available form templates from the Pyrus API using the pyrus-client. The response contains a list of forms. ```python forms_response = pyrus_client.get_forms() forms = forms_response.forms ``` -------------------------------- ### Get all form templates Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves a list of all available form templates from the Pyrus API. The response contains a list of forms. ```python forms_response = pyrus_client.get_forms() forms = forms_response.forms ``` -------------------------------- ### Get Announcement with Comments Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Fetches a specific announcement along with all its associated comments. This is useful for retrieving detailed information about a single announcement. ```Python announcement = pyrus_client.get_announcement(12321321).announcement ``` -------------------------------- ### Get catalog items Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves all items from a specified catalog, identified by its ID. The response includes a list of items. ```python catalog_id = 1525 catalog_response = pyrus_client.get_catalog(catalog_id) items = catalog_response.items ``` -------------------------------- ### Get user profile Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves the profile information of the currently authenticated user from the Pyrus service. ```python profile_response = pyrus_client.get_profile() ``` -------------------------------- ### Get announcement with comments Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves a specific announcement along with all its associated comments, identified by the announcement ID. ```python announcement = pyrus_client.get_announcement(12321321).announcement ``` -------------------------------- ### Get form permissions Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves the permissions associated with a specific form, identified by its ID. ```python permissions = pyrus_client.get_permissions(123) ``` -------------------------------- ### Get Multiple Announcements Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves a list of announcements, including their comments. This function is suitable for fetching multiple announcements at once. ```Python announcements = pyrus_client.get_announcements().announcements ``` -------------------------------- ### Get a task with comments Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves a specific task along with all its associated comments, identified by the task ID. ```python task = pyrus_client.get_task(tasks[0].id).task ``` -------------------------------- ### Get Task with Comments Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves a specific task along with all its associated comments using the task ID. ```python task = pyrus_client.get_task(tasks[0].id).task ``` -------------------------------- ### Get Pyrus Inbox Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves items from the user's Pyrus inbox, with an option to specify the number of tasks to fetch. ```python inbox_response = pyrus_client.get_inbox(tasks_count=100) ``` -------------------------------- ### Get inbox tasks Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves tasks from the user's inbox, with an option to specify the number of tasks to fetch. ```python inbox_response = pyrus_client.get_inbox(tasks_count=100) ``` -------------------------------- ### Get Tasks List by Form Template Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Fetches a list of tasks associated with a specific form template. It allows filtering and including archived tasks. ```python request = pyrus.models.requests.FormRegisterRequest( include_archived=True, steps=[1,2], filters=[pyrus.models.entities.EqualsFilter(1, "hello world")]) form_register_response = pyrus_client.get_registry(forms[0].id, request) tasks = form_register_response.tasks ``` -------------------------------- ### Get tasks for a specific form Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves a list of tasks created using a specific form template, identified by its ID. ```python form_register_response = pyrus_client.get_registry(forms[0].id) tasks = form_register_response.tasks ``` -------------------------------- ### Get Form Permissions Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves the current permissions for a specified form. This function takes a form ID as input. ```Python permissions = pyrus_client.get_permissions(123) ``` -------------------------------- ### Get Tasks in a Pyrus List Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves tasks associated with a specific list, with options to control the number of items and include archived tasks. ```python list_id = 1522 response = pyrus_client.get_task_list(list_id, item_count=25, include_archived=True) tasks = response.tasks ``` -------------------------------- ### Get calendar tasks Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves calendar tasks within a specified date range, with options for filtering and item count. Uses `CalendarRequest`. ```python import datetime 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 Calendar Tasks Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Retrieves calendar tasks within a specified date range. It allows filtering by accessed tasks and item count. Dependencies include the datetime module. ```Python 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 ))) ``` -------------------------------- ### Authenticate Pyrus API Client Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Shows how to create an instance of the PyrusAPI client with login credentials and security key, and then perform authentication. ```python pyrus_client = client.PyrusAPI(login='login@pyrus.com', security_key='sadf2R5Wrdkn..') auth_response = pyrus_client.auth() if auth_response.success: pass ``` -------------------------------- ### Initialize Pyrus API Client Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Initializes the PyrusAPI client with user credentials (login and security key) and imports necessary models. ```python from pyrus import client import pyrus.models pyrus_client = client.PyrusAPI(login='login@pyrus.com', security_key='sadf2R5Wrdkn..') ``` -------------------------------- ### Create Pyrus Catalog Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Creates a new catalog in Pyrus with specified headers and initial items. ```python request = pyrus.models.requests.CreateCatalogRequest( name = "NewCatalog", catalog_headers = ["Column1", "Column2", "Column3"], items = [ ["A1", "A2", "A3"], ["B1", "B2", "B3"], ["C1", "C2", "C3"] ] ) catalog_id = pyrus_client.create_catalog(request).catalog_id ``` -------------------------------- ### Import Pyrus API Modules Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Demonstrates how to import the necessary client and models modules from the pyrus-api library into your Python project. ```python from pyrus import client import pyrus.models ``` -------------------------------- ### Create an announcement Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Creates a new announcement with specified text and optional attachments. Uses `CreateAnnouncementRequest`. ```python request = CreateAnnouncementRequest( text="Announcement from python client", attachments = [guid]) announcement = pyrus_client.create_announcement(request).announcement ``` -------------------------------- ### Create Pyrus Task Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Creates a new task in Pyrus. Requires task text, participants, and optionally attachments. ```python request = CreateTaskRequest( text="Task from python client", participants=['colleague@email.com', 10196] attachments = ['BEFCE22E-AEFF-4771-83D4-2A4B78FB05C6']) task = pyrus_client.create_task(request).task ``` -------------------------------- ### Create Announcement Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Creates a new announcement with provided text content and optional file attachments. Requires a CreateAnnouncementRequest object. ```Python request = CreateAnnouncementRequest( text="Announcement from python client", attachments = ['BEFCE22E-AEFF-4771-83D4-2A4B78FB05C6']) announcement = pyrus_client.create_announcement(request).announcement ``` -------------------------------- ### Create a task Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Creates a new task in Pyrus with specified text, participants (by email, ID, or Person object), and optional attachments. Uses `CreateTaskRequest`. ```python 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).task ``` -------------------------------- ### Create Pyrus Role Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Creates a new role in Pyrus with a specified name and members. ```python create_role_request = CreateRoleRequest( name='TechSupport', members=[1233, 3043]) role_response = pyrus_client.create_role(create_role_request) ``` -------------------------------- ### Authenticate with Pyrus API Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Authenticates the PyrusAPI client to establish a connection with the Pyrus service. ```python pyrus_client.auth() ``` -------------------------------- ### Sync Pyrus Catalog Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Synchronizes a catalog with new items and headers. Unspecified items and text columns will be deleted. ```python catalog_id = 7825 request = pyrus.models.requests.SyncCatalogRequest( apply = True, catalog_headers = ["Column1", "Column4", "Column3"], items = [ ["A1", "A2", "A3"], ["B1", "B4", "B5"], ["D1", "D2", "D3"] ] ) response = pyrus_client.sync_catalog(catalog_id, request) deleted = response.deleted updated = response.updated added = response.added new_headers = response.catalog_headers ``` -------------------------------- ### Filter registry by field value and status Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Retrieves tasks from a registry, filtered by specific field values, statuses, or current step numbers. It utilizes `FormRegisterRequest` for detailed filtering. ```python 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) ``` -------------------------------- ### Add Task Comment Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Adds a comment to a specific task. The comment can include text and an action. ```python request = pyrus.models.requests.TaskCommentRequest(text="hello", action="finished") task = pyrus_client.comment_task(tasks[0].id, request).task ``` -------------------------------- ### Add Comment to Announcement Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Adds a new comment to an existing announcement. Supports text content and file attachments, identified by their unique IDs. ```Python request = pyrus.models.requests.AnnouncementCommentRequest(text="hello", attachments = ['BEFCE22E-AEFF-4771-83D4-2A4B78FB05C6']) announcement = pyrus_client.comment_announcement(12321321, request).announcement ``` -------------------------------- ### Update Pyrus Catalog Items Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Updates existing items in a catalog or adds new ones (upsert), and allows deletion of specific items. ```python catalog_id = 7825 request = pyrus.models.requests.UpdateCatalogItemsRequest( upsert = [ ["A1", "A5", "A6"], ["E1", "E2", "E3"] ], delete = ["B1"]) response = pyrus_client.update_catalog_items(catalog_id, request) deleted = response.deleted updated = response.updated added = response.added ``` -------------------------------- ### Add comment to announcement Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Adds a new comment to a specific announcement, including text and optional attachments. Uses `AnnouncementCommentRequest`. ```python request = pyrus.models.requests.AnnouncementCommentRequest(text="hello", attachments = ['BEFCE22E-AEFF-4771-83D4-2A4B78FB05C6']) announcement = pyrus_client.comment_announcement(12321321, request).announcement ``` -------------------------------- ### Add a comment to a task Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Adds a new comment to a specific task, including text and optional attachments. It uses `TaskCommentRequest` to structure the comment data. ```python request = pyrus.models.requests.TaskCommentRequest(text="hello", action="finished") task = pyrus_client.comment_task(tasks[0].id, request).task ``` -------------------------------- ### Update Pyrus Role Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Updates an existing role by changing its name, adding members, or removing members. ```python Update_role_request = UpdateRoleRequest( name='InternalTechSupport', added_members=[2766], removed_members=[1233]) role_response = pyrus_client.update_role(create_role_request) ``` -------------------------------- ### Change form permissions Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.rst Changes the permissions for a specific form, allowing modification of user roles or access levels. Uses `ChangePermissionsRequest`. ```python request = pyrus.models.requests.ChangePermissionsRequest({1733:'member'}) changed_permissions = pyrus_client.change_permissions(123, request) ``` -------------------------------- ### Change Form Permissions Source: https://github.com/simplygoodsoftware/pyrusapi-python/blob/master/README.md Modifies the permissions for a given form. It accepts a form ID and a ChangePermissionsRequest object containing the new permission settings. ```Python request = pyrus.models.requests.ChangePermissionsRequest({1733:'member'}) changed_permissions = pyrus_client.change_permissions(123, request) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.