Package: hubspot-python
hubspot-pythonHubSpot API wrapper written in Python.Installingpip install hubspot-pythonRequirements- requestsUsageClient instantiationfrom hubspot.client import Client
client = Client(APP_ID, HAPIKEY, CLIENT_ID, CLIENT_SECRET)CompaniesGet all companiesresponse = client.companies.get_companies(data)Create a Companydata = {
    "name": "A company name",
    "description": "A company description"
}
response = client.companies.create_company(data)Delete a Companyresponse = client.companies.delete_company(COMPANY_ID)Get Recently Created Companiesresponse = client.companies.get_recently_created_companies()Get a Companyresponse = client.companies.get_company(COMPANY_ID)Contact ListsGet contact listsresponse = client.contact_lists.get_contact_lists()Create a new contact listdata = {
    "name": "tweeters",
    "dynamic": true,
    "portalId": 62515,
    "filters": 
    [
        [{
            "operator": "EQ",
            "value": "@hubspot",
            "property": "twitterhandle",
            "type": "string"
        }]
    ]
}
response = client.contact_lists.create_contact_list(data)Delete a contact listresponse = client.contact_lists.delete_contact_list(CONTACT_LIST_ID)Get recently added contacts from a listresponse = client.contact_lists.get_recently_added_contacts_in_a_list()Get a contact list by its unique IDresponse = client.contact_lists.get_contact_list(CONTACT_LIST_ID)Add existing contacts to a listdata = {
  "vids": [
    3057124,
	5524274
  ],
  "emails": [
    "testingapis@hubspot.com"
  ]
}
response = client.contact_lists.add_contact_to_list(CONTACT_LIST_ID, data)ContactsGet all contactsresponse = client.contacts.get_contacts()Create a new contactdata = {
    "email": "testingapis@hubspot.com",
    "firstname": "Adrian",
    "lastname": "Mott",
    "website": "http://hubspot.com",
    "company": "HubSpot",
    "phone": "555-122-2323",
    "address": "25 First Street",
    "city": "Cambridge",
    "state": "MA",
    "zip": "02139",
}
response = client.contacts.create_contact(data)Delete a contactresponse = client.contacts.delete_contact(CONTACT_ID)Get recently created contactsresponse = client.contacts.get_recently_created_contacts()Get a contact list by its unique IDresponse = client.contacts.get_contact(CONTACT_ID)DealsGet all dealsresponse = client.deals.get_deals()Create a Dealdata = {
    "dealname": "Tim's Newer Deal",
    "dealstage": "appointmentscheduled",
    "pipeline": "default",
    "hubspot_owner_id": "24",
    "closedate": 1409443200000,
    "amount": "60000",
    "dealtype": "newbusiness",
}
response = client.deals.create_deal(data)Delete a Dealresponse = client.deals.delete_deal(DEAL_ID)Get Recently Created Dealsresponse = client.deals.get_recently_created_deals()Get a contact list by its unique IDresponse = client.deals.get_deal(DEAL_ID)Fields (Properties)Get all fieldsresponse = client.fields.get_fields(MODULE)IntegrationsGet all fieldsresponse = client.integrations.get_account_details()Get all fieldsresponse = client.integrations.get_daily_api_usage()WebhooksViewing Settingsresponse = client.webhooks.get_settings()Updating Settingsdata = {
    "webhookUrl": "https://testing.com/webhook-modified", 
    "maxConcurrentRequests": 25
}

response = client.webhooks.update_settings(data)Get Subscriptionsresponse = client.webhooks.get_subscriptions()Create a New Subscriptiondata = { 
    "subscriptionDetails" : {
        "subscriptionType" : "company.propertyChange", 
        "propertyName" : "companyname" 
    }, 
    "enabled": False
}

response = client.webhooks.create_subscription(data)Update a Subscriptiondata = { 
    "enabled": False
}

response = client.webhooks.create_subscription(SUBSCRIPTION_ID, data)Delete a Subscriptionresponse = client.webhooks.delete_subscription(SUBSCRIPTION_ID)WorkflowsGet workflowsresponse = client.workflows.get_workflows()Get workflowresponse = client.workflows.get_workflow(WORKFLOW_ID)Create a workflowdata = {
    "name": "Test Workflow",
    "type": "DRIP_DELAY",
    "onlyEnrollsManually": true,
    "actions": [
        {
            "type": "DELAY",
            "delayMillis": 3600000
        },
        {
            "newValue": "HubSpot",
            "propertyName": "company",
            "type": "SET_CONTACT_PROPERTY"
        },
        {
            "type": "WEBHOOK",
            "url": "https://www.myintegration.com/webhook.php",
            "method": "POST",
            "authCreds": {
                "user": "user",
                "password": "password"
            }
        }
    ]
}
response = client.workflows.create_workflow(data)Delete a Dealresponse = client.workflows.delete_workflow(WORKFLOW_ID)Enroll a contact into a workflowresponse = client.workflows.enroll_a_contact_into_workflow(WORKFLOW_ID, EMAIL)Unenroll a contact from a workflowresponse = client.workflows.unenroll_a_contact_into_workflow(WORKFLOW_ID, EMAIL)