Skip to content

andreskull/convertkit-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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': '[email protected]',
    '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

About

Python SDK for Kit (ConvertKit formerly) v3 API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages