Skip to content

adinanp/cherwell_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cherwell

Cherwell client for python3 applications

PyPI version Updates

Usage

Installation

Install with:

pip install cherwell

Or, if you're using a development version cloned from this repository:

python path-to-where-you-cloned-cherwell/setup.py install

Quickstart

First, initialize a cherwell client instance

from cherwell.client import CherwellClient


cherwell_client = CherwellClient('<YOUR_CHERWELL_SERVER_ADDRESS>')

And then, request an authentication token to use in the other requests

token = cherwell_client.authenticate(
   gt=<YOUR_GRANT_TYPE>,
   cid=<YOUR_CLIENT_ID>,
   user=<YOUT_USERNAME>,
   pwd=<YOUR_PASSWORD>
)

With a token, you can for example create a business object.

Before, Given the cherwell API format, let's create a valid business object

from cherwell.models import BusinessObject, BusinessObjectFields


data = BusinessObject('FakeBusObjectId')
data.fields = [
    BusinessObjectFields(
        fieldId='FakeFieldid',
        name='FakeFieldName',
        value='FakeFieldValue',
        dirty=True,
    ),
    BusinessObjectFields(
        fieldId='FakeFieldid2',
        name='FakeFieldName2',
        value='FakeFieldValue2',
        dirty=True,
    ),
]

Now, just perform

bo = cherwell_client.save_business_object(token=<YOUR_TOKEN>, data=data)

For create/save your busines object

Running tests

python -m unittest tests.test_client

Contributing

This client was made to meet a specific need of my daily life. Obviously this is very simple and does not include 100% of what the cherwell API offers.

Pull requests are welcome, as long as they follow the standards adopted and contemplate unit tests

About

Cherwell client for python3 applications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages