Wrappers around the Tonic Textual API
Project description
Overview
This library contains useful wrappers around the Tonic Textual API
Usage
Instantiate the API wrapper using the following code:
from tonic_textual.redact_api import TonicTextual
# Do not include trailing backslash in TONIC_URL
api = TonicTextual(TONIC_TEXTUAL_URL, API_KEY)
Once instantiated, the following endpoints are available for consumption. Note that available endpoints and response types are limited. Available fields may be severely limited compared to the current Tonic API.
Build and package
Update the version in pyproject.toml. Ensure you are in the python_sdk/ folder in the repo root for the following instructions.
Update build and twine
python -m pip install --upgrade build
python -m pip install --upgrade twine
Clean out dist folder
rm dist/ -rf
Now build
python -m build
And ship
python -m twine upload .\dist\*
The username is token and the pw is your token including the 'pypi-'
Sphinx docs
To build the sphinx docs locally run make html
from the docs
subdirectory.
The Sphinx docs for prod are https://textual.tonic.ai/docs/index.html.
Docstrings
Docstrings should follow numpy style (https://numpydoc.readthedocs.io/en/latest/format.html), so that they render nicely in the auto generated sphinx docs. Here's a simple example of how to write correctly formatted docstrings.
def foo(x: int, y: str) -> Dict[str, int]:
"""Turns a string and an int into a dictionary.
Parameters
----------
x: int
The integer that is the value of the dictionary.
y: str
The string that is the key of the dictionary.
Returns
-------
Dict[str, int]
A dictionary with y as key and x as value.
"""
return {y: x}
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
Built Distribution
Hashes for tonic_textual-2.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c24d339ee664113cc9c2127bf7622fff4a9082641f4251c49eb355f6b0ab673 |
|
MD5 | 9b986cb64909ba8d8222465c3e461a6f |
|
BLAKE2b-256 | 69b7b9a34e3c11d3215ad142f68593e490d97162a93b76863fc3671fea40f03d |