Cored IM OpenAPI SDK - Python
English | 中文
Cored is a secure, self-hosted productivity platform for teams, integrating instant messaging, organizational structures, video conferencing, and file storage.
This is the official Python SDK for Cored server, used to interact with the Cored server via OpenAPI. You need to deploy the Cored server before using this SDK. See the Quick Deploy Guide for setup instructions.
Installation
pip install cored-sdk
Quick Start
import asyncio
from cored import CoredClient, SendMessageReq, MessageContent, MessageText, MessageType_TEXT
async def main():
client = await CoredClient.create(
"https://your-backend-url.com",
"your-app-id",
"your-app-secret",
)
# Optional: preheat fetches access token and syncs server time upfront,
# reducing latency on the first API call
await client.preheat()
# Call API
resp = await client.im.message.send_message(SendMessageReq(
chat_id="chat-id",
message_type=MessageType_TEXT,
message_content=MessageContent(text=MessageText(content="Cored new version released!")),
))
print(resp.message_id)
# Close when done
await client.close()
asyncio.run(main())
Configuration
CoredClient.create() accepts optional keyword arguments to configure client behavior:
from cored import CoredClient, LogLevel
client = await CoredClient.create(
"https://your-backend-url.com",
"your-app-id",
"your-app-secret",
log_level=LogLevel.DEBUG, # Log level (default: INFO)
request_timeout=30.0, # Request timeout in seconds (default: 60.0)
enable_encryption=False, # Enable request encryption (default: True)
)
Event Subscription
Receive real-time events via WebSocket:
from cored import EventMessageReceive
def on_message(event: EventMessageReceive):
print("Message received:", event.body)
client.im.message.event.on_message_receive(on_message)
# Unsubscribe
client.im.message.event.off_message_receive(on_message)
Context Manager
Supports async with syntax for automatic cleanup:
async with await CoredClient.create(...) as client:
resp = await client.im.message.send_message(SendMessageReq(...))
Requirements
- Python 3.9+
Links
License
Metadata
Release files for cored-sdk 0.28.108
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cored_sdk-0.28.108.tar.gz | 23.1 kB | With provenance | Details for cored_sdk-0.28.108.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cored_sdk-0.28.108-py3-none-any.whl | Python 3 | none | any | Details for cored_sdk-0.28.108-py3-none-any.whl |
Total release size: 52.5 kB
Release files / cored_sdk-0.28.108.tar.gz
| Download URL | cored_sdk-0.28.108.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
342626faf0f730f6338bcade91bc984a28e592578551cc794f31de223e8cc242
|
|
BLAKE2b-256 checksum How to use checksums |
2bb99ed2c22647ac49ed2a4ac2a613115e5f2ffe14e5d3ddbc1e76feac09ffad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logRelease files / cored_sdk-0.28.108-py3-none-any.whl
| Download URL | cored_sdk-0.28.108-py3-none-any.whl |
|---|---|
| Size | 29.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d65bf377ad15071c535c157c399f53226484ef83e655479fb88ed5647adffbf1
|
|
BLAKE2b-256 checksum How to use checksums |
c76530836cae162f730e864855a9d7c100e31f6b980310f99ec6d2dd98a1829e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logSecurity for cored-sdk 0.28.108
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cored_sdk-0.28.108.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.