Python wrapper on Nutshell CRM JSON RPC API
Project description
Nushell API
This is a work-in-progress attempt at a pythonic API for Nutshell.
Installation
pip install nutshell
Nutshell access credentials should be stored in a .env file in the root directory or as environment variables. The following variables are required:
NUTSHELL_KEY=your_api_key
NUTSHELL_USERNAME=your_username
Usage
Pydantic dataclasses for supported API methods are available in the methods module.
import asyncio
from rich import print
from nutshell.methods import FindActivityTypes
from nutshell.nutshell_api import NutshellAPI
single_call = FindActivityTypes()
nut = NutshellAPI(single_call)
call_response = asyncio.run(nut.call_api())
for call in call_response:
print(call)
Results are returned as a list of tuples. The first element is the method instance, the second is the response.
(
FindActivityTypes(
api_method='findActivityTypes',
order_by='name',
order_direction='ASC',
limit=50,
page=1,
params={
'orderBy': 'name',
'orderDirection': 'ASC',
'limit': 50,
'page': 1
}
),
FindActivityTypesResult(
result=[
ActivityTypes(
stub=True,
id=1,
rev='1',
entity_type='Activity_Types',
name='Phone Call / Meeting'
),
ActivityTypes(
stub=True,
id=3,
rev='3',
entity_type='Activity_Types',
name='Email/Log'
),
]
)
)
All responses have a result
attribute that contains the data returned by the API. The data is returned as a list of
Pydantic models based on the API method invoked.
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
File details
Details for the file nutshell-0.2.2.tar.gz
.
File metadata
- Download URL: nutshell-0.2.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 469fb1dacad019b981bdb8a5c3e5c0a7592b954f7ac9a8e727996578ba817fcf |
|
MD5 | 5184d95e3012756cbac419116fd76257 |
|
BLAKE2b-256 | 9dab148a465d631b5816f8869a7ac4bdea1f1cd54b0920ad4180667765ca35cc |
File details
Details for the file nutshell-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: nutshell-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bda83d3cea7e2541b2d5a313ac4ca9dbb8a7ac5cd8b8860b2df1411a35d9270 |
|
MD5 | 997dc05a11aee1aeea3b631172be39ce |
|
BLAKE2b-256 | ce8cab3903c67512f82a3ee14ea9110396f92dca8a70feeb9263df4eb18bddfc |