Skip to main content

Tetrascience CLI

Project description

ts-cli

Tetrascience CLI

Table of Contents

Show

Intro

ts-cli allows you to interface with the Tetrascience Data Platform from the comfort of your shell

Example

Create and publish a new task script:

ts-cli config save ~/Downloads/ts-cfg.json
ts-cli init task-script
ts-cli publish

Install

pip install tetrascience-cli

Usage

Create an artifact

Create an IDS, Protocol, Task Script, Tetraflow, or Data App artifact

ts-cli init <kind>

To set up the artifact's configuration interactively, use the --interactive or -i flag.

ts-cli init --interactive

Publish an artifact

Including IDS, Protocol, Task Script, or Data App artifacts from their source code

ts-cli publish

The artifact's type, namespace, slug and version are automatically read from its manifest.json file if it exists. To set up the artifact's configuration interactively, use the --interative or -i flag. Examples:

ts-cli publish --interactive

An example of publishing an artifact using interactive mode

API Configuration

An API configuration is required. This can be the API configuration JSON file (cfg.json) found on the Tetra Data Platform.

{
	"api_url": "https://api.tetrascience.com/v1",
	"auth_token": "your-token",
	"org": "your-org",
	"ignore_ssl": false
}

This configuration can be referred to explicitly in the command line. Example:

ts-cli publish --config cfg.json

Or saved to a specific profile.

ts-cli config save cfg.json --profile dev
ts-cli publish --profile dev

To apply the API configuration to all your projects automatically, save your configuration file globally

ts-cli config save cfg.json --global
ts-cli publish

IDS Validation

When uploading IDS artifact, validation will be performed using ts-ids-validator package. Validation failures for IDS will be printed to the console.

Extras

Protocol Validation

The ts-cli can additionally run protocol v3 validation.

Requirements

  • npm at the time of installation to populate dependencies. Neither npm nor Node.js will be used at runtime

Installation

pip install tetrascience-cli[protocol-validation]

Documentation

Click here for --help and a development guide

Changelog

Show

v2.0.0

  • --include and --exclude flags take glob patterns instead of relative file paths
  • publish command will now read from manifest.json for include and exclude patterns
  • Coerce version number string inputs instead of rejecting them when possible
  • Data-app templates now use version numbers in more places
  • pyproject.toml and package.json files in data-apps now will be updated with the current version number when publishing
  • Artifact updating configuration may now look at a package.json file for a version number
  • Add JWT token manager to React Data App template
  • Add Docs folder to React Data App template
  • Performance fixes in publish command

v1.7.1

  • Add connector back to the supported types in publish and unpublish
  • Various fixes in ts-cli config *
  • Add --config option to ts-cli config get to allow reading values out of a config file
  • Allow prerelease version strings in interactive configurations

v1.7.0

  • Add support for React Data App template
  • Support protocol validation when using interactive mode to publish
  • Remove limits on publishing data-apps and connectors

v1.6.1

  • Add validation for artifact version in interactive mode

v1.6.0

  • Add support for new schema artifact type

v1.5.2

  • Increase artifact size for connectors and data apps to 2 GB
  • Add verbose flag to the publish command
  • Add URL normalization for API configuration
  • Update base image for Streamlit Data Apps

v1.5.1

  • Fix encoding issues when publishing data apps

v1.5.0

  • Add support for publishing Streamlit Data Apps from a template

v1.4.2

  • update tetraflow template to reflect the latest syntax updates
  • adjust files and dirs permissions to ensure lambda user can access all task files
  • fix ts-cli init protocol for 3.5 deployments

v1.4.1

  • update to the latest protocol compiler version

v1.4.0

  • typecheck protocols during publish validation using the protocol virtual machine compiler

v1.3.4

  • exclude betas and RCs from latest version check

v1.3.3

  • update vulnerable dependencies
  • update documentation

v1.3.2

  • fix output of monitored build when no args provided (build from the artifact directory)

v1.3.1

  • output {namespace, slug, version} when monitored build (via CodeBuild) completes

v1.3.0

  • Rename the delete command to unpublish
  • Display the number of other artifacts that depend on artifact that is to be unpublished
    • Example: warning: This protocol artifact is used by at least 1 pipeline

v1.2.0

  • Allow publishing of connectors artifacts

v1.1.0

  • Adjust publish to support Codebuild build_id in response for all artifact types

v1.0.5

  • Fix incorrect messages to console when using ts-cli init --interactive

v1.0.4

  • Add a delete command
  • Remove extra <unset> strings in task script configurations

v1.0.3

  • Rename the nodeType field to category in the tetraflow template
  • Fix a crash on ts-cli config {save,set}
  • Fix broken IDS schemas generated from non-existent manifest.json

v1.0.2

  • Adds the dry-run flag to the publish cli

v1.0.1

  • Fix a crash on startup

v1.0.0

  • Initial release
  • Includes the init, publish and config commands

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

tetrascience_cli-2.0.0.tar.gz (107.4 kB view details)

Uploaded Source

Built Distribution

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

tetrascience_cli-2.0.0-py3-none-any.whl (149.0 kB view details)

Uploaded Python 3

File details

Details for the file tetrascience_cli-2.0.0.tar.gz.

File metadata

  • Download URL: tetrascience_cli-2.0.0.tar.gz
  • Upload date:
  • Size: 107.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tetrascience_cli-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e617d5a5d3d4d31971125506c1abce687cc000a0711ce005b0fe2943a8d958a6
MD5 d2f841dea00ca55e201ebeee6ec0e841
BLAKE2b-256 4fedad6d7dbe8f950862cf7df17eb5a848baf94947b53d7523a1baccd7595550

See more details on using hashes here.

File details

Details for the file tetrascience_cli-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tetrascience_cli-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f8841101619c3c85417dda9ab63240a8d608e84101f4c23d0500d5709610af
MD5 6f49baae9ca02379be9c4801b6f3f6e5
BLAKE2b-256 09d3d07152d3bb4ba57b2f3cd74ffac8bb00b0b362a89f36f0aa3cdde46cfe7d

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