connectpyse


Nameconnectpyse JSON
Version 0.6.0.5 PyPI version JSON
download
home_pagehttps://github.com/markciecior/ConnectPyse
SummaryA ConnectWise API tool for the rest of us.
upload_time2024-01-26 03:50:58
maintainer
docs_urlNone
authorJoshua M Smith (original), Mark Ciecior (forked), @wesgann
requires_python
licenseMIT
keywords connectwise rest api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ConnectPyse
ConnectWise (Manage) REST API client written in Python 3.x
The original project was created by Joshua M. Smith.  This forked version was started by Mark Ciecior.

ConnectWise RESTful API Client
--------------------------------

Following the layout style of the official SDKs from CW team. Classes and their API counter part classes are under
their appropriate sections. Import the API class(es) you want to leverage and the model classes are imported with them.

## Setup (old way)
1. Copy your_api.json to new my_api.json file and update with your API key and clientId details

## Setup (new way)
1. Create two variables which are passed to the constructor of the API classes.
2. URL = 'https://connectwise.mycompany.com/v4_6_release/apis/3.0'
3. AUTH = {'Authorization': 'Basic Wmdlasdkjfeklamwekf=', 'clientId': 'myClientIdKey'}

## Usage
1. Import the sections you'll be using
2. Create an object from API Class
3. Leverage member methods to access features

### Paging

    >>> from connectpyse.sales import opportunity_api
    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)
    >>> o.pageSize = 27
    >>> o.get_opportunities()

### Filtering

    >>> from connectpyse.sales import opportunity_api
    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)
    >>> o.conditions = 'name="My Opportunity"'
    >>> o.get_opportunities()

### Filtering on sub-attributes (use '/')

    >>> from connectpyse.sales import opportunity_api
    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)
    >>> o.conditions = 'company/id=19297'
    >>> result = o.get_opportunities()
    >>> for i in result:
    >>>   print(i.company['id'])

### To upload a document to an opportunity:

    >>> from connectpyse.system import document_api
    >>> from connectpyse.sales import opportunity_api
    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)
    >>> d = document_api.DocumentAPI(url=URL, auth=AUTH)

    >>> a_opp = o.get_opportunity_by_id(1234)
    >>> f = os.path.join(os.path.curdir, 'local_info.txt')
    >>> a_document = d.create_document(o, 'Newly Uploaded Document', 'server_info.txt', open(f, 'rb'))
    >>> print(a_document.title)

### To retrieve the documents attached to an opportunity:

    >>> from connectpyse.system import document_api
    >>> from connectpyse.sales import opportunity_api
    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)
    >>> d = document_api.DocumentAPI(url=URL, auth=AUTH)

    >>> a_opp = o.get_opportunity_by_id(1234)
    >>> myDocs = d.get_documents(a_pp)
    >>> for doc in myDocs:
    >>>   print(doc.title)
    >>> 

### For example to get a Member's office phone number you would:

    >>> from connectpyse.system import members_api
    >>> m = members_api.MembersAPI() #Assuming the my_api.json file has been updated
    -or-
    >>> from connectpyse.system import members_api
    >>> m = members_api.MembersAPI(url=URL, auth=AUTH) #No my_api.json file necessary

    >>> a_member = m.get_member_by_id(123)
    >>> print(a_member.officePhone)
    
### For example to find the name of all activities related to a particular opportunity you would:

    >>> from connectpyse.sales import activity_api
    >>> myAct = activity_api.ActivityAPI() #Assuming the my_api.json file has been updated
    -or-
    >>> from connectpyse.sales import activity_api
    >>> myAct = activity_api.ActivityAPI(url=URL, auth=AUTH) #No my_api.json file necessary

    >>> myAct.conditions = 'opportunity/id=1250'
    >>> allActivities = myAct.get_activities()
    >>> for oneAct in allActivities:
    >>>   print(oneAct.name)

### For example to find all line items of a parent purchase order:

    >>> from connectpyse.procurement import purchase_order_line_item_api
    >>> lineItems = purchase_order_line_item_api.PurchaseOrderLineItemAPI(url=URL,auth=AUTH,parent=1919)
    >>> myItems = lineItems.get_purchase_order_line_items()
    
### For example to update a ticket note:

    >>> from connectpyse.service import ticket_notes_api, ticket_note 
    >>> ticket_notes = ticket_notes_api.TicketNotesAPI(url=URL, auth=AUTH, ticket_id=TICKET_ID)
    >>> note = ticket_note.TicketNote({"text":"testing ticket note update.. ", "detailDescriptionFlag": True})
    >>> ticket_notes.create_ticket_note(note)

### For example to update multiple fields on a ticket:

    >>> from connectpyse.service import tickets_api 
    >>> api = tickets_api.TicketsAPI(url=URL, auth=AUTH)
    >>> mychanges = {"summary": "update multiple keys", "budgetHours": .50}
    >>> ticket = api.update_ticket_multiple_keys(ticketId, mychanges)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/markciecior/ConnectPyse",
    "name": "connectpyse",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "connectwise rest api",
    "author": "Joshua M Smith (original), Mark Ciecior (forked), @wesgann",
    "author_email": "saether@gmail.com (original), mark@markciecior.com (forked)",
    "download_url": "https://files.pythonhosted.org/packages/e8/98/0f9abbf524f0c3c5cb36ff175a3922afe05e32019929286c416a6e0f2de7/connectpyse-0.6.0.5.tar.gz",
    "platform": null,
    "description": "# ConnectPyse\nConnectWise (Manage) REST API client written in Python 3.x\nThe original project was created by Joshua M. Smith.  This forked version was started by Mark Ciecior.\n\nConnectWise RESTful API Client\n--------------------------------\n\nFollowing the layout style of the official SDKs from CW team. Classes and their API counter part classes are under\ntheir appropriate sections. Import the API class(es) you want to leverage and the model classes are imported with them.\n\n## Setup (old way)\n1. Copy your_api.json to new my_api.json file and update with your API key and clientId details\n\n## Setup (new way)\n1. Create two variables which are passed to the constructor of the API classes.\n2. URL = 'https://connectwise.mycompany.com/v4_6_release/apis/3.0'\n3. AUTH = {'Authorization': 'Basic Wmdlasdkjfeklamwekf=', 'clientId': 'myClientIdKey'}\n\n## Usage\n1. Import the sections you'll be using\n2. Create an object from API Class\n3. Leverage member methods to access features\n\n### Paging\n\n    >>> from connectpyse.sales import opportunity_api\n    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)\n    >>> o.pageSize = 27\n    >>> o.get_opportunities()\n\n### Filtering\n\n    >>> from connectpyse.sales import opportunity_api\n    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)\n    >>> o.conditions = 'name=\"My Opportunity\"'\n    >>> o.get_opportunities()\n\n### Filtering on sub-attributes (use '/')\n\n    >>> from connectpyse.sales import opportunity_api\n    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)\n    >>> o.conditions = 'company/id=19297'\n    >>> result = o.get_opportunities()\n    >>> for i in result:\n    >>>   print(i.company['id'])\n\n### To upload a document to an opportunity:\n\n    >>> from connectpyse.system import document_api\n    >>> from connectpyse.sales import opportunity_api\n    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)\n    >>> d = document_api.DocumentAPI(url=URL, auth=AUTH)\n\n    >>> a_opp = o.get_opportunity_by_id(1234)\n    >>> f = os.path.join(os.path.curdir, 'local_info.txt')\n    >>> a_document = d.create_document(o, 'Newly Uploaded Document', 'server_info.txt', open(f, 'rb'))\n    >>> print(a_document.title)\n\n### To retrieve the documents attached to an opportunity:\n\n    >>> from connectpyse.system import document_api\n    >>> from connectpyse.sales import opportunity_api\n    >>> o = opportunity_api.OpportunityAPI(url=URL, auth=AUTH)\n    >>> d = document_api.DocumentAPI(url=URL, auth=AUTH)\n\n    >>> a_opp = o.get_opportunity_by_id(1234)\n    >>> myDocs = d.get_documents(a_pp)\n    >>> for doc in myDocs:\n    >>>   print(doc.title)\n    >>> \n\n### For example to get a Member's office phone number you would:\n\n    >>> from connectpyse.system import members_api\n    >>> m = members_api.MembersAPI() #Assuming the my_api.json file has been updated\n    -or-\n    >>> from connectpyse.system import members_api\n    >>> m = members_api.MembersAPI(url=URL, auth=AUTH) #No my_api.json file necessary\n\n    >>> a_member = m.get_member_by_id(123)\n    >>> print(a_member.officePhone)\n    \n### For example to find the name of all activities related to a particular opportunity you would:\n\n    >>> from connectpyse.sales import activity_api\n    >>> myAct = activity_api.ActivityAPI() #Assuming the my_api.json file has been updated\n    -or-\n    >>> from connectpyse.sales import activity_api\n    >>> myAct = activity_api.ActivityAPI(url=URL, auth=AUTH) #No my_api.json file necessary\n\n    >>> myAct.conditions = 'opportunity/id=1250'\n    >>> allActivities = myAct.get_activities()\n    >>> for oneAct in allActivities:\n    >>>   print(oneAct.name)\n\n### For example to find all line items of a parent purchase order:\n\n    >>> from connectpyse.procurement import purchase_order_line_item_api\n    >>> lineItems = purchase_order_line_item_api.PurchaseOrderLineItemAPI(url=URL,auth=AUTH,parent=1919)\n    >>> myItems = lineItems.get_purchase_order_line_items()\n    \n### For example to update a ticket note:\n\n    >>> from connectpyse.service import ticket_notes_api, ticket_note \n    >>> ticket_notes = ticket_notes_api.TicketNotesAPI(url=URL, auth=AUTH, ticket_id=TICKET_ID)\n    >>> note = ticket_note.TicketNote({\"text\":\"testing ticket note update.. \", \"detailDescriptionFlag\": True})\n    >>> ticket_notes.create_ticket_note(note)\n\n### For example to update multiple fields on a ticket:\n\n    >>> from connectpyse.service import tickets_api \n    >>> api = tickets_api.TicketsAPI(url=URL, auth=AUTH)\n    >>> mychanges = {\"summary\": \"update multiple keys\", \"budgetHours\": .50}\n    >>> ticket = api.update_ticket_multiple_keys(ticketId, mychanges)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A ConnectWise API tool for the rest of us.",
    "version": "0.6.0.5",
    "project_urls": {
        "Homepage": "https://github.com/markciecior/ConnectPyse"
    },
    "split_keywords": [
        "connectwise",
        "rest",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0c379b3baa15047b800b37e9213bd03b2dfb87687f4968b413f81330e730f87",
                "md5": "b1f1e747b8dfd4cfacd07ed932d0f1ff",
                "sha256": "203c683ea8d99c65750aae9e3ed3a10d7869e04bf970f6a12708a807eb653583"
            },
            "downloads": -1,
            "filename": "connectpyse-0.6.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1f1e747b8dfd4cfacd07ed932d0f1ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 102280,
            "upload_time": "2024-01-26T03:50:53",
            "upload_time_iso_8601": "2024-01-26T03:50:53.966537Z",
            "url": "https://files.pythonhosted.org/packages/e0/c3/79b3baa15047b800b37e9213bd03b2dfb87687f4968b413f81330e730f87/connectpyse-0.6.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8980f9abbf524f0c3c5cb36ff175a3922afe05e32019929286c416a6e0f2de7",
                "md5": "426892fda98f80ecbeae00d1109cd15c",
                "sha256": "cb06f52e0b876f674c267f238fcd565b7e843593065d95c19635721ccf7b91e7"
            },
            "downloads": -1,
            "filename": "connectpyse-0.6.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "426892fda98f80ecbeae00d1109cd15c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 36168,
            "upload_time": "2024-01-26T03:50:58",
            "upload_time_iso_8601": "2024-01-26T03:50:58.974269Z",
            "url": "https://files.pythonhosted.org/packages/e8/98/0f9abbf524f0c3c5cb36ff175a3922afe05e32019929286c416a6e0f2de7/connectpyse-0.6.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-26 03:50:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "markciecior",
    "github_project": "ConnectPyse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "connectpyse"
}
        
Elapsed time: 0.17989s