Skip to main content

Telescope Python SDK

Project description

Telescope Python SDK

Package containing Pydantic models representing the entities used in Telescope backend systems. The source of truth for these types lives here.

See Deployment for instructions on how to publish a new version of this package.

Usage

$ pip install telescope-sdk

To construct an entity (e.g. Person) you can use the constructor (please note Pydantic only accepts keyword arguments):

from telescope_sdk import Person
person = Person(
    id="123",
    first_name="John Doe",
    ...
    )

Or, to construct from a Python dictionary object:

person = Person.model_validate({
    "id": "123",
    "first_name": "John Doe",
    ...
    })

If you are mapping from PDL types, use the from_pdl method:

person = Person.from_pdl({
    "id": "123",
    "firstName": "John Doe",
    ...
    })
  • Please note that unless a field is set as "Strict", it will automatically attempt to cast any input, and only throw an error if casting fails

Development

To make changes to this package clone the repo and follow the steps below. Please ensure that any changes to the code base are synced with the documentation linked above.

Installation

First set up a virtual environment to isolate dependencies. You can do this in many ways but as an example:

$ pyenv virtualenv 3.10.0 <chosen-virtualenv-name>
$ pyenv activate <chosen-virtualenv-name>

Note this codebase takes advantage of features from Python 3.10+ therefore you may run into errors if you attempt to use an earlier Python version.

This project relies on Poetry for dependency management. To install Poetry follow the instructions here (recommend using pipx to install Poetry globally but manage in virtualenv).

Now ensure you have Make on your machine then run

$ make install

This will install the package and its dependencies in editable mode.

Testing

To run tests locally, run the following command:

$ make test

Linting

To run linting locally, run the following command:

$ make lint

Deployment

A new package version is published to PyPI whenever a new release is created on GitHub. To create a new release follow the following steps, from the master branch:

  1. Update the version number in pyproject.toml to the new version number (use semantic versioning).
  2. Create a new release on GitHub with the same version number as the one in pyproject.toml.
  3. Draft release notes for the new version. These will be used as the package description on PyPI.
  4. The new version will be published to PyPI automatically.

On pushes to the master branch, the sandbox-deploy job will run and publish a new version of the package to TestPyPI. This is useful for testing changes to the package before publishing to PyPI.

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

telescope_sdk-0.2.43.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

telescope_sdk-0.2.43-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file telescope_sdk-0.2.43.tar.gz.

File metadata

  • Download URL: telescope_sdk-0.2.43.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for telescope_sdk-0.2.43.tar.gz
Algorithm Hash digest
SHA256 f05bdc0aaa8966d8bf39e9de914f81f880299e167da77ec06b6ab28f48281f6e
MD5 48da97e58adb4d7a67221679aac3e1d6
BLAKE2b-256 d36c9f96b78caae3f6026920fad1904cf1bee8423a7fee5b6b78eefa0a7e6e5e

See more details on using hashes here.

File details

Details for the file telescope_sdk-0.2.43-py3-none-any.whl.

File metadata

  • Download URL: telescope_sdk-0.2.43-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for telescope_sdk-0.2.43-py3-none-any.whl
Algorithm Hash digest
SHA256 9a42ac022ddf20da5adc5261698b202086a2c10b06c727311b4c2c078d4ceabc
MD5 578b263be10e1b6abc89139b0c85471e
BLAKE2b-256 7b26905e549c5e014f61d4cb13d2b97e50e5a214bb382ffb0db7c75b5112ada1

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