HubSpot CRM Importer

Shinobu Kawano
Jul 7, 2018 · 3 min read

I wrote a tiny Python script for someone interested in importing CRM data into HubSpot.

HubSpot CRM Importer:
https://github.com/shinobukawano/hubspot-crm-importer

HubSpot offers a functionality of importing CRM data from CSV files. You can import contacts, companies, and deals by using it. However, it has one big limitation — you can not associate those objects when importing data. This is where HubSpot CRM Importer script shines. This script imports data from CSV files into your HubSpot portal with beautiful relationships. :)

Image for post
Image for post

Requirements

The following articles might be helpful if you have not installed Python 3+.

If you’re using Python 2.7.9 (or greater) or Python 3.4 (or greater), then PIP comes installed with Python by default.

Getting Started

  1. Clone the repository.
$ git clone https://github.com/shinobukawano/hubspot-crm-importer

2. Install Requests library.

$ pip install requests

3. Add your HubSpot API Key in main.py, line 15.

API_KEY = '246b....'

Example

You can run this script with sample import files from HubSpot Academy.

Open your terminal, and execute python main.py command. It loads those files from csv directory and creates contacts, companies, and deals data into your HubSpot portal.

Image for post
Image for post

How does the script relate objects?

company_id and contact_id columns in csv files is the secret of it. The script associates objects based on values of them.

Image for post
Image for post

You can also set the owner of objects using hubspot_owner_email column. It finds HubSpot user by given email address and assign it to objects.

Image for post
Image for post

Applying the script in the real environment

I assume you will need to edit some portion of the script to meet your real environment. You may want to add properties of objects or modify column names of CSV files, etc. Feel free to adjust the script. I hope this script become a good starting point for your migration.

Troubleshooting

If the script does not work properly, please confirm import.log which will be generated in the root directory of the project. You may find information about the issue.

License

This software is licensed under the MIT License.

HubSpot CRM Importer:
https://github.com/shinobukawano/hubspot-crm-importer

Shinobu Kawano

about Web Technology and Business.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store