Metadata-Version: 2.5
Name: TCT
Version: 0.3.0
Summary: Translator Component Toolkit
Project-URL: Homepage, https://github.com/NCATSTranslator/Translator_component_toolkit
Project-URL: Documentation, https://ncatstranslator.github.io/Translator_component_toolkit/
Project-URL: Repository, https://github.com/NCATSTranslator/Translator_component_toolkit
Author: Guangrong Qin, Yue Zhang, Sierra Moxon
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.10
Requires-Dist: igraph
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyvis
Requires-Dist: requests
Requires-Dist: zstandard
Provides-Extra: mcp
Requires-Dist: fastmcp>=2.12.2; extra == 'mcp'
Provides-Extra: vision
Requires-Dist: ipycytoscape; extra == 'vision'
Requires-Dist: matplotlib; extra == 'vision'
Requires-Dist: networkx; extra == 'vision'
Requires-Dist: pyvis; extra == 'vision'
Requires-Dist: seaborn; extra == 'vision'
Description-Content-Type: text/markdown

Introduction
==================================

## What is TCT?
Translator Component Toolkit is a python library that allowing users to explore and use KGs in the Translator ecosystem.
Users can check out the key function documentations here: [https://ncatstranslator.github.io/Translator_component_toolkit/](https://ncatstranslator.github.io/Translator_component_toolkit/) 

[TCT Github repo](https://github.com/NCATSTranslator/Translator_component_toolkit/tree/main)

## Key features for TCT
Allowing users to select APIs, predicates according to the user's intention. <br>
Parallel and fast querying of the selected APIs.<br>
Providing reproducible results by setting constraints.<br>
Faciliting to explore knowledge graphs from both Translator ecosystem and user defined APIs.<br>
Connecting large language models to convert user's questions into TRAPI queries. <br>
Find the identifier given a name using name resolver<br>
Annotate a node using node annotator<br>
Explore knowledge graphs in Translator<br>
Find neighbors in the Translator KGs for a given node <br>
Find paths between node A and node B in the Translator KG <br>
Find a subnetwork given a list of nodes in the Translator KG <br>
Developer-friendly wrappers for resolving labels/CURIEs, caching Translator resources, and returning parsed finder results <br>
Connecting user's API with Translator API <br>
*Note: Visualization capabilities (pyvis, matplotlib, seaborn) can be installed separately via the `vision` extra.*


## How to use TCT

### Install Requirements

To install TCT as a python library:

```bash
pip install TCT
# TCT is in development, to get the most recent update, user can install it through the github repo
```

**This is the recommended approach for a minimal installation.**

Visualization support is optional. Install it with the `vision` extra when you need the plotting and graph-rendering utilities:

```bash
pip install "TCT[vision]"
```

#### Development Installation

The TCT is continuously updated, if you would like to use the latest functions, you can clone this repository and install it in development mode:



**Using pip: (recommended for development)**
```bash
git clone https://github.com/NCATSTranslator/Translator_component_toolkit.git
cd Translator_component_toolkit
pip install -e .
```

**Using UV :**
```bash
git clone https://github.com/NCATSTranslator/Translator_component_toolkit.git
cd Translator_component_toolkit
uv sync
```

To include visualization support in the UV environment:

```bash
uv sync --extra vision
```

#### Building and Deployment
**Using pip:**
- Build: `python -m build`
- Install dependencies: `pip install -e .`

**Using UV:**
- Build: `uv build`
- Install dependencies: `uv sync`
- Run in UV environment: `uv run python your_script.py`


### Please follow the example notebooks (four utilities) below to explore the Translator APIs.

#### KG overview
Explore different KGs **[KG overview](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/overview_of_KGs.ipynb)**

#### Name Resolver and Node Normalizer
Example notebook for **[Name Resolver and Node Normalizer](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/name_resolver_lookup.ipynb)**

#### Neighborhood finder
Example notebook for **[NeighborhoodFinder](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/Neighborhood_finder.ipynb)**

#### Path finder
Example notebook for **[PathFinder](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/Path_finder.ipynb)**

#### Network finder
Example notebook for **[NetworkFinder](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/Neighborhood_finder_multiple_nodes.ipynb)**

#### Developer-friendly finder APIs
The finder notebooks above include quick-start sections using the developer-friendly `pathfinder` and `neighborhood_finder` APIs, now part of TCT's main API surface (`from TCT import query_TCT_pathfinder, neighborhood_finder`).

Use the detailed NeighborhoodFinder, PathFinder, NetworkFinder, KG overview, and visualization notebooks when you need more fine-grained endpoint selection, predicate control, raw query construction, parser workflows, or visualization setup.


#### Connecting to a user's API
API should be developed following the standard from [TRAPI](https://github.com/NCATSTranslator/ReasonerAPI). <br>
An example notebook for add a user's API can be found [here](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/Connecting_userAPI.ipynb).<br>
**Note: It does not work if no user' API is established**<br>

### Visualize the results
After each pipeline, it will generate a result file for visualization. A user can use **[the Visualization html](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/notebooks/visulize_path_finder_results.html)** file to visulaize the results.

## Key Translator components
Connecting to key Translator components can be found [here](https://github.com/NCATSTranslator/Translator_component_toolkit/blob/main/TranslatorComponentsIntroduction.md)

### Contributing
TCT is a tool that helps to explore knowledge graphs developed in the Biomedical Data Translator Consortium. Consortium members and external contributors are encouraged to submit issues and pull requests. 

### Contact info
Guangrong Qin, guangrong.qin@isbscience.org
