Simple REST client for Python 3.8+ that aims to make interacting with REST APIs straightforward. It provides a clean API for defining resources and actions, handles HTTP requests, and parses responses. Currently at version 1.2.1, it follows a stable release cadence with updates addressing bug fixes and minor improvements, focusing on simplicity and ease of use.
pip install simple-rest-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `SimpleRestClient`, define a `Resource` class, and perform common REST operations like `list`, `get`, and `create` against a public API. It includes an example of handling authentication headers and emphasizes best practices like enabling SSL verification.
Migrate existing `get_action` usages to define `Resource` classes with custom actions or use default CRUD methods via `add_resource`. This provides a more structured and extensible way to interact with your API.
Always ensure `ssl_verify=True` (the default) in production environments. If connecting to internal APIs with self-signed certificates, configure your system to trust the CA certificate or pass the certificate path to `ssl_verify`.
Wrap API calls in `try...except simple_rest_client.exceptions.ClientError as e:` blocks (or more specific HTTP exception types) to gracefully handle API errors. Inspect `e.status_code` and `e.message` for details.
No dependency data recorded yet.