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. It does not yet support modifying data in a Nutshell instance.
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_calls
property 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
nutshell-0.4.1.tar.gz
(8.0 kB
view details)
Built Distribution
File details
Details for the file nutshell-0.4.1.tar.gz
.
File metadata
- Download URL: nutshell-0.4.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d92d6fa82d6613c6ace8f3c622916b00104bc29fa2537b57d221018e28163e8 |
|
MD5 | e69f08d04357a11fe4930d2fb2c867d4 |
|
BLAKE2b-256 | 77b3a5f99e6e582f79c0bc8061a932ce0a4372b575ca59b62ba3dc92da970411 |
File details
Details for the file nutshell-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: nutshell-0.4.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fae2ba27fdead6bd191372e19d44088431504ea0dc70db81c2ade51f89fcb483 |
|
MD5 | 69566de4b63ecd1239a2ba8a661432b5 |
|
BLAKE2b-256 | d4c6c1959fea056ce92bc44f596fc72536dce8e1b11e6d90dec88cdc94e83d7d |