Skip to main content

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

  1. Clone the repository
  2. Install development dependencies: pip install -e ".[dev]"
  3. Install test dependencies: pip install pytest python-dotenv

Running Tests

  1. Create a .env file in the project root:
KIT_API_KEY=your_api_key_here
KIT_API_SECRET=your_secret_here
  1. Run tests:
pytest tests -v

License

MIT License

Project details


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.3.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

convertkit_py-0.3.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file convertkit_py-0.3.0.tar.gz.

File metadata

  • Download URL: convertkit_py-0.3.0.tar.gz
  • Upload date:
  • Size: 7.9 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

Hashes for convertkit_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 97819971e1128924bdcfa84c2f88a34317f17a56eeba45c01822ca95da8a6698
MD5 8de304d665375d16db0f18a7561b0006
BLAKE2b-256 824eef1951c7265b83b3a58402bd2357a1cf40c57392af72a6c335cc3e58d7cd

See more details on using hashes here.

File details

Details for the file convertkit_py-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: convertkit_py-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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

Hashes for convertkit_py-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90706dce6bb6153711316b51cb30eb48da8933727b2448f58f6691c46d94ff93
MD5 050ca4ea58222bd4f1d40d8c94dd39d4
BLAKE2b-256 703e292ec9366e0c703393db482bcab12e08cd6f3bfd512be64ab9b17420053c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page