Python client for the ConvertKit API
Project description
ConvertKit Python Client
A Python client for the ConvertKit API.
Installation
pip install convertkit-py
Configuration
Copy the sample environment file:
cp .env-sample .env
Edit .env with your ConvertKit credentials:
CONVERTKIT_API_KEY=your_api_key_here
CONVERTKIT_API_SECRET=your_secret_key_here
CONVERTKIT_FORM_NAME=your_form_name_here
Usage
from convertkit import ConvertKit
from dotenv import load_dotenv
import os
# Load environment variables
load_dotenv()
# Initialize the client
kit = ConvertKit(
api_key=os.getenv('CONVERTKIT_API_KEY'),
api_secret=os.getenv('CONVERTKIT_API_SECRET'),
form_name=os.getenv('CONVERTKIT_FORM_NAME')
)
# Create a subscriber
subscriber_data = {
'email': 'example@example.com',
'fields': {'first_name': 'John'},
'tags': ['tag1', 'tag2']
}
kit.create_subscriber_with_fields_and_tags(subscriber_data)
Features
- Manage subscribers
- Handle custom fields
- Manage tags
- Work with forms
- Full API coverage
Development
Setup
- Clone the repository
- Install development dependencies:
pip install -e ".[dev]" - Install test dependencies:
pip install pytest python-dotenv
Running Tests
- Create a
.envfile in the project root:
KIT_API_KEY=your_api_key_here
KIT_API_SECRET=your_secret_here
- Run tests:
pytest tests -v
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
convertkit_py-0.1.0.tar.gz
(7.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file convertkit_py-0.1.0.tar.gz.
File metadata
- Download URL: convertkit_py-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.66.5 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5d49481b4f7fceb26f74111c4553878181f424bc01760bebb985536ed0fab58
|
|
| MD5 |
6a794b4ab61dd269c43b99af6bea90f9
|
|
| BLAKE2b-256 |
e3e2a0124b7159e02b8ff26f44aca954a7e8496a78fa73b303d46cc81fe873e8
|
File details
Details for the file convertkit_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: convertkit_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.66.5 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
345c95f2141292f3f3b42382b4c06721e1fe0501bf4ef7b2f8936befbb6d178f
|
|
| MD5 |
a8a337a4eb57f4a85ecdfa841d1fc5d5
|
|
| BLAKE2b-256 |
d3790a2f31a908014621fd975a35e9d451d46167b8204ffc8758b5359590efa6
|