Official Python SDK for SchedulifyX API - Social media scheduling made easy
Project description
schedulifyx
Official Python SDK for SchedulifyX API - Social media scheduling made easy.
Installation
pip install schedulifyx
Quick Start
from schedulifyx import SchedulifyX
client = SchedulifyX('sk_live_YOUR_API_KEY')
# List all posts
posts = client.posts.list()
print(posts['data'])
# Create a scheduled post
post = client.posts.create(
content='Hello from the SDK! 🚀',
account_ids=['acc_123'],
publish_at='2024-12-20T10:00:00Z'
)
# Publish immediately
client.posts.publish(post['data']['id'])
Configuration
from schedulifyx import SchedulifyX
# Simple initialization
client = SchedulifyX('sk_live_YOUR_API_KEY')
# With options
client = SchedulifyX(
api_key='sk_live_YOUR_API_KEY',
base_url='https://api.schedulifyx.com', # optional
timeout=30 # optional, in seconds
)
API Reference
Posts
# List posts with filters
posts = client.posts.list(
status='scheduled',
account_id='acc_123',
limit=20,
offset=0
)
# Get single post
post = client.posts.get('post_123')
# Create post
new_post = client.posts.create(
content='Hello world!',
account_ids=['acc_123', 'acc_456'],
publish_at='2024-12-20T10:00:00Z',
media_urls=['https://example.com/image.jpg'],
platform_overrides={
'twitter': {'content': 'Hello Twitter! #launch'}
}
)
# Update post
client.posts.update(
post_id='post_123',
content='Updated content',
publish_at='2024-12-21T10:00:00Z'
)
# Delete post
client.posts.delete('post_123')
# Publish immediately
client.posts.publish('post_123')
Accounts
# List all connected accounts
accounts = client.accounts.list()
# Filter by platform
instagram_accounts = client.accounts.list(platform='instagram')
# Get single account
account = client.accounts.get('acc_123')
# Get Pinterest boards
boards = client.accounts.get_pinterest_boards('acc_pinterest_123')
Media Upload
# Get presigned upload URL
response = client.media.get_upload_url(
filename='my-image.jpg',
content_type='image/jpeg'
)
upload_url = response['data']['uploadUrl']
media_url = response['data']['mediaUrl']
# Upload using the presigned URL
import requests
with open('image.jpg', 'rb') as f:
requests.put(upload_url, data=f, headers={'Content-Type': 'image/jpeg'})
# Use media_url in your post
client.posts.create(
content='Check out this image!',
account_ids=['acc_123'],
media_urls=[media_url]
)
# Or use the convenience helper
with open('image.jpg', 'rb') as f:
media_url = client.media.upload(f.read(), 'image.jpg', 'image/jpeg')
Analytics
# Get overview
overview = client.analytics.overview()
# Get account-specific analytics
account_analytics = client.analytics.for_account('acc_123', days=30)
# Get all analytics
all_analytics = client.analytics.list(
start_date='2024-01-01',
end_date='2024-12-31'
)
Queue
# Get queue schedule
queue = client.queue.get_slots('profile_123')
# Set queue schedule
client.queue.set_slots(
profile_id='profile_123',
timezone='America/New_York',
slots=[
{'dayOfWeek': 1, 'time': '09:00'},
{'dayOfWeek': 1, 'time': '15:00'},
{'dayOfWeek': 2, 'time': '09:00'}
],
active=True
)
# Get next available slot
next_slot = client.queue.get_next_slot('profile_123')
# Preview upcoming slots
preview = client.queue.preview('profile_123', count=10)
Usage
usage = client.usage()
print(f"{usage['data']['requestsToday']}/{usage['data']['dailyLimit']} daily requests used")
Multi-Tenant (Enterprise)
# Create a tenant
tenant = client.tenants.create(
external_id='user_123',
email='user@example.com',
name='John Doe'
)
# Get OAuth URL for tenant
response = client.tenants.get_connect_url(tenant['data']['id'], 'instagram')
# Redirect user to response['data']['url']
# List tenant's accounts
accounts = client.tenants.list_accounts(tenant['data']['id'])
# Disconnect account
client.tenants.disconnect_account(tenant['data']['id'], 'acc_123')
Error Handling
from schedulifyx import SchedulifyX, SchedulifyXError
client = SchedulifyX('sk_live_YOUR_API_KEY')
try:
client.posts.create(content='Test', account_ids=['acc_123'])
except SchedulifyXError as e:
print(f'API Error: {e.code} - {e.message}')
print(f'Status: {e.status}')
print(f'Details: {e.details}')
Type Hints
The SDK includes type hints and dataclasses:
from schedulifyx import (
Schedulify,
Post,
Account,
Analytics,
Tenant,
QueueSchedule
)
License
MIT
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
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 schedulifyx-1.0.4.tar.gz.
File metadata
- Download URL: schedulifyx-1.0.4.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f41363a87eeeba28296bbad7896b727511f8acad1a2b07ac836d63459535874d
|
|
| MD5 |
c84bd26002387d88e16f1ef897a70cc9
|
|
| BLAKE2b-256 |
b81edc7bb0b5fa7434110612e55c37b77ca9d972edc78e544bf0a7d3f282e63a
|
Provenance
The following attestation bundles were made for schedulifyx-1.0.4.tar.gz:
Publisher:
publish.yml on Eh-Mr-SK/schedulifyx-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
schedulifyx-1.0.4.tar.gz -
Subject digest:
f41363a87eeeba28296bbad7896b727511f8acad1a2b07ac836d63459535874d - Sigstore transparency entry: 790020957
- Sigstore integration time:
-
Permalink:
Eh-Mr-SK/schedulifyx-sdk-python@061147887c38c39a7bfa6e59e003f6aa4450d209 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/Eh-Mr-SK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@061147887c38c39a7bfa6e59e003f6aa4450d209 -
Trigger Event:
release
-
Statement type:
File details
Details for the file schedulifyx-1.0.4-py3-none-any.whl.
File metadata
- Download URL: schedulifyx-1.0.4-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fabcaaf0ea6429d1cc857e41bc5557328384a9faf787875495933dbea6db536e
|
|
| MD5 |
56c7d99259f2c37ee347be6c99df8cdb
|
|
| BLAKE2b-256 |
d91b3a2ebc342a6982fa5c3784c465c98f41b4f64ce89ac748a3294292bf5523
|
Provenance
The following attestation bundles were made for schedulifyx-1.0.4-py3-none-any.whl:
Publisher:
publish.yml on Eh-Mr-SK/schedulifyx-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
schedulifyx-1.0.4-py3-none-any.whl -
Subject digest:
fabcaaf0ea6429d1cc857e41bc5557328384a9faf787875495933dbea6db536e - Sigstore transparency entry: 790020961
- Sigstore integration time:
-
Permalink:
Eh-Mr-SK/schedulifyx-sdk-python@061147887c38c39a7bfa6e59e003f6aa4450d209 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/Eh-Mr-SK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@061147887c38c39a7bfa6e59e003f6aa4450d209 -
Trigger Event:
release
-
Statement type: