Name | pytrengo JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | Python client for the Trengo REST API. |
upload_time | 2024-09-16 08:25:27 |
maintainer | None |
docs_url | None |
author | Baptiste Fontaine |
requires_python | <4.0,>=3.10 |
license | None |
keywords |
trengo
pytrengo
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PyTrengo
**PyTrengo** is a lightweight Python client for the Trengo API.
Note: PyTrengo is not affiliated nor endorsed by Trengo.
## Install
With pip:
pip install pytrengo
With Poetry:
poetry add pytrengo
Requirement: Python 3.10+
## Usage
```python3
from trengo import Trengo
trengo_client = Trengo(token="...")
# If the token is not provided, it’s read from the TRENGO_TOKEN environment variable
trengo_client = Trengo()
for ticket in trengo_client.get_tickets():
print(...)
```
List queries are transparently paginated for you.
## Endpoints coverage
Note: even if an endpoint is not implemented, you can call it with one of the helper methods:
```python3
# GET /v2/some-endpoints?foo=bar
trengo_client.get_json_api("/some-endpoint", params={"foo": "bar"})
# POST /v2/some-other-endpoint with {"foo": "bar"}
trengo_client.post_json_api("/some-other-endpoint",
json={"foo": "bar"})
```
| Endpoint | Method |
|:-----------------------------------|:-------------------------------|
| **All endpoints** | **40%** |
| **Tickets** | **100%** |
| List all tickets | `get_tickets` |
| List all aggregates | `get_ticket_aggregates` |
| Create a ticket | `create_ticket` |
| Assign a ticket | `assign_ticket` |
| Close a ticket | `close_ticket` |
| Reopen a ticket | `reopen_ticket` |
| Merge a ticket | `merge_ticket` |
| Attach a label | `attach_ticket_label` |
| Detach a label | `detach_ticket_label` |
| Delete a ticket | `delete_ticket` |
| Mark as spam | `mark_ticket_as_spam` |
| Unmark as spam | `unmark_ticket_as_spam` |
| Set custom data | `set_custom_data` |
| Delete a message | `delete_message` |
| Send a ticket message | `send_ticket_message` |
| Send a ticket media message | `send_ticket_media_message` |
| List all messages | `get_messages` |
| Mark a ticket as favorite | `mark_ticket_as_favorite` |
| Unmark a ticket as favorite | `unmark_ticket_as_favorite` |
| Fetch a message | `get_message` |
| Store a custom channel message | `store_custom_channel_message` |
| **WhatsApp** | **100%** |
| Send a WhatsApp template | `send_whatsapp_template` |
| **Contacts** | **36%** |
| List contacts | `get_contacts` |
| View a contact | `get_contact` |
| Create a contact | `create_contact` (since 0.1.4) |
| Update a contact | `update_contact` (since 0.1.4) |
| Delete a contact | |
| Custom fields | |
| Add a note | |
| Delete a note | |
| **Profiles** | **16%** |
| Create a profile | |
| List profiles | `get_profiles` |
| View a profile | `get_profile` (since 0.1.4) |
| Update a profile | |
| Custom fields | |
| Delete a profile | |
| Create a note | |
| Delete a note | |
| Attach a contact | |
| Detach a contact | |
| Set profile image | |
| Unset profile image | |
| **SMS messages** | **33%** |
| List all messages | `get_sms_messages` |
| Send a message | |
| Fetch balance | |
| **Messages** | **0%** |
| Import text message | |
| Import email message | |
| **Team Chat** | **0%** |
| Sending a bot message | |
| **Voip** | **0%** |
| Push SIP call status | |
| List all voip calls | |
| Get a voip call | |
| **Help Center** | **24%** |
| List all help centers | `get_help_centers` |
| List all categories | `get_help_center_categories` |
| List all articles | |
| List all blocks | `get_help_center_blocks` |
| Get a help center | `get_help_center` |
| Get a category | `get_help_center_category` |
| Get an article | `get_help_center_article` |
| Get a block | `get_help_center_block` |
| Create a help center | |
| Create a category | |
| Create a section | |
| Create an article | |
| Create a block | |
| Update a help center | |
| Update a category | |
| Update a section | |
| Update an article | |
| Update a block | |
| Delete a help center | `delete_help_center` |
| Delete a category | `delete_help_center_category` |
| Delete a section | |
| Delete an article | |
| Delete a block | |
| **Quick Replies** | **20%** |
| List all quick replies | `get_quick_replies` |
| Create a quick reply | |
| Update a quick reply | |
| Delete a quick reply | |
| **Ticket Results** | **20%** |
| List all ticket results | `get_ticket_results` |
| Get a ticket result | |
| Create a ticket result | |
| Update a ticket result | |
| Delete a ticket result | |
| **Contact Groups** | **20%** |
| List all contact groups | `get_contact_groups` |
| Get a contact group | |
| Create a contact group | |
| Update a contact group | |
| Delete a contact group | |
| **Labels** | **20%** |
| List all labels | `get_labels` |
| Get a label | |
| Create a label | |
| Update a label | |
| Delete a label | |
| **Teams** | **20%** |
| List all teams | `get_teams` |
| Get a team | |
| Update a team | |
| Create a team | |
| Delete a team | |
| **Users** | **20%** |
| List all users | `get_users` |
| Get a user | |
| Create a user | |
| Update a user | |
| Delete a user | |
| **Custom fields** | **20%** |
| List all custom fields | `get_custom_fields` |
| Create a custom field | |
| Get a custom field | |
| Update a custom field | |
| Delete a custom field | |
| **Webhooks** | **60%** |
| List all webhooks | `get_webhooks` |
| Create a webhook | `create_webhook` |
| Get a webhook | `get_webhook` |
| Update a webhook | |
| Delete a webhook | |
| **Quick actions** | **0%** |
| Send a message | |
| Log a phone call | |
| **BETA - Reporting** | **20%** |
| BETA - Get reporting metrics | `get_reporting_metrics` |
| BETA - Get user report | |
| BETA - Get reporting histograms | |
| BETA - Agent performance reporting | |
| BETA - Get Ticket Details Report | |
## Naming
* Methods for API endpoints like "List <name>s" are named `get_<name>s`
* Methods for API endpoints like "Get <name>" or "View <name>" are named `get_<name>`
* We try to stay consistent even when the API isn’t: the field for the relations to include is always named `include` in
PyTrengo, while the API uses `include` in some calls and `with` in some others
## License
Copyright 2024 [Bixoto](https://bixoto.com/).
Raw data
{
"_id": null,
"home_page": null,
"name": "pytrengo",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "trengo, pytrengo",
"author": "Baptiste Fontaine",
"author_email": "baptiste@bixoto.com",
"download_url": "https://files.pythonhosted.org/packages/d0/74/30e106ae38b7dce09b634a119ea828c06e6c08bb2ad24a80aa5669a9b2cc/pytrengo-0.1.4.tar.gz",
"platform": null,
"description": "# PyTrengo\n\n**PyTrengo** is a lightweight Python client for the Trengo API.\n\nNote: PyTrengo is not affiliated nor endorsed by Trengo.\n\n## Install\n\nWith pip:\n\n pip install pytrengo\n\nWith Poetry:\n\n poetry add pytrengo\n\nRequirement: Python 3.10+\n\n## Usage\n\n```python3\nfrom trengo import Trengo\n\ntrengo_client = Trengo(token=\"...\")\n\n# If the token is not provided, it\u2019s read from the TRENGO_TOKEN environment variable\ntrengo_client = Trengo()\n\nfor ticket in trengo_client.get_tickets():\n print(...)\n```\n\nList queries are transparently paginated for you.\n\n## Endpoints coverage\n\nNote: even if an endpoint is not implemented, you can call it with one of the helper methods:\n\n```python3\n# GET /v2/some-endpoints?foo=bar\ntrengo_client.get_json_api(\"/some-endpoint\", params={\"foo\": \"bar\"})\n# POST /v2/some-other-endpoint with {\"foo\": \"bar\"}\ntrengo_client.post_json_api(\"/some-other-endpoint\",\n json={\"foo\": \"bar\"})\n```\n\n| Endpoint | Method |\n|:-----------------------------------|:-------------------------------|\n| **All endpoints** | **40%** |\n| **Tickets** | **100%** |\n| List all tickets | `get_tickets` |\n| List all aggregates | `get_ticket_aggregates` |\n| Create a ticket | `create_ticket` |\n| Assign a ticket | `assign_ticket` |\n| Close a ticket | `close_ticket` |\n| Reopen a ticket | `reopen_ticket` |\n| Merge a ticket | `merge_ticket` |\n| Attach a label | `attach_ticket_label` |\n| Detach a label | `detach_ticket_label` |\n| Delete a ticket | `delete_ticket` |\n| Mark as spam | `mark_ticket_as_spam` |\n| Unmark as spam | `unmark_ticket_as_spam` |\n| Set custom data | `set_custom_data` |\n| Delete a message | `delete_message` |\n| Send a ticket message | `send_ticket_message` |\n| Send a ticket media message | `send_ticket_media_message` |\n| List all messages | `get_messages` |\n| Mark a ticket as favorite | `mark_ticket_as_favorite` |\n| Unmark a ticket as favorite | `unmark_ticket_as_favorite` |\n| Fetch a message | `get_message` |\n| Store a custom channel message | `store_custom_channel_message` |\n| **WhatsApp** | **100%** |\n| Send a WhatsApp template | `send_whatsapp_template` |\n| **Contacts** | **36%** |\n| List contacts | `get_contacts` |\n| View a contact | `get_contact` |\n| Create a contact | `create_contact` (since 0.1.4) |\n| Update a contact | `update_contact` (since 0.1.4) |\n| Delete a contact | |\n| Custom fields | |\n| Add a note | |\n| Delete a note | |\n| **Profiles** | **16%** |\n| Create a profile | |\n| List profiles | `get_profiles` |\n| View a profile | `get_profile` (since 0.1.4) |\n| Update a profile | |\n| Custom fields | |\n| Delete a profile | |\n| Create a note | |\n| Delete a note | |\n| Attach a contact | |\n| Detach a contact | |\n| Set profile image | |\n| Unset profile image | |\n| **SMS messages** | **33%** |\n| List all messages | `get_sms_messages` |\n| Send a message | |\n| Fetch balance | |\n| **Messages** | **0%** |\n| Import text message | |\n| Import email message | |\n| **Team Chat** | **0%** |\n| Sending a bot message | |\n| **Voip** | **0%** |\n| Push SIP call status | |\n| List all voip calls | |\n| Get a voip call | |\n| **Help Center** | **24%** |\n| List all help centers | `get_help_centers` |\n| List all categories | `get_help_center_categories` |\n| List all articles | |\n| List all blocks | `get_help_center_blocks` |\n| Get a help center | `get_help_center` |\n| Get a category | `get_help_center_category` |\n| Get an article | `get_help_center_article` |\n| Get a block | `get_help_center_block` |\n| Create a help center | |\n| Create a category | |\n| Create a section | |\n| Create an article | |\n| Create a block | |\n| Update a help center | |\n| Update a category | |\n| Update a section | |\n| Update an article | |\n| Update a block | |\n| Delete a help center | `delete_help_center` |\n| Delete a category | `delete_help_center_category` |\n| Delete a section | |\n| Delete an article | |\n| Delete a block | |\n| **Quick Replies** | **20%** |\n| List all quick replies | `get_quick_replies` |\n| Create a quick reply | |\n| Update a quick reply | |\n| Delete a quick reply | |\n| **Ticket Results** | **20%** |\n| List all ticket results | `get_ticket_results` |\n| Get a ticket result | |\n| Create a ticket result | |\n| Update a ticket result | |\n| Delete a ticket result | |\n| **Contact Groups** | **20%** |\n| List all contact groups | `get_contact_groups` |\n| Get a contact group | |\n| Create a contact group | |\n| Update a contact group | |\n| Delete a contact group | |\n| **Labels** | **20%** |\n| List all labels | `get_labels` |\n| Get a label | |\n| Create a label | |\n| Update a label | |\n| Delete a label | |\n| **Teams** | **20%** |\n| List all teams | `get_teams` |\n| Get a team | |\n| Update a team | |\n| Create a team | |\n| Delete a team | |\n| **Users** | **20%** |\n| List all users | `get_users` |\n| Get a user | |\n| Create a user | |\n| Update a user | |\n| Delete a user | |\n| **Custom fields** | **20%** |\n| List all custom fields | `get_custom_fields` |\n| Create a custom field | |\n| Get a custom field | |\n| Update a custom field | |\n| Delete a custom field | |\n| **Webhooks** | **60%** |\n| List all webhooks | `get_webhooks` |\n| Create a webhook | `create_webhook` |\n| Get a webhook | `get_webhook` |\n| Update a webhook | |\n| Delete a webhook | |\n| **Quick actions** | **0%** |\n| Send a message | |\n| Log a phone call | |\n| **BETA - Reporting** | **20%** |\n| BETA - Get reporting metrics | `get_reporting_metrics` |\n| BETA - Get user report | |\n| BETA - Get reporting histograms | |\n| BETA - Agent performance reporting | |\n| BETA - Get Ticket Details Report | |\n\n## Naming\n\n* Methods for API endpoints like \"List <name>s\" are named `get_<name>s`\n* Methods for API endpoints like \"Get <name>\" or \"View <name>\" are named `get_<name>`\n* We try to stay consistent even when the API isn\u2019t: the field for the relations to include is always named `include` in\n PyTrengo, while the API uses `include` in some calls and `with` in some others\n\n## License\n\nCopyright 2024 [Bixoto](https://bixoto.com/).\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Python client for the Trengo REST API.",
"version": "0.1.4",
"project_urls": null,
"split_keywords": [
"trengo",
" pytrengo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "00abda3dc81eb426b1d213ca1a4b7f6a17cc69a0b47c26fcf3a7d5754ffd39d7",
"md5": "694e43311024a5cff03f47441b55bd26",
"sha256": "b87a233a87a75bc3503b79742bbdce7e5d356e83cd3ec1115db528925758dd7e"
},
"downloads": -1,
"filename": "pytrengo-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "694e43311024a5cff03f47441b55bd26",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 8001,
"upload_time": "2024-09-16T08:25:26",
"upload_time_iso_8601": "2024-09-16T08:25:26.382992Z",
"url": "https://files.pythonhosted.org/packages/00/ab/da3dc81eb426b1d213ca1a4b7f6a17cc69a0b47c26fcf3a7d5754ffd39d7/pytrengo-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d07430e106ae38b7dce09b634a119ea828c06e6c08bb2ad24a80aa5669a9b2cc",
"md5": "053335192a0964bfd7f0ab5b75786053",
"sha256": "3e0f691a2b27b0b2aad638b269d8cb6804435746fbf09b3009eb4eb9e81756f9"
},
"downloads": -1,
"filename": "pytrengo-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "053335192a0964bfd7f0ab5b75786053",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 8853,
"upload_time": "2024-09-16T08:25:27",
"upload_time_iso_8601": "2024-09-16T08:25:27.797022Z",
"url": "https://files.pythonhosted.org/packages/d0/74/30e106ae38b7dce09b634a119ea828c06e6c08bb2ad24a80aa5669a9b2cc/pytrengo-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-16 08:25:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pytrengo"
}