==============================
pyrus-api-mod
==============================
A python 3 client for the Pyrus API.
Support custom URL for API and http proxy-server
The full documentation for API can be found here_.
.. _here: https://pyrus.com/en/help/api/
-----------------
Installation
-----------------
To get the latest version:
- pip_ (preffrered)
$ pip install --upgrade pyrus-api-mod
- Setuptools_: Use the easy_install tool included in the setuptools package:
$ easy_install --upgrade pyrus-api-mod
- Manual installation: `Download the latest version of pyrus-api client`_, unpack the code, and run
$ python setup.py install
.. _pip: https://pypi.python.org/pypi/pip
.. _Setuptools: https://pypi.python.org/pypi/setuptools
.. _`Download the latest version of pyrus-api client`: https://pypi.python.org/pypi/pyrus-api-mod/
-----------------
Usage
-----------------
To 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')
-----------------
Examples
-----------------
Authenticate:
>>> pyrus_client.auth()
Get all form templates:
>>> forms_response = pyrus_client.get_forms()
>>> forms = forms_response.forms
Get list of tasks created using specified form:
>>> form_register_response = pyrus_client.get_registry(forms[0].id)
>>> tasks = form_register_response.tasks
You 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).task
Add new comment to the task:
>>> request = pyrus.models.requests.TaskCommentRequest(text="hello", action="finished")
>>> task = pyrus_client.comment_task(tasks[0].id, request).task
Upload a file:
>>> response = myclient.upload_file('C:\\path\\to\\file.txt').guid
Create 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).task
Get 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.items
Get 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).announcement
Get announcements with all comments:
>>> announcements = pyrus_client.get_announcements().announcements
Add 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).announcement
Create an announcement:
>>> request = CreateAnnouncementRequest(
text="Announcement from python client",
attachments = [guid])
>>> announcement = pyrus_client.create_announcement(request).announcement
Get 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)
-----------------
Support
-----------------
If you have any questions or comments please send an email to tailgrabik@gmail.com
Raw data
{
"_id": null,
"home_page": "https://pyrus.com/en/help/api",
"name": "pyrus-api-mod",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.4",
"maintainer_email": null,
"keywords": "pyrus api",
"author": "tailgrabik",
"author_email": "tailgrabik@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ea/4c/a2f7884c4aae737d662afa43f305869a6ea91600891cf24ead8d1c7de403/pyrus_api_mod-2.19.5.tar.gz",
"platform": null,
"description": "==============================\npyrus-api-mod\n==============================\nA python 3 client for the Pyrus API.\n\nSupport custom URL for API and http proxy-server\n\nThe full documentation for API can be found here_.\n\n.. _here: https://pyrus.com/en/help/api/\n\n-----------------\nInstallation\n-----------------\n\nTo get the latest version:\n - pip_ (preffrered)\n $ pip install --upgrade pyrus-api-mod\n - Setuptools_: Use the easy_install tool included in the setuptools package:\n $ easy_install --upgrade pyrus-api-mod\n - Manual installation: `Download the latest version of pyrus-api client`_, unpack the code, and run \n $ python setup.py install\n\n.. _pip: https://pypi.python.org/pypi/pip\n.. _Setuptools: https://pypi.python.org/pypi/setuptools\n.. _`Download the latest version of pyrus-api client`: https://pypi.python.org/pypi/pyrus-api-mod/\n\n-----------------\nUsage\n-----------------\nTo start with the module:\n \n >>> from pyrus import client\n >>> import pyrus.models\n >>> pyrus_client = client.PyrusAPI(login='login@example.com', security_key='sadf2R5Wrdkn..',proxy='http://proxy:3128',api_addr='api.pyrus.com')\n\n-----------------\nExamples\n-----------------\nAuthenticate:\n \n >>> pyrus_client.auth()\n\nGet all form templates:\n\n >>> forms_response = pyrus_client.get_forms()\n >>> forms = forms_response.forms\n\nGet list of tasks created using specified form:\n\n >>> form_register_response = pyrus_client.get_registry(forms[0].id)\n >>> tasks = form_register_response.tasks\n\nYou can also filter registry by specific field value, status or current step number:\n\n >>> request = pyrus.models.requests.FormRegisterRequest(\n include_archive=True,\n steps=[1,2],\n filters=[pyrus.models.entities.EqualsFilter(1, \"hello world\")])\n >>> form_register_response = pyrus_client.get_registry(forms[0].id, request)\n\nGet task with all comments:\n\n >>> task = pyrus_client.get_task(tasks[0].id).task\n\nAdd new comment to the task:\n\n >>> request = pyrus.models.requests.TaskCommentRequest(text=\"hello\", action=\"finished\")\n >>> task = pyrus_client.comment_task(tasks[0].id, request).task\n\nUpload a file:\n >>> response = myclient.upload_file('C:\\\\path\\\\to\\\\file.txt').guid\n\nCreate a task:\n\n >>> request = CreateTaskRequest(\n text=\"Task from python client\", \n participants=['colleague@email.com', 10196] #you can specify person id, email, or pyrus.models.entities.Person object\n attachments = [guid])\n >>> task = pyrus_client.create_task(request).task\n\nGet all available contacts:\n \n >>> contacts = pyrus_client.get_contacts()\n\nGet catalog with all items:\n \n >>> catalog_id = 1525\n >>> catalog_response = pyrus_client.get_catalog(catalog_id)\n >>> items = catalog_response.items\n\t\nGet profile:\n\n >>> profile_response = pyrus_client.get_profile()\n\nGet inbox:\n\n >>> inbox_response = pyrus_client.get_inbox(tasks_count=100)\n \nGet calendar:\n\n >>> calendar_response = (pyrus_client.get_calendar_tasks(req.CalendarRequest(\n\t datetime.datetime.utcnow() - datetime.timedelta(days=30),\n\t datetime.datetime.utcnow() + datetime.timedelta(days=30),\n\t all_accessed_tasks=True,\n\t item_count=55,\n\t filter_mask=0b0111)))\n\nGet announcement with all comments:\n\n >>> announcement = pyrus_client.get_announcement(12321321).announcement\n \nGet announcements with all comments:\n\n >>> announcements = pyrus_client.get_announcements().announcements\n\nAdd new comment to the announcement:\n\n >>> request = pyrus.models.requests.AnnouncementCommentRequest(text=\"hello\", attachments = ['BEFCE22E-AEFF-4771-83D4-2A4B78FB05C6'])\n >>> announcement = pyrus_client.comment_announcement(12321321, request).announcement\n\nCreate an announcement:\n\n >>> request = CreateAnnouncementRequest(\n text=\"Announcement from python client\", \n attachments = [guid])\n >>> announcement = pyrus_client.create_announcement(request).announcement\n\nGet form permissions:\n\n >>> permissions = pyrus_client.get_permissions(123)\n\nChange form permissions:\n\n >>> request = pyrus.models.requests.ChangePermissionsRequest({1733:'member'})\n >>> changed_permissions = pyrus_client.change_permissions(123, request)\n\n-----------------\nSupport\n-----------------\nIf you have any questions or comments please send an email to tailgrabik@gmail.com\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Python Pyrus API client",
"version": "2.19.5",
"project_urls": {
"GitHub Project": "https://github.com/tailgrabik/pyrusapi-python",
"Homepage": "https://pyrus.com/en/help/api"
},
"split_keywords": [
"pyrus",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "33636fde1c8decb6b33f07cf462d01692ce5795ab10aef3a0a53c2282029528e",
"md5": "5355759ae212a5ff8d01fc2e4f50c990",
"sha256": "c05111dc4c4d7386b2fe951a80569c8c957fe40e26434105a2b39d4eeb9fbbe1"
},
"downloads": -1,
"filename": "pyrus_api_mod-2.19.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5355759ae212a5ff8d01fc2e4f50c990",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.4",
"size": 25519,
"upload_time": "2024-07-17T09:52:49",
"upload_time_iso_8601": "2024-07-17T09:52:49.730517Z",
"url": "https://files.pythonhosted.org/packages/33/63/6fde1c8decb6b33f07cf462d01692ce5795ab10aef3a0a53c2282029528e/pyrus_api_mod-2.19.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ea4ca2f7884c4aae737d662afa43f305869a6ea91600891cf24ead8d1c7de403",
"md5": "fba1c27e6087761f3efbb3984f285e3a",
"sha256": "ca0b2664bca7907e7b9f3de9f9a299bd397ced36271da92ce02d291828a78d89"
},
"downloads": -1,
"filename": "pyrus_api_mod-2.19.5.tar.gz",
"has_sig": false,
"md5_digest": "fba1c27e6087761f3efbb3984f285e3a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.4",
"size": 24769,
"upload_time": "2024-07-17T09:52:50",
"upload_time_iso_8601": "2024-07-17T09:52:50.686486Z",
"url": "https://files.pythonhosted.org/packages/ea/4c/a2f7884c4aae737d662afa43f305869a6ea91600891cf24ead8d1c7de403/pyrus_api_mod-2.19.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-17 09:52:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tailgrabik",
"github_project": "pyrusapi-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyrus-api-mod"
}