{ "info": { "author": "Thomas Scholtz", "author_email": "thomas@labs.epiuse.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 3.7" ], "description": "# clientcentral-api-python\n[![version](https://img.shields.io/badge/version-8.2.0-green.svg)]()\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n# Install\n```bash\npip install clientcentral --user\n```\n# Upgrading\n```bash\npip install --user --upgrade clientcentral\n```\n\nA specific version can also be installed by adding the tag:\n```bash\npip install --user --upgrade clientcentral==8.2.0\n```\n\n# Requirements\nThis library was built and tested on `Python 3.7.4` a minimal Python version of `Python 3.6.x` is required.\n\n`Python 2` is not supported.\n\n# Features\n- Object Oriented API\n- Querying\n- Lazy loading (Events)\n\n# Config\nThe token that will be used can either be sent as an environement variable:\n```bash\nCC_TOKEN= python3 main.py\n```\nor parsed to the constructor:\n```python\ncc = ClientCentral(production=True, token=\"123\")\n```\n\n# Example usage\n\n```python\nimport clientcentral.ticketformatting as tf\nfrom clientcentral.clientcentral import ClientCentral\n\n# Production 'false' will run on qa.cc\ncc = ClientCentral(production=True)\n\n# This will create a ticket in the Managed Services workspace.\n# In this example custom_fields {\"id\": 17, \"values\": 0} refer to \"Security related\" -> \"No\"\n# Theses values can be found by following the following instructions: https://clientcentral.io/support/cc/kb/articles/1661-tickets-api-creating-tickets\nticket = cc.create_ticket(subject=\"New awesome subject\" ,\n description=\"this is an awesome ticket\",\n project_id=8,\n workspace_id=16,\n custom_fields_attributes=[{\n \"id\": 17,\n \"values\": 0\n }, {\n \"id\": 75,\n \"values\": 363\n }])\n\nticket.comment(\"

\" + tf.bold(\"I am BOLD\") + \"

\")\n\n# Get the ticket's creator\nprint(\"Ticket creator: \" + ticket.owner.name)\n\n# Get the ticket's status\nprint(\"Ticket status:\" + ticket.status.name)\n\n# Print the ticket's description\nprint(\"Ticket description: \" + ticket.description)\n\n# Add a user to watchers\nticket.add_user_watcher(14012) # 14012 refers to the user id in this case its \"Thomas Scholtz\"\n\n# Change the description of the ticket\nticket.description = \"New and improved ticket description\"\n\n# Finally after making all changes commit them.\nticket.commit()\n\nfor comment in ticket.comments:\n if comment.created_by_user:\n print(\"Comment from: \" + comment.created_by_user.name + \" says: \" + comment.comment)\n\n# Ticket events, change_events and comments are lazy loaded.\nfor change_event in ticket.change_events:\n if change_event.created_by_user:\n print(\"Change by: \" + str(change_event.created_by_user.name))\n for change in change_event.changes:\n print(\"Changed: \" + str(change.name) + \" from: \" + str(change.from_value) + \" to: \" + str(change.to_value))\n```\n\n# Example query\n```python\nfrom clientcentral.clientcentral import ClientCentral\nimport clientcentral.query as operators\n\n# Production 'false' will run on qa.cc\ncc = ClientCentral(production=True)\n\n# This will return a list of all tickets that are:\n# open,\n# in workspace with id 87,\n# created by the user with the email 'thomas@labs.epiuse.com',\n# has not been updated since 2019-02-20,\n# subject contains 'New awesome subject'\ntickets = cc.query_tickets().filter_by(\n operators.and_( operators.statement(\"status.open\"),\n operators.comparison(\"workspace_id\", \"=\", \"87\"),\n operators.comparison(\"created_by_user.email\", \"=\", \"'thomas@labs.epiuse.com'\"),\n operators.comparison(\"updated_at\", \"<\", \"'2019-02-20'\"),\n operators.comparison(\"subject\", \"CONTAINS\", \"'New awesome subject'\"))\n ).all()\n\nfor ticket in tickets:\n # Get the ticket's creator\n print(\"Ticket creator: \" + ticket.owner.name)\n\n # Get the ticket's status\n print(\"Ticket status:\" + ticket.status.name)\n\n # Print the ticket's description\n print(\"Ticket description: \" + ticket.description)\n\n # Ticket events, change_events and comments are lazy loaded.\n for comment in ticket.comments:\n if comment.created_by_user:\n print(\"Comment from: \" + comment.created_by_user.name +\n \" says: \" + comment.comment)\n for change_event in ticket.change_events:\n if change_event.created_by_user:\n print(\"Change by: \" + str(change_event.created_by_user.name))\n for change in change_event.changes:\n print(\"Changed: \" + str(change.name) + \" from: \" +\n str(change.from_value) + \" to: \" + str(change.to_value))\n\n\n```\n\n# Contributing\nFor this repository we are enforcing the use of `Commitizen`. Respective merge requests require to follow the format created from `Commitizen`. More info can be found at: http://commitizen.github.io/cz-cli/\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/EPI-USE-Labs/client-central-python-api", "keywords": "ClientCentral,Client,EPI-USE Labs,EPI-USE,Client-Central", "license": "", "maintainer": "", "maintainer_email": "", "name": "clientcentral", "package_url": "https://pypi.org/project/clientcentral/", "platform": "", "project_url": "https://pypi.org/project/clientcentral/", "project_urls": { "Homepage": "https://github.com/EPI-USE-Labs/client-central-python-api" }, "release_url": "https://pypi.org/project/clientcentral/8.2.0/", "requires_dist": [ "beautifulsoup4 (==4.8.0)", "typing (==3.7.4.1)", "aiohttp (==3.6.1)", "ujson (==1.35)" ], "requires_python": ">=3.6", "summary": "Client Central Python API.", "version": "8.2.0" }, "last_serial": 5970867, "releases": { "8.0.0": [ { "comment_text": "", "digests": { "md5": "3f41f732d72fb2d51dffbea03f05c378", "sha256": "8521a97f1027d6d4099b156bf52d3a9100f32077f21f89ab4c1273eb27563eb7" }, "downloads": -1, "filename": "clientcentral-8.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3f41f732d72fb2d51dffbea03f05c378", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 35425, "upload_time": "2019-09-11T13:31:02", "url": "https://files.pythonhosted.org/packages/2d/91/8b12160e0c539d88455505d68cd31e7fb000a424acb9160ef08b2b191e5a/clientcentral-8.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c12fd76cb9a25f1f1ce4fb997452582", "sha256": "3903a242036fb08be3c16fc0434002a605495d405a1d320050cf9a9b0826aef3" }, "downloads": -1, "filename": "clientcentral-8.0.0.tar.gz", "has_sig": false, "md5_digest": "8c12fd76cb9a25f1f1ce4fb997452582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17255, "upload_time": "2019-09-11T13:31:06", "url": "https://files.pythonhosted.org/packages/57/5d/a35b3aa1b2f0c59b547afea759c722e2d821cf5d89c5c9e5455870001356/clientcentral-8.0.0.tar.gz" } ], "8.0.1": [ { "comment_text": "", "digests": { "md5": "eab326d7faf0d686e33e98141de30f7e", "sha256": "38eecb0f3b86d6d1ec94159516cd2e9315fe432beb1cdfe06ec4a9a201818e57" }, "downloads": -1, "filename": "clientcentral-8.0.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "eab326d7faf0d686e33e98141de30f7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34754, "upload_time": "2019-09-16T09:45:53", "url": "https://files.pythonhosted.org/packages/3f/aa/791a14ea2d23b720b32e8e5cf247cd5e7cc078d344c8c993e765ffb4a423/clientcentral-8.0.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "9036a79737c24d0c2d7303c555c73f7b", "sha256": "5b4b6bc53eedcf01f91da241e4253e975183e0f2525526b66c3fde0678ead558" }, "downloads": -1, "filename": "clientcentral-8.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9036a79737c24d0c2d7303c555c73f7b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 35571, "upload_time": "2019-09-16T09:45:50", "url": "https://files.pythonhosted.org/packages/82/ee/56421f6332e12cd1201da1d0e1dfaac00241b8720bdc85e709ad349dd413/clientcentral-8.0.1-py2.py3-none-any.whl" } ], "8.1.0": [ { "comment_text": "", "digests": { "md5": "e8c5bca89ea90cbef13035d384317ba6", "sha256": "3b38804b9e5bbe75be40361dcce8d18185da10edd93c4ce2dbbaa56bde1d7cd1" }, "downloads": -1, "filename": "clientcentral-8.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e8c5bca89ea90cbef13035d384317ba6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 36383, "upload_time": "2019-09-26T09:05:55", "url": "https://files.pythonhosted.org/packages/66/bf/642ed640e6b3bc9bb89772e8f59ba1c85e7b9fe96724bfea612f57e16b94/clientcentral-8.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b154b7a8b9f2fd9db6ae43272b85e52", "sha256": "d164017486c8570a66b7c1b8ab3d4eb1c015f1902cac3e77bb55e3fd8b6fa67e" }, "downloads": -1, "filename": "clientcentral-8.1.0.tar.gz", "has_sig": false, "md5_digest": "5b154b7a8b9f2fd9db6ae43272b85e52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17833, "upload_time": "2019-09-26T08:52:17", "url": "https://files.pythonhosted.org/packages/dc/d6/77dff3d9f3c9acbd921a076cdfe3a6f11c3f8bae1092d9575fa296e209da/clientcentral-8.1.0.tar.gz" } ], "8.1.1": [ { "comment_text": "", "digests": { "md5": "14c3c7ba43ac2d6164450fc2413324a7", "sha256": "4438d79120afd150f66e5c953c15dd387318bcece9e22b368e318e8dc122da14" }, "downloads": -1, "filename": "clientcentral-8.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "14c3c7ba43ac2d6164450fc2413324a7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 36395, "upload_time": "2019-09-26T09:22:32", "url": "https://files.pythonhosted.org/packages/a5/99/74cb0470af801a162f1b24b2150624a637c0e4022eb77b500195170f38e2/clientcentral-8.1.1-py2.py3-none-any.whl" } ], "8.1.2": [ { "comment_text": "", "digests": { "md5": "74bfedbf03ab6828e00aa12a75037df9", "sha256": "41fd7be56c2d56f40008b0e7f53d5aa7496b9ed9f7e9ba362deec4f5cd7dcae0" }, "downloads": -1, "filename": "clientcentral-8.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "74bfedbf03ab6828e00aa12a75037df9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 36398, "upload_time": "2019-09-26T09:32:14", "url": "https://files.pythonhosted.org/packages/e1/77/0bf1823e539806fb7488da8e2f923ef9cc0087f96e3764cc3871852ae924/clientcentral-8.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ea3ffc098096e4bfef777d30ea0c207", "sha256": "2c0c6d86a8d49d4f3a6aa98469b1d6a876d9acfb5ab95b207d4a1e5a3c32272d" }, "downloads": -1, "filename": "clientcentral-8.1.2.tar.gz", "has_sig": false, "md5_digest": "0ea3ffc098096e4bfef777d30ea0c207", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17872, "upload_time": "2019-09-26T09:32:16", "url": "https://files.pythonhosted.org/packages/a1/af/6a82b7d9b2fb6f0a24c6a554c1ca7e0af39154d54f9216de540171914498/clientcentral-8.1.2.tar.gz" } ], "8.1.9": [ { "comment_text": "", "digests": { "md5": "6e481ba0af532c55d100a13e3cbd5407", "sha256": "8bceaaaaf7c59462e9680f6ef409b7325c575c1c2946d19dce61598aea54836a" }, "downloads": -1, "filename": "clientcentral-8.1.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6e481ba0af532c55d100a13e3cbd5407", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 36058, "upload_time": "2019-09-27T15:06:34", "url": "https://files.pythonhosted.org/packages/e9/9d/4bdb49d0194afd21a5bb3b695794d4b47746cf77867f2cc784d18ebb5421/clientcentral-8.1.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14c79c478584cf65632187e6d0651b2a", "sha256": "52e75cc67974f55229dd12077f96a6b541825b2f74c5228bdf5abfdb4a807957" }, "downloads": -1, "filename": "clientcentral-8.1.9.tar.gz", "has_sig": false, "md5_digest": "14c79c478584cf65632187e6d0651b2a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17782, "upload_time": "2019-09-27T15:06:38", "url": "https://files.pythonhosted.org/packages/48/5e/d7b54d54935066a1412b91a355515fbad4f3166de2c3023ce779eb7608a9/clientcentral-8.1.9.tar.gz" } ], "8.2.0": [ { "comment_text": "", "digests": { "md5": "a267f42f1877778551c240eb4a8dadd2", "sha256": "fd2efcd6ee45a3fadcd486d96ef5b35a5e4725047b812ac2496dcd5642375f00" }, "downloads": -1, "filename": "clientcentral-8.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a267f42f1877778551c240eb4a8dadd2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 36087, "upload_time": "2019-10-14T10:46:43", "url": "https://files.pythonhosted.org/packages/2f/28/baecc4040974d83050425554da1239127f6159846544204ecfc93b7a6785/clientcentral-8.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b0c94b42e6249d2823c49114edf18b7", "sha256": "8b01ecb258c864316459e76ff52b6327be032de3515e2d4515110c3a9ffe4170" }, "downloads": -1, "filename": "clientcentral-8.2.0.tar.gz", "has_sig": false, "md5_digest": "7b0c94b42e6249d2823c49114edf18b7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17771, "upload_time": "2019-10-14T10:46:45", "url": "https://files.pythonhosted.org/packages/fb/0a/ee05940d99b9be66b1f343476be172ca9974c255cac186a6efb25c6d1dc2/clientcentral-8.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a267f42f1877778551c240eb4a8dadd2", "sha256": "fd2efcd6ee45a3fadcd486d96ef5b35a5e4725047b812ac2496dcd5642375f00" }, "downloads": -1, "filename": "clientcentral-8.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a267f42f1877778551c240eb4a8dadd2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 36087, "upload_time": "2019-10-14T10:46:43", "url": "https://files.pythonhosted.org/packages/2f/28/baecc4040974d83050425554da1239127f6159846544204ecfc93b7a6785/clientcentral-8.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b0c94b42e6249d2823c49114edf18b7", "sha256": "8b01ecb258c864316459e76ff52b6327be032de3515e2d4515110c3a9ffe4170" }, "downloads": -1, "filename": "clientcentral-8.2.0.tar.gz", "has_sig": false, "md5_digest": "7b0c94b42e6249d2823c49114edf18b7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17771, "upload_time": "2019-10-14T10:46:45", "url": "https://files.pythonhosted.org/packages/fb/0a/ee05940d99b9be66b1f343476be172ca9974c255cac186a6efb25c6d1dc2/clientcentral-8.2.0.tar.gz" } ] }