Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ pip install late-sdk
## Quick Start

```python
from late import Late
from datetime import datetime, timedelta
from late import Late, Platform

client = Late(api_key="your_api_key")

# List connected accounts
accounts = client.accounts.list()

# Create a scheduled post
from datetime import datetime, timedelta

post = client.posts.create(
content="Hello from Late!",
platforms=[{"platform": "twitter", "accountId": "your_account_id"}],
platforms=[{"platform": Platform.TWITTER, "accountId": "your_account_id"}],
scheduled_for=datetime.now() + timedelta(hours=1),
)
```
Expand Down Expand Up @@ -119,13 +118,13 @@ Since Claude can't access local files, use the browser upload flow:

| Command | What it does |
|---------|--------------|
| `list_accounts` | Show connected social accounts |
| `create_post` | Create scheduled or immediate post |
| `publish_now` | Publish immediately |
| `cross_post` | Post to multiple platforms |
| `list_posts` | Show your posts |
| `retry_post` | Retry a failed post |
| `generate_upload_link` | Get link to upload media |
| `accounts_list` | Show connected social accounts |
| `posts_create` | Create scheduled, immediate, or draft post |
| `posts_publish_now` | Publish immediately |
| `posts_cross_post` | Post to multiple platforms |
| `posts_list` | Show your posts |
| `posts_retry` | Retry a failed post |
| `media_generate_upload_link` | Get link to upload media |

---

Expand All @@ -144,22 +143,27 @@ async def main():
asyncio.run(main())
```

### AI Content Generation
### AI Content Generation (Experimental)

```bash
pip install late-sdk[ai]
```

```python
from late import Platform, CaptionTone
from late.ai import ContentGenerator, GenerateRequest

generator = ContentGenerator(provider="openai", api_key="sk-...")
generator = ContentGenerator(
provider="openai",
api_key="sk-...",
model="gpt-4o-mini", # or gpt-4o, gpt-4-turbo, etc.
)

response = generator.generate(
GenerateRequest(
prompt="Write a tweet about Python",
platform="twitter",
tone="casual",
platform=Platform.TWITTER,
tone=CaptionTone.CASUAL,
)
)

Expand All @@ -185,15 +189,16 @@ results = pipeline.schedule("posts.csv")
### Cross-Posting

```python
from late import Platform
from late.pipelines import CrossPosterPipeline, PlatformConfig

cross_poster = CrossPosterPipeline(client)

results = await cross_poster.post(
content="Big announcement!",
platforms=[
PlatformConfig("twitter", "tw_123"),
PlatformConfig("linkedin", "li_456", delay_minutes=5),
PlatformConfig(Platform.TWITTER, "tw_123"),
PlatformConfig(Platform.LINKEDIN, "li_456", delay_minutes=5),
],
)
```
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "late-sdk"
version = "1.1.0"
version = "1.1.1"
description = "Python SDK for Late API - Social Media Scheduling"
readme = "README.md"
requires-python = ">=3.10"
Expand Down Expand Up @@ -113,6 +113,10 @@ ignore = [
"B008", # do not perform function calls in argument defaults
]

[tool.ruff.lint.per-file-ignores]
"**/models/_generated/*" = ["UP006", "UP007", "UP035", "W291"] # Allow old-style annotations and trailing whitespace in generated code
"**/models/_generated/**" = ["UP006", "UP007", "UP035", "W291"]

[tool.ruff.lint.isort]
known-first-party = ["late"]

Expand Down
9 changes: 6 additions & 3 deletions scripts/generate_mcp_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

This script generates MDX documentation from the centralized tool definitions
in src/late/mcp/tool_definitions.py

The generated output can be copied into the docs site.
"""

import sys
Expand All @@ -15,18 +17,19 @@
# Add src to path for imports
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))

from late.mcp.tool_definitions import generate_mdx_docs, TOOL_DEFINITIONS
from late.mcp.tool_definitions import TOOL_DEFINITIONS, generate_mdx_tools_reference


def main():
def main() -> None:
"""Generate and print MDX documentation."""
print("=" * 60)
print("MCP Tool Documentation (generated from tool_definitions.py)")
print("=" * 60)
print()
print(generate_mdx_docs())
print(generate_mdx_tools_reference())
print()
print("=" * 60)
print(f"Total tools: {len(TOOL_DEFINITIONS)}")
print("Copy the above into claude-mcp.mdx under '## Tool Reference'")
print("=" * 60)

Expand Down
2 changes: 1 addition & 1 deletion src/late/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Visibility,
)

__version__ = "1.1.0"
__version__ = "1.1.1"

__all__ = [
# Client
Expand Down
Loading