A client library for Savannah CRM
Project description
Savannah CRM Client
This client library wraps the Savannah CRM API, making it easier to import community members and activity from your own Python code.
Usage
Connecting to an API Source
>>> from savannahcrm import SavannahAPISource
>>> source = SavannahAPISource(token='7fbd4b88-5af7-4acf-bc81-f1888cd8f1b2')
>>> print("Source: %s" % source)
Source: Test
>>> print("Source info: %s" % source.info)
Source info: {'community': 'InfluxDB', 'name': 'Test', 'icon_name': 'fab fa-twitter-square', 'first_import': None, 'last_import': '2021-04-20T14:20:12.440415', 'enabled': True}
Adding a Member
>>> new_member = source.add_member(
... origin_id='test-1',
... username='test_user_1',
... name='API Test User',
... email='api@test.com',
... tags=['api-test']
... )
>>> print("Member: %s" % new_member)
Member: {'origin_id': 'test-1', 'username': 'test_user_1', 'name': 'API Test User', 'email': 'api@test.com', 'avatar': None, 'tags': ['api-test']}
Adding a Converation
>>> convo_tstamp = datetime.datetime(2021, 4, 19, 13, 35, 00)
>>> new_convo = source.add_conversation(
... origin_id='test-convo-1',
... speaker='test-1',
... channel='API Test',
... timestamp=convo_tstamp,
... content='Testing savannah-client library for Python',
... location='https://docs.savannahhq.com/api/',
... tags=['api-test', 'python']
... )
>>> print("Conversation: %s" % new_convo)
Conversation: {'origin_id': 'test-convo-1', 'speaker': 'test-1', 'channel': 'API Test', 'timestamp': '2021-04-19T13:35:00', 'content': 'Testing savannah-client library for Python', 'location': 'https://docs.savannahhq.com/api/', 'participants': ['test-1'], 'tags': ['api-test', 'python']}
Adding a Contribution
>>> new_contrib = source.add_contribution(
... origin_id='test-convo-1',
... author='test-1',
... channel='API Test',
... contribution_type='Pull Request',
... timestamp=convo_tstamp,
... title='Built importer using the Savannah API',
... location='https://github.com/SavannahHQ/savannahcrm-client-python',
... tags=['api-test', 'python'],
... conversation='test-convo-1',
... )
>>> print("Contribution: %s" % new_contrib)
Contribution: {'origin_id': 'test-convo-1', 'author': 'test-1', 'contribution_type': 'Pull Request', 'channel': 'API Test', 'timestamp': '2021-04-19T13:35:00', 'title': 'Built importer using the Savannah API', 'location': 'https://github.com/SavannahHQ/savannahcrm-client-python', 'conversation': 'test-convo-1', 'tags': ['api-test', 'python']}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
savannahcrm-client-0.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for savannahcrm_client-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02bce8c4acd0f22977ea6d3a925454eceef06511eddd3f4905f8bc5d4c3390a6 |
|
MD5 | 06f6e50c170d1a7a657d393220f30f93 |
|
BLAKE2b-256 | 524f0b49abc173f5f749846bd76af48a0ed639a91d02547161c07ef772a81daf |