CU API
I use Copper's API a lot for work, so a module of functions to work with in in Python. This is my attempt to turn these functions into a package that can be used by others.
Installation
If you are already in a Notebook, you can still the package to your environment with python:
!pip install cu_api
This package is designed to be a user friendly wrapper for the Copper CRM API to make interacting witth and pulling data easier.
Or install the package to your environment in the command line:
Install
You can install the cu_api package through PyPI:
pip install cu_api
Queries and Searching
To get most information from the Copper API, you need to search for it. You can define what companies, people, opportunities, etc. you are interested in by specifying various filters. These can be values in Custom Fields that you defined, or standard fields on each record type.
This package makes this easier uses a Query object to hold the various filters you would like to use.
Since, I work in Advertising. Let's assume that I would like to pull the information for all Advertisers in the CRM. We can first create a new query:
from cu_api import Query
Advertisers = Query()
Then we can add a filter to search for companies that have the "Live" value in the "Campaign Status" field:
Advertisers['Campaign Satus'] = 'Live'
## Or, if you know the id of the custom field:
Advertisers[2938821] = 'Live'
We can also add other filters to check only get Advertisers in California and from a specific sales person:
Advertisers['state'] = 'CA'
Advertisers['owner'] = 'Jim Halpert'
Your Advertisers query can then used with the search function to get data from Copper.
How to use
Start by importing all the modules you’ll need for your project. The
cuapi_wrapper package is broken down into seperate modules for working
with companies, tasks, opportunities, users, etc.
For example, if we wanted to look at companies in copper, we should start by importing the copper_crm.companies module. We can then search these companies for those who are in California:
from cu_api import search
df = search.companies(Advertisers)
Release files for cu-api 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cu_api-0.0.3.tar.gz | 19.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cu_api-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.3 kB
Release files / cu_api-0.0.3.tar.gz
| Download URL | cu_api-0.0.3.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a888603e3a4a1b67e349064dcebb9c487adb11913e458b17dede4f5bbe192bd6
|
|
BLAKE2b-256 checksum How to use checksums |
2090a951bc7edca7d5380aaeb5159fc9bafed9ed5839aa7146a1fa9401c4905d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|
Release files / cu_api-0.0.3-py3-none-any.whl
| Download URL | cu_api-0.0.3-py3-none-any.whl |
|---|---|
| Size | 20.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25c0b33592f9ac627155d1a08efe94363e0a7e34ef3b10a4ddc7f11ea886cc3b
|
|
BLAKE2b-256 checksum How to use checksums |
dbb804427b806f3d0722b6634e2f943bf3d0083e71d751259abf76ffdab13b5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|