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.)
Metadata
Release files for nutshell 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nutshell-0.4.4.tar.gz | 7.2 kB | Without provenance | Details for nutshell-0.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nutshell-0.4.4-py3-none-any.whl | Python 3 | none | any | Details for nutshell-0.4.4-py3-none-any.whl |
Total release size: 15.1 kB
Release files / nutshell-0.4.4.tar.gz
| Download URL | nutshell-0.4.4.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
990ec6f5fc3f9a1b3fb2c43e4d9ab71094696f24623240e4548c2642ee1110f4
|
|
BLAKE2b-256 checksum How to use checksums |
0d721d82a5d91fe3680020765dd2beae9b1ad88662a425cd9b0bca380ea30d7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.5 Darwin/23.6.0
|
Release files / nutshell-0.4.4-py3-none-any.whl
| Download URL | nutshell-0.4.4-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d86f8f79ee675fa9391ccda680c8a586ee5f960867a296d3e403cd16fe9e1bef
|
|
BLAKE2b-256 checksum How to use checksums |
5cdfdf05a8b2e6e839fba663bae5c55260e74f9578971a785a6e1138f2529037
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.5 Darwin/23.6.0
|
Security for nutshell 0.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.