Python SDK

Official Python SDK for Python 3.7+

Installation

pip install content-hub-sdk

Or with poetry:

poetry add content-hub-sdk

Quick Start

from content_hub import ContentHub

hub = ContentHub(api_key='YOUR_API_KEY')

# List domains
domains = hub.domains.list()
print(domains)

# Create content
content = hub.content.create(
    title='My Article',
    content='Article content',
    domain='example.com'
)
print(content)

Working with Domains

# List all domains
domains = hub.domains.list()

# Get a specific domain
domain = hub.domains.get('example.com')

# Create a new domain
new_domain = hub.domains.create(name='newdomain.com')

# Update domain settings
hub.domains.update('example.com', settings={
    # ... settings
})

Working with Content

# List content
content = hub.content.list(
    domain='example.com',
    limit=20
)

# Get specific content
item = hub.content.get('content-id')

# Create content
new_content = hub.content.create(
    title='New Article',
    content='Content here',
    domain='example.com'
)

# Update content
hub.content.update('content-id', title='Updated Title')

# Delete content
hub.content.delete('content-id')

Documentation

For complete documentation and API reference, visit:

github.com/content-hub/sdk-python