Skip to main content

Python Connector for HubSpot

Python Connector for HubSpot is a connectivity solution for accessing HubSpot from Python applications to read and update data. It fully implements the Python DB API 2.0 specification. The connector is distributed as a wheel package for Windows and Windows Server.

Standard SQL syntax

The connector fully supports the ANSI SQL standard and lets you execute SQL statements against your HubSpot data just like you would normally work with relational databases. Simple queries are directly converted to HubSpot API calls and executed on the HubSpot side. Complex queries are transformed into simpler queries, which are then converted to HubSpot API calls. The embedded SQL engine then processes the results in the local cache and applies advanced SQL features from the original complex query.

Connecting

To establish a connection to HubSpot, import the connector and authenticate using basic or OAuth 2.0 authentication.

Import the connector

First, import the HubSpot connector module:

import devart.hubspot as hubspot

Establish a connection

Connect to your HubSpot account using the connect() module method and obtain a connection object.

You can connect to HubSpot using API key, access token, or OAuth 2.0 authentication.

API key authentication

For API key authentication, provide your HubSpot API key:

my_connection = hubspot.connect(
    Authentication="APIKey",    APIKey="your_api_key"
)

Replace the example value with your actual API key.

Access token authentication

For access token authentication, provide your HubSpot access token:

my_connection = hubspot.connect(
    Authentication="PrivateApp",
    AccessToken="your_access_token"
)

Replace the example value with your actual access token.

OAuth 2.0 authentication

For OAuth 2.0 authentication, first obtain a refresh token, then use it to establish the connection:

response = devart.hubspot.signin()
my_connection = hubspot.connect(
    Authentication="OAuth",
    RefreshToken=response["Refresh Token"]
)

Replace the example values with your actual refresh token.

Querying data

Once connected to HubSpot, you can execute SQL queries to retrieve data from HubSpot.

Execute a query

Create a cursor object using the cursor() connection method.

my_cursor = my_connection.cursor()

Execute a SQL query using the execute() cursor method.

my_cursor.execute("SELECT * FROM employees")

Retrieve results using one of the fetch*() methods.

for row in my_cursor.fetchall():
    print(row)

Parameterized queries

You can use parameterized queries to pass variable values to your SQL statements. This allows you to reuse the same query with different data and helps to prevent SQL injection attacks.

Pass parameters as a list or tuple to the

execute()

method:

query = "SELECT Id, Name FROM Contact WHERE Name = ? AND Email = ?"
params = ["Jordan Sanders", "jordansanders@example.com"]
my_cursor.execute(query, params)
results = my_cursor.fetchall()
for row in results:
    print(row)

Each placeholder ? in the query is replaced with a corresponding value from the parameter list.

Ordering and activating the license

You can purchase a license for the connector on the ordering page:
https://www.devart.com/python/hubspot/ordering.html

To activate the license, follow the instructions in the documentation:
https://docs.devart.com/python/hubspot/activate-a-license.htm

What's new

Python Connector for HubSpot 1.4

  • Added support for Python 3.15

Metadata

Release files for devart-hubspot-connector 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for devart-hubspot-connector 1.4.0
File Actions
devart_hubspot_connector-1.4.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for devart_hubspot_connector-1.4.0-cp315-cp315-win_amd64.whl
devart_hubspot_connector-1.4.0-cp315-cp315-win32.whl CPython 3.15 CPython 3.15 Windows x86-32 Details for devart_hubspot_connector-1.4.0-cp315-cp315-win32.whl
devart_hubspot_connector-1.4.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for devart_hubspot_connector-1.4.0-cp314-cp314-win_amd64.whl
devart_hubspot_connector-1.4.0-cp314-cp314-win32.whl CPython 3.14 CPython 3.14 Windows x86-32 Details for devart_hubspot_connector-1.4.0-cp314-cp314-win32.whl
devart_hubspot_connector-1.4.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for devart_hubspot_connector-1.4.0-cp313-cp313-win_amd64.whl
devart_hubspot_connector-1.4.0-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details for devart_hubspot_connector-1.4.0-cp313-cp313-win32.whl
devart_hubspot_connector-1.4.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for devart_hubspot_connector-1.4.0-cp312-cp312-win_amd64.whl
devart_hubspot_connector-1.4.0-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details for devart_hubspot_connector-1.4.0-cp312-cp312-win32.whl
devart_hubspot_connector-1.4.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for devart_hubspot_connector-1.4.0-cp311-cp311-win_amd64.whl
devart_hubspot_connector-1.4.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for devart_hubspot_connector-1.4.0-cp311-cp311-win32.whl
devart_hubspot_connector-1.4.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for devart_hubspot_connector-1.4.0-cp310-cp310-win_amd64.whl
devart_hubspot_connector-1.4.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for devart_hubspot_connector-1.4.0-cp310-cp310-win32.whl

Total release size: 71.1 MB

Release files / devart_hubspot_connector-1.4.0-cp315-cp315-win_amd64.whl

Download URL devart_hubspot_connector-1.4.0-cp315-cp315-win_amd64.whl
Size 6.1 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
a345cbe382df55b31dc2273c63c8eac29b4266a282e05af152199959085de74f
BLAKE2b-256 checksum
How to use checksums
393b0922ac382e1df3b4866cd0a5921565127e6e76c09b970074caf87c24a810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp315-cp315-win32.whl

Download URL devart_hubspot_connector-1.4.0-cp315-cp315-win32.whl
Size 5.8 MB
Tags CPython 3.15 Windows x86-32
SHA-256 checksum
How to use checksums
41678d6269fa8777ef4602315d7bc161fc1d6d25d8794840554754b38b4a776d
BLAKE2b-256 checksum
How to use checksums
7259d28b45f4471812476798fa0dbd0ab5b4501b91b715dc56d049af169b7f78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp314-cp314-win_amd64.whl

Download URL devart_hubspot_connector-1.4.0-cp314-cp314-win_amd64.whl
Size 6.1 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
bdc354a72727e23ec40b03041437bbd525acb7f5d00a70e37dfcc903829450f5
BLAKE2b-256 checksum
How to use checksums
a3374228e3025b0d919071b077048798e435e0a543db8ff8410f069b35df309a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp314-cp314-win32.whl

Download URL devart_hubspot_connector-1.4.0-cp314-cp314-win32.whl
Size 5.8 MB
Tags CPython 3.14 Windows x86-32
SHA-256 checksum
How to use checksums
6976c07bf0dbb23c3f7252e32755ed1fcf804c6d9598872fdd66380138646f62
BLAKE2b-256 checksum
How to use checksums
01b7e3f0a94a81d441db676dcc4223bb2b3a9c6059e552580b20608fb4d31ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp313-cp313-win_amd64.whl

Download URL devart_hubspot_connector-1.4.0-cp313-cp313-win_amd64.whl
Size 6.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
082b4e2b948c9bd4a2336c558bf581085b1e56d6110fed91beb3d3fabf7afce5
BLAKE2b-256 checksum
How to use checksums
5765f655fe6f165581294edc82721458d45863113447965e85738b6b7dab2837
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp313-cp313-win32.whl

Download URL devart_hubspot_connector-1.4.0-cp313-cp313-win32.whl
Size 5.8 MB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
bc00aef4df92646590681d49cca88da92df1d931f6ed425427b821076d47c665
BLAKE2b-256 checksum
How to use checksums
0e5087867fbd5925103c0fa803f0a2ec0356493cbdb470dba1546b87dd30e0d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp312-cp312-win_amd64.whl

Download URL devart_hubspot_connector-1.4.0-cp312-cp312-win_amd64.whl
Size 6.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
de892d01b114d64dda815286bdd2deb0471f73faa2200efe060a8f8fd50f052e
BLAKE2b-256 checksum
How to use checksums
5e594e14a015e03d5c3a419e7a64f4ea2ff062b1d063b3eefc62c07beebc35ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp312-cp312-win32.whl

Download URL devart_hubspot_connector-1.4.0-cp312-cp312-win32.whl
Size 5.8 MB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
885525eb35ae35b49a23240e6e6d5a50e6cc7870c65181fc521b6712e714d6c5
BLAKE2b-256 checksum
How to use checksums
de735460c47a9627ed64fd201d3a959d7cb4931e1ebf30653a74e34b603eec60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp311-cp311-win_amd64.whl

Download URL devart_hubspot_connector-1.4.0-cp311-cp311-win_amd64.whl
Size 6.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
d8b1ca77fd5b8d29e0596347a60bf4d001f215fe58ca3f93f34e60f07d60718d
BLAKE2b-256 checksum
How to use checksums
4e3a01bd96192c2f698c50c358ec146ac2e7b228284010e226598d0b3004e626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp311-cp311-win32.whl

Download URL devart_hubspot_connector-1.4.0-cp311-cp311-win32.whl
Size 5.8 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
ff377ed85fab35458bcb0401e3a67f0aad94e6dce545372ad60eb4dc76aa2578
BLAKE2b-256 checksum
How to use checksums
08f6337c83407777f9fe9e4e7f75c2f4750f279ec9b6f0ff329c888e4075d8d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp310-cp310-win_amd64.whl

Download URL devart_hubspot_connector-1.4.0-cp310-cp310-win_amd64.whl
Size 6.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
ac8d729c94ab03bf277d33b21b7a3ee6578845f8eaf7447661983307147c7156
BLAKE2b-256 checksum
How to use checksums
b64c84ec58d0b62220a0994791aa276fd9a1e8a26daed0d968a2cd2ca2472d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_hubspot_connector-1.4.0-cp310-cp310-win32.whl

Download URL devart_hubspot_connector-1.4.0-cp310-cp310-win32.whl
Size 5.8 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
a4276709131aa9378436e85dcad7b00a311e843a6fbdaafcc8b7ffc69b1e97cc
BLAKE2b-256 checksum
How to use checksums
47da45e62c7d35d39b7d4efa372cde8538c796a03f11d0f64f10a014e8f63464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Security for devart-hubspot-connector 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page