Copper¶
Overview¶
Copper is a customer relationship management (CRM) platform to track individuals, companies and activity data. This Parsons class provides methods for extracting people, companies and actions.
Getting Your API Key
Sign into Copper
Click on
Settings(gear icon) and thenAPI KeysClick the
GENERATE API KEYbutton
Quickstart¶
To instantiate the Copper class, you can either store the Copper user email and
API key as environmental variables (COPPER_USER_EMAIL, COPPER_API_KEY)
or pass them in as arguments:
from parsons import Copper
copper = Copper()
from parsons import Copper
copper = Copper(user_email='me@myorg.com', api_key='MYAPIKEY')
You can then call various endpoints:
# This will unpack the people json as a dict of Parsons Tables.
people_tbls = copper.get_people()
# You can then save the tables as csvs
for k, v in people_tbls.items():
v.to_csv(f'{k}_copper.csv')
# Or you send the tables to a database
pg = Postgres()
for k, v in people_tbls.items():
v.to_postgres(f'copper.{k}', if_exists='drop')
# Get companies modified since a date, unix time.
# This will unpack the companies json as a dict of Parsons Tables.
company_tbls = copper.get_companies({'minimum_modified_date': 1599674523})
API¶
- class parsons.copper.copper.Copper(user_email=None, api_key=None)[source]¶
Instantiate Copper Class
- Parameters:
user_email – The email of the API user for Copper. Not required if
COPPER_USER_EMAILenv variable set.api_key – The Copper provided application key. Not required if
COPPER_API_KEYenv. variable set.
- Returns:
Copper Class
- get_people(filters=None, tidy=False)[source]¶
Get people
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices
tidy – boolean or int Optional; unpack list and dict columns as additional rows instead of columns If True: creates new table out of unpacked rows If ‘int’: adds rows to original table if max rows per key <= given number (so tidy=0 guarantees new table)
- Returns:
people
people_emails
people_phone_numbers
people_custom_fields
people_socials
people_websites
- Return type:
- get_companies(filters=None, tidy=False)[source]¶
Get companies
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices
tidy – boolean or int Optional; unpack list and dict columns as additional rows instead of columns If True: creates new table out of unpacked rows If ‘int’: adds rows to original table if max rows per key <= given number (so tidy=0 guarantees new table)
- Returns:
companies
companies_phone_numbers
companies_custom_fields
companies_socials
companies_websites
- Return type:
- get_activities(filters=None, tidy=False)[source]¶
Get activities
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices Optional; unpack list and dict columns as additional rows instead of columns If True: creates new table out of unpacked rows If ‘int’: adds rows to original table if max rows per key <= given number (so tidy=0 guarantees new table)
- Returns:
activities
- Return type:
- get_opportunities(filters=None, tidy=False)[source]¶
Get opportunities (i.e. donations)
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices Optional; unpack list and dict columns as additional rows instead of columns If True: creates new table out of unpacked rows If ‘int’: adds rows to original table if max rows per key <= given number (so tidy=0 guarantees new table)
- Returns:
opportunities
opportunities_custom_fields
- Return type:
- get_custom_fields()[source]¶
Get custom fields
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices
- Returns:
custom_fields
custom_fields_available
custom_fields_options
- Return type:
- get_activity_types()[source]¶
Get activity types
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices
- Returns:
activitiy_types
- Return type:
- get_contact_types()[source]¶
Get contact types
- Parameters:
filters – dict Optional; pass additional parameters to filter the records returned. See Copper documentation for choices
- Returns:
- Table
See Table for output options.