Skip to main content

a fun project

Project description

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)

import cu_api.companies as companies

companies.set_headers(os.environ['MY_COPPER_KEY'],'myemail@email.com')

SunnyStates = companies.Query SunnyStates['state'] = ['CA','FL','AZ','TX'] SunnyStates['Amenities'] = ['Pool','Beach','Hot tub'] SunnyStates.outputs = ['Account Manager','Lifetime Spend']

companies.search(SunnyStates)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cu_api-0.0.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cu_api-0.0.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file cu_api-0.0.1.tar.gz.

File metadata

  • Download URL: cu_api-0.0.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for cu_api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 717838ec5a5ec7c5254b2a7d04f25a8cc0ed9702384aa2c4da2a7b4de27fe6fb
MD5 7dcd0f0abcc2fc8b29c0ab04f83e2342
BLAKE2b-256 6d6ca8a653bbd70451e8d170297b8e3f8e216bdfb41414b1f3f507f708481fff

See more details on using hashes here.

File details

Details for the file cu_api-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cu_api-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for cu_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19ce335bc61227d9a0e4e9f5a467a77eb3e3f1862702aa6021dc8b8646e4618d
MD5 013de9dab7c32e64fd5f80526a116bde
BLAKE2b-256 a211b7bb04199035d17f8d9ea52d5d32cfba500191a35e1671ff4e7924eded83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page