Python wrapper on the Nutshell CRM JSON RPC API
Project description
Nutshell API
This is a work-in-progress attempt at a pythonic API for querying the Nutshell CRM API. The bulk of the methods only read data, except a few methods for editing activities.
Installation
pip install nutshell
Usage
- Initialize the API instance with your credentials
- Create an instance of the method(s) you want to call
- Pass a single method instance, or a collection of methods to the
api_callsproperty of the API class - Execute the method calls on API with the
call_api()method- If a single method is passed to the API instance, the result will be a single response object
- If a collection of methods is passed, the result will be a list of response objects
- aiohttp is used to make the API calls asynchronous
import os
from rich import print
import nutshell
from nutshell import methods
find_activities = methods.FindActivityTypes()
ns = nutshell.NutshellAPI(os.getenv("NUTSHELL_USERNAME"), password=os.getenv("NUTSHELL_KEY"))
ns.api_calls = find_activities
activity_types = ns.call_api()
print(activity_types)
Each API call will have a corresponding response object with a result value that contains the response from the API.
FindActivityTypesResult(
result=[
ActivityType(
stub=True,
id=1,
rev='1',
entity_type='Activity_Types',
name='Phone Call / Meeting'
),
ActivityType(
stub=True,
id=2,
rev='7',
entity_type='Activity_Types',
name='Quotes Sent'
),
ActivityType(
stub=True,
id=3,
rev='4',
entity_type='Activity_Types',
name='New Introductions'
),
ActivityType(
stub=True,
id=103,
rev='1',
entity_type='Activity_Types',
name='Elevated Conversations / Leader Intros'
)
]
)
TODO
- Gracefully handle errors on method queries
- Convenience methods for common queries (Users, Leads, etc.)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nutshell-0.4.4.tar.gz.
File metadata
- Download URL: nutshell-0.4.4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.5 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
990ec6f5fc3f9a1b3fb2c43e4d9ab71094696f24623240e4548c2642ee1110f4
|
|
| MD5 |
06d6e45aa557d27c2f46f3ab8d91530e
|
|
| BLAKE2b-256 |
0d721d82a5d91fe3680020765dd2beae9b1ad88662a425cd9b0bca380ea30d7f
|
File details
Details for the file nutshell-0.4.4-py3-none-any.whl.
File metadata
- Download URL: nutshell-0.4.4-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.5 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d86f8f79ee675fa9391ccda680c8a586ee5f960867a296d3e403cd16fe9e1bef
|
|
| MD5 |
6b69f4e527edac9646aeddcb2fee623f
|
|
| BLAKE2b-256 |
5cdfdf05a8b2e6e839fba663bae5c55260e74f9578971a785a6e1138f2529037
|