|
| 1 | +# API Reference Overview |
| 2 | + |
| 3 | +The Ably Python SDK provides two main client interfaces: |
| 4 | + |
| 5 | +## Core Clients |
| 6 | + |
| 7 | +### [REST Client](rest.md) |
| 8 | + |
| 9 | +The REST client (`AblyRest`) provides synchronous access to Ably's REST API: |
| 10 | + |
| 11 | +- Publish messages to channels |
| 12 | +- Query message history |
| 13 | +- Manage channel lifecycle |
| 14 | +- Retrieve statistics |
| 15 | +- Token authentication |
| 16 | + |
| 17 | +Use the REST client when you need simple request/response operations without maintaining a persistent connection. |
| 18 | + |
| 19 | +### [Realtime Client](realtime.md) |
| 20 | + |
| 21 | +The Realtime client (`AblyRealtime`) maintains a persistent connection to Ably: |
| 22 | + |
| 23 | +- Subscribe to channels and receive messages in real-time |
| 24 | +- Publish messages |
| 25 | +- Monitor connection state |
| 26 | +- Track presence |
| 27 | +- Receive live updates |
| 28 | + |
| 29 | +Use the Realtime client for applications that need live updates and bidirectional communication. |
| 30 | + |
| 31 | +## Key Components |
| 32 | + |
| 33 | +### [Authentication](auth.md) |
| 34 | + |
| 35 | +The `Auth` class handles authentication with Ably, supporting: |
| 36 | + |
| 37 | +- API key authentication |
| 38 | +- Token authentication |
| 39 | +- Token generation and renewal |
| 40 | + |
| 41 | +### [Channels](channels.md) |
| 42 | + |
| 43 | +Channel interfaces provide access to messaging functionality: |
| 44 | + |
| 45 | +- REST channels for publishing and history |
| 46 | +- Realtime channels for subscribing to messages |
| 47 | +- Channel state management |
| 48 | + |
| 49 | +### [Messages](messages.md) |
| 50 | + |
| 51 | +Message types represent the data sent through Ably: |
| 52 | + |
| 53 | +- `Message` - Standard pub/sub messages |
| 54 | +- `PresenceMessage` - Presence state changes |
| 55 | +- Encoding and encryption support |
| 56 | + |
| 57 | +### [Types](types.md) |
| 58 | + |
| 59 | +Core data types and configuration: |
| 60 | + |
| 61 | +- `ClientOptions` - Client configuration |
| 62 | +- `TokenDetails` - Authentication tokens |
| 63 | +- `Stats` - Usage statistics |
| 64 | +- Channel and connection options |
| 65 | + |
| 66 | +### [Utilities](util.md) |
| 67 | + |
| 68 | +Utility functions and helpers: |
| 69 | + |
| 70 | +- Exception types |
| 71 | +- Encoding/decoding utilities |
| 72 | +- Cryptographic functions |
| 73 | + |
| 74 | +## Client Capabilities |
| 75 | + |
| 76 | +Both clients share common capabilities: |
| 77 | + |
| 78 | +- **Auto-reconnection**: Automatic connection recovery |
| 79 | +- **Message queueing**: Queues messages during disconnection |
| 80 | +- **Type safety**: Full type hints for IDE support |
| 81 | +- **Async/await support**: Native async support in Realtime client |
| 82 | +- **Error handling**: Comprehensive error types |
0 commit comments