Skip to main content

Teselagen Biotechnology API client

Project description

TeselaGen Python API Client

The TeselaGen Python API Client runs on Python 3.

NOTE : All the following commands are supposed to be run on the base directory, unless specified.

Library Installation

This library contains the TeselaGen Python API Client.

To install it locally,

  1. Install it with pip

    pip3 install teselagen
    

Examples

To be able to run the examples, you need to (after installing the library)

  1. Clone or download teselagen/examples

  2. Open any notebook in the examples folder with Jupyter Notebook

Use the provided environment

You can use the provided docker environment that contains a ready to use installation of all required packages to run the notebooks. Here are the instructions according to your OS

Linux/MacOS

  1. After clone/download, run the build script with bash build.sh

  2. Run the container with bash run.sh

  3. Open your browser and set the address: http://localhost:8888. From there you can explore all example notebooks

Development (Linux/MacOS)

Docker environment

  1. Build the docker environment with command bash build.sh

  2. Run the container as a developer with the command bash run_dev.sh. With this command the teselagen library will be installed in editable mode.

Dependencies

Install dependencies

If lock file exists (the lock file contains fixed versions of dependencies), the poetry install command will install all dependencies according to the lock file (lock file must be added to the repo). If the file does not exist, it will generate the lock file again.

Update dependencies

Use this command if you made changes on the dependencies at the pyproject.toml file:

poetry update

It is the equivalent to make an install after deleting the lock file.

Tests

  1. Add your credentials

    To run the tests, you must create a .credentials file containing the test username and password, in the root folder.

    The content of .credentials file should look similar to the following:

        {
            "username" : "ReplaceWithYourUsername",
            "password" : "ReplaceWithYourPassword"
        }
    
    • NOTE: It should be a valid JSON file. JSON with Comments (JSONC ) format is not supported.
    - DO NOT COMMIT THIS FILE : .credentials
    
  2. Modify configuration

    You may modify some test configuration parameters by creating a .test_configuration file. This is a JSON formatted file, where you can edit the server name used for tests. This file must be stored next to .credentials file. Here is an example

    {
      "host_url" : "https://platform.teselagen.com"
    }
    
    • NOTE: It should be a valid JSON file. JSON with Comments (JSONC ) format is not supported.
  3. Run the tests

    cd /home && python3 setup.py test
    

    You may use the docker environment for testing. For that, first build the environment with bash build.sh. Then just run the container with bash run_dev.sh. Once inside (docker exec -ti tgclient bash), go to home/ and you are ready to run the test command shown above.

Publishing

Publishing is limited to administrators. PyPi publishing is made by using poetry.

To publish:

  1. Run poetry build from the project's root folder (same directory as pyproject.toml)

  2. Be sure you have set the credentials with the api token:

poetry config pypi-token.pypi <TOKEN>

Ask for a token to administrators if needed

  1. Publish (check you have set a new version tag in pyproject.toml):
poetry publish

Notes

Default shell in Ubuntu is dash, to which /bin/sh is symlinked. But dash doesn't have the pipefail option. That's why some of our shell scripts have the following line:

# pipefail is necessary to propagate exit codes (but it may not be supported by your shell)
bash | set -o pipefail > /dev/null 2>&1

For example, the following commands will list all options supported by set in each of the respective shells:

sh -c 'set -o'
dash -c 'set -o'
bash -c 'set -o'
zsh -c 'set -o'

So, in Ubuntu it may be recommended to use bash instead of sh.

bash some_shell_script.sh

Or, as follows:

. some_shell_script.sh

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

teselagen-0.4.4.tar.gz (150.0 kB view details)

Uploaded Source

Built Distribution

teselagen-0.4.4-py3-none-any.whl (160.2 kB view details)

Uploaded Python 3

File details

Details for the file teselagen-0.4.4.tar.gz.

File metadata

  • Download URL: teselagen-0.4.4.tar.gz
  • Upload date:
  • Size: 150.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.9 Linux/5.10.76-linuxkit

File hashes

Hashes for teselagen-0.4.4.tar.gz
Algorithm Hash digest
SHA256 0346d03272e31a2f92571b6112eb9a7e93348fc131d8824fa1dc85004bc403dd
MD5 7ad0a2fbff64d586ab31d5fbe68409e3
BLAKE2b-256 18baf0daefccaad9cc6f68cecd0a96e5f1a865cb0c91dfa6cc8f93178fc678ad

See more details on using hashes here.

File details

Details for the file teselagen-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: teselagen-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 160.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.9 Linux/5.10.76-linuxkit

File hashes

Hashes for teselagen-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 488f71b7e3e358e156b836f2ca27afe721ab09f408d5b88ae41bab1a98799adc
MD5 4671a0d064654a02d3858c61ab77bb9c
BLAKE2b-256 9eed525774ad5b2ce3092cfc2eed958b6e10e4afaa4d4aa6f53486a34b5fb0d8

See more details on using hashes here.

Supported by

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