teselagen


Nameteselagen JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://github.com/TeselaGen/api-client
SummaryTeselagen Biotechnology API client
upload_time2024-11-04 18:28:40
maintainerNone
docs_urlNone
authorYour Name
requires_python<4.0.0,>=3.9.6
licenseMIT
keywords synthetic biology teselagen dbtl crispr dna assembly
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # TeselaGen Python API Client

The _TeselaGen Python API Client_ runs on Python **3.9+**

**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 with pip:

```bash
pip3 install teselagen
```

## Use and login

Import the `teselagen` library:

```python
from teselagen.api import TeselaGenClient
```

Create an instance of the client:

```python
client = TeselaGenClient(host_url="https://<INSTANCE NAME>.teselagen.com/")
```

Then, login by using your user email and One Time Password (OTP). You can get one from `Settings`-> `API Password`
within the application. Alternatively ,you can use your application password.

```python
client.login(username="my@email.com", password="<OTP OR PASSWORD>")
```

Once you have logged in, you don't need to do it everytime. By default login token lasts for 1 week, but you can
change the duration on creation by specifying an expiration time:

```python
client.login(username="my@email.com", password="<OTP OR PASSWORD>", expiration_time="1d")
```

## Examples

Check out the [provided examples](https://github.com/TeselaGen/api-client/tree/master/teselagen/examples). To be able
to run them:

1. Clone or download `teselagen/examples`

1. Open any notebook in the `examples` folder with Jupyter Notebook

## Development

### Poetry virtual environment

For development you can just use the virtual environment created by poetry. To install the project within a virtual
environment, use at the project's root folder:

`poetry install`

### 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:

```bash
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:

   ```JSON
       {
           "username" : "ReplaceWithYourUsername",
           "password" : "ReplaceWithYourPassword"
       }
   ```

   - **NOTE 1**: It should be a valid `JSON` file. `JSON with Comments` (`JSONC` ) format is not supported.
   - **NOTE 2**: You may also add a `host` field. It's value will be used as default host name.

   ```diff
   - DO NOT COMMIT THIS FILE : .credentials
   ```

1. 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

   ```JSON
   {
     "host_url" : "https://platform.teselagen.com"
   }
   ```

   - **NOTE**: It should be a valid `JSON` file. `JSON with Comments` (`JSONC` ) format is not supported.

1. Run the tests

   ```bash
   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](https://python-poetry.org/docs/).

To publish:

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

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

```bash
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`):

```bash
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:

```bash
# 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:

```bash
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
bash some_shell_script.sh
```

Or, as follows:

```bash
. some_shell_script.sh
```

---

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TeselaGen/api-client",
    "name": "teselagen",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.9.6",
    "maintainer_email": null,
    "keywords": "Synthetic Biology, Teselagen, DBTL, CRISPR, DNA Assembly",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/33/32/31e720c9d95edbdcc53f675a60e0dff59dff62ea483a8f9f18cf8dac1087/teselagen-0.5.0.tar.gz",
    "platform": null,
    "description": "# TeselaGen Python API Client\n\nThe _TeselaGen Python API Client_ runs on Python **3.9+**\n\n**NOTE :** All the following commands are supposed to be run on the _base_ directory, unless specified.\n\n## Library Installation\n\nThis library contains the TeselaGen Python API Client.\n\nTo install it locally with pip:\n\n```bash\npip3 install teselagen\n```\n\n## Use and login\n\nImport the `teselagen` library:\n\n```python\nfrom teselagen.api import TeselaGenClient\n```\n\nCreate an instance of the client:\n\n```python\nclient = TeselaGenClient(host_url=\"https://<INSTANCE NAME>.teselagen.com/\")\n```\n\nThen, login by using your user email and One Time Password (OTP). You can get one from `Settings`-> `API Password`\nwithin the application. Alternatively ,you can use your application password.\n\n```python\nclient.login(username=\"my@email.com\", password=\"<OTP OR PASSWORD>\")\n```\n\nOnce you have logged in, you don't need to do it everytime. By default login token lasts for 1 week, but you can\nchange the duration on creation by specifying an expiration time:\n\n```python\nclient.login(username=\"my@email.com\", password=\"<OTP OR PASSWORD>\", expiration_time=\"1d\")\n```\n\n## Examples\n\nCheck out the [provided examples](https://github.com/TeselaGen/api-client/tree/master/teselagen/examples). To be able\nto run them:\n\n1. Clone or download `teselagen/examples`\n\n1. Open any notebook in the `examples` folder with Jupyter Notebook\n\n## Development\n\n### Poetry virtual environment\n\nFor development you can just use the virtual environment created by poetry. To install the project within a virtual\nenvironment, use at the project's root folder:\n\n`poetry install`\n\n### Dependencies\n\n#### Install dependencies\n\nIf lock file exists (the lock file contains fixed versions of dependencies), the `poetry install` command will install\nall dependencies according to the lock file (lock file **must** be added to the repo). If the file does not exist, it\nwill generate the lock file again.\n\n#### Update dependencies\n\nUse this command if you made changes on the dependencies at the `pyproject.toml` file:\n\n```bash\npoetry update\n```\n\nIt is the equivalent to make an install after deleting the `lock` file.\n\n### Tests\n\n1. Add your credentials\n\n   To run the tests, you must create a `.credentials` file containing the test _username_ and _password_, in the\n   _root_ folder.\n\n   The content of `.credentials` file should look similar to the following:\n\n   ```JSON\n       {\n           \"username\" : \"ReplaceWithYourUsername\",\n           \"password\" : \"ReplaceWithYourPassword\"\n       }\n   ```\n\n   - **NOTE 1**: It should be a valid `JSON` file. `JSON with Comments` (`JSONC` ) format is not supported.\n   - **NOTE 2**: You may also add a `host` field. It's value will be used as default host name.\n\n   ```diff\n   - DO NOT COMMIT THIS FILE : .credentials\n   ```\n\n1. Modify configuration\n\n   You may modify some test configuration parameters by creating a `.test_configuration` file.\n   This is a `JSON` formatted file, where you can edit the server name used for tests.\n   This file must be stored next to `.credentials` file. Here is an example\n\n   ```JSON\n   {\n     \"host_url\" : \"https://platform.teselagen.com\"\n   }\n   ```\n\n   - **NOTE**: It should be a valid `JSON` file. `JSON with Comments` (`JSONC` ) format is not supported.\n\n1. Run the tests\n\n   ```bash\n   cd /home && python3 setup.py test\n   ```\n\n   You may use the docker environment for testing. For that, first build the environment with `bash build.sh`.\n   Then just run the container with `bash run_dev.sh`.\n   Once inside (`docker exec -ti tgclient bash`), go to `home/` and you are ready to run the test command shown above.\n\n### Publishing\n\nPublishing is limited to administrators. PyPi publishing is made by using [poetry](https://python-poetry.org/docs/).\n\nTo publish:\n\n1. Run `poetry build` from the project's root folder (same directory as `pyproject.toml`)\n\n1. Be sure you have set the credentials with the api token:\n\n```bash\npoetry config pypi-token.pypi <TOKEN>\n```\n\nAsk for a token to administrators if needed\n\n1. Publish (check you have set a new version tag in `pyproject.toml`):\n\n```bash\npoetry publish\n```\n\n### Notes\n\nDefault shell in `Ubuntu` is `dash`, to which `/bin/sh` is symlinked. But `dash` doesn't have the `pipefail` option.\nThat's why some of our shell scripts have the following line:\n\n```bash\n# pipefail is necessary to propagate exit codes (but it may not be supported by your shell)\nbash | set -o pipefail > /dev/null 2>&1\n```\n\nFor example, the following commands will list all options supported by `set` in each of the respective shells:\n\n```bash\nsh -c 'set -o'\ndash -c 'set -o'\nbash -c 'set -o'\nzsh -c 'set -o'\n```\n\nSo, in `Ubuntu` it may be recommended to use `bash` instead of `sh`.\n\n```bash\nbash some_shell_script.sh\n```\n\nOr, as follows:\n\n```bash\n. some_shell_script.sh\n```\n\n---\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Teselagen Biotechnology API client",
    "version": "0.5.0",
    "project_urls": {
        "Documentation": "https://github.com/TeselaGen/api-client",
        "Homepage": "https://github.com/TeselaGen/api-client",
        "Repository": "https://github.com/TeselaGen/api-client"
    },
    "split_keywords": [
        "synthetic biology",
        " teselagen",
        " dbtl",
        " crispr",
        " dna assembly"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7fe3919ac379cc8fdc91ad2afc315cf454cfeccfe921dc1d974e58df33926727",
                "md5": "d7f303fd40557be7f37444726eaf563a",
                "sha256": "a8ab3ed919f3f646a626f693a1a7783e5ac09c72875a7a90ff07ffb0ba4800ce"
            },
            "downloads": -1,
            "filename": "teselagen-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d7f303fd40557be7f37444726eaf563a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.9.6",
            "size": 138385,
            "upload_time": "2024-11-04T18:28:39",
            "upload_time_iso_8601": "2024-11-04T18:28:39.177349Z",
            "url": "https://files.pythonhosted.org/packages/7f/e3/919ac379cc8fdc91ad2afc315cf454cfeccfe921dc1d974e58df33926727/teselagen-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "333231e720c9d95edbdcc53f675a60e0dff59dff62ea483a8f9f18cf8dac1087",
                "md5": "15d8cb30417f4e93cbb226d0133840b8",
                "sha256": "bf989aa2cd3eaa34bc1f760c22f9a0cca6fbf40eaecfa3173acf78e2a50d6436"
            },
            "downloads": -1,
            "filename": "teselagen-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "15d8cb30417f4e93cbb226d0133840b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.9.6",
            "size": 124923,
            "upload_time": "2024-11-04T18:28:40",
            "upload_time_iso_8601": "2024-11-04T18:28:40.748409Z",
            "url": "https://files.pythonhosted.org/packages/33/32/31e720c9d95edbdcc53f675a60e0dff59dff62ea483a8f9f18cf8dac1087/teselagen-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 18:28:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TeselaGen",
    "github_project": "api-client",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "lcname": "teselagen"
}
        
Elapsed time: 0.87028s