Latitude SDK for Python
Project description
Latitude SDK for Python
pip install latitude-sdk
Requires Python 3.9 or higher.
Go to the documentation to learn more.
Usage
from latitude_sdk import Latitude, LatitudeOptions, RunPromptOptions
sdk = Latitude("my-api-key", LatitudeOptions(
project_id="my-project-id",
version_uuid="my-version-uuid",
))
await sdk.prompts.run("joke-teller", RunPromptOptions(
parameters={"topic": "Python"},
on_event=lambda event: print(event),
on_finished=lambda event: print(event),
on_error=lambda error: print(error),
stream=True,
))
Find more examples.
Development
Requires uv 0.8.17 or higher.
- Install dependencies:
uv venv && uv sync --all-extras --all-groups - Add [dev] dependencies:
uv add [--dev] <package> - Run linter:
uv run scripts/lint.py - Run formatter:
uv run scripts/format.py - Run tests:
uv run scripts/test.py - Build package:
uv build - Publish package:
uv publish
Running only a specific test
Specify the test inline:
uv run scripts/test.py <test_path>::<test_case>::<test_name>
Or mark the test with an only marker:
import pytest
@pytest.mark.only
async def my_test(self):
# ... your code
...and then run the tests with the marker only:
uv run scripts/test.py -m only
Releases
This SDK is automatically published to pypi and GitHub releases when changes are pushed to the main branch with a new version number.
Creating a Release
- Update the changelog: Edit
CHANGELOG.mdto add your new version with release notes - Bump the version: Update the version in
pyproject.toml - Push to main: The GitHub Action will automatically:
- Build and test the package
- Publish to pypi
- Create a GitHub release with changelog content
- Tag the release as
python-sdk-VERSION
See CHANGELOG_TEMPLATE.md for detailed instructions on updating the changelog.
License
The SDK is licensed under the MIT License - read the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 latitude_sdk-5.2.0.tar.gz.
File metadata
- Download URL: latitude_sdk-5.2.0.tar.gz
- Upload date:
- Size: 57.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca8ac9dfa1630ee4519e370680ff3b3552143fffd47496d83d3e5101113a3d0a
|
|
| MD5 |
d468935e090ec4b214f4b827f5306f3e
|
|
| BLAKE2b-256 |
54f81acc5590f1f86fc6c2dd7f4c468916c5c2016ec5e67a33b73b051d1d5742
|
File details
Details for the file latitude_sdk-5.2.0-py3-none-any.whl.
File metadata
- Download URL: latitude_sdk-5.2.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6edbbaa0be724508a461475a1a0d67827c9996a2263cb81df8b6d9584f3e6008
|
|
| MD5 |
e723c3ff82d5fbab6a02dba6af23b7b8
|
|
| BLAKE2b-256 |
c0f4386e143f338df04fb9f60fb6863db4d66516160e187a25ef2c192be53238
|