pagekit
Python client for the Pagekit content API.
Installation
pip install pagekit-core
Quick start
from pagekit import Pagekit
client = Pagekit(api_key="pk_live_...")
# List posts
page = client.posts.list(status="published", limit=10)
for post in page.data:
print(post.title)
# Create a post
post = client.posts.create(title="Hello world", content="<p>First post</p>")
# Get by slug
post = client.posts.get_by_slug("hello-world")
Async usage
from pagekit import AsyncPagekit
client = AsyncPagekit(api_key="pk_live_...")
posts = await client.posts.list()
Configuration
client = Pagekit(
api_key="pk_live_...",
base_url="https://api.pagekit.app/v1", # default
timeout=30, # seconds
headers={"X-Custom": "value"}, # extra headers
)
Error handling
from pagekit import Pagekit, PagekitError
client = Pagekit(api_key="pk_live_...")
try:
post = client.posts.get("nonexistent")
except PagekitError as e:
print(e.status) # 404
print(e.code) # "not_found"
print(e.is_auth_error) # False
print(e.is_rate_limited) # False
print(e.is_server_error) # False
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pagekit_core-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 pagekit_core-0.1.0.tar.gz.
File metadata
- Download URL: pagekit_core-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff2a511a3b2c3e8abdcbd031ac4f1f1d995e6b92a14d969282b2c7e11fc9be3e
|
|
| MD5 |
984e3dd0895209bc3e66ef2e773fa721
|
|
| BLAKE2b-256 |
387c2c9b8e9ec2fcd03313265ffae5a57d9faf3bd23ab9220a103d0201c3e671
|
File details
Details for the file pagekit_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pagekit_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f19ca98cd918751174aba74204dd9f10858ab61b07f1800d2b936907ab0f9f0
|
|
| MD5 |
98bb16b8b4b1b57ab5a44300b0556c25
|
|
| BLAKE2b-256 |
554c120f98e4860b56fe5b2baf20d8f926c8f1face0704329ede1fcf8fa4d34e
|