Skip to main content

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

  1. Update the changelog: Edit CHANGELOG.md to add your new version with release notes
  2. Bump the version: Update the version in pyproject.toml
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latitude_sdk-5.3.0b2.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latitude_sdk-5.3.0b2-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file latitude_sdk-5.3.0b2.tar.gz.

File metadata

  • Download URL: latitude_sdk-5.3.0b2.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for latitude_sdk-5.3.0b2.tar.gz
Algorithm Hash digest
SHA256 e1f61e332ae6b6556a4b7fd4c41d84d204a942911a973d47b7ad501293c39417
MD5 0e0e687c6c5199c0b118a1d08bd13c5d
BLAKE2b-256 dd5e557dbd25ce3f757691551e1e25337e42adc03488616cd66cb25444f55e19

See more details on using hashes here.

File details

Details for the file latitude_sdk-5.3.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for latitude_sdk-5.3.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 36ffc3e82d20120631d9677a4e95907e8f427c709a4490cf024541cdf1a1a844
MD5 e996f081cddb33b51aa0ab8173d6eedd
BLAKE2b-256 a5304d5441dbdc1e92250a05ad54d211631b2afaf0c49e1b8238250621afcf16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page