A Python interface for the EPA CompTox Dashboard Chemical API
Project description
PyCompTox
A Python interface for the EPA CompTox Dashboard Chemical API.
Overview
PyCompTox provides a simple and intuitive Python interface to interact with the EPA's CompTox Dashboard Chemical, Bioactivity, Exposure, and Hazard API. This package allows you to search for chemicals by name, identifiers (DTXSID, DTXCID, CAS numbers), molecular formulas, mass ranges, and much more.
Installation
Quick Install
pip install comptox-python[all]
install the latest released version.
Note: do not install the package by which is a different package with the old comptox API.pip install pycomptox
For the latest development version:
# Clone the repository
git clone https://github.com/USEtox/PyCompTox.git
cd PyCompTox
# Install the package
pip install -e .
# Or with development tools
pip install -e ".[dev]"
# Or with notebook support
pip install -e ".[notebook]"
PyCompTox now uses modern Python packaging with pyproject.toml. See INSTALLATION.md for detailed installation options.
Optional Dependencies
- dev: Development tools (pytest, black, mypy, flake8)
- notebook: Jupyter notebook support with pandas and matplotlib
- all: All optional dependencies
pip install -e ".[all]"
API Key Setup
To use the CompTox Dashboard API, you need an API key. You can obtain one from the CompTox Dashboard API documentation.
Save Your API Key (Recommended)
Save your API key once and it will be automatically loaded for all future sessions:
pycomptox-setup set YOUR_API_KEY
The API key is stored securely in your user's application data directory:
- Windows:
%APPDATA%\PyCompTox\api_key.txt - macOS/Linux:
~/.pycomptox/api_key.txt
Manage Your API Key
# Test if your API key works
pycomptox-setup test
# Show your saved API key (masked)
pycomptox-setup show
# Delete your saved API key
pycomptox-setup delete
Alternative Methods
You can also provide the API key in other ways:
- Environment Variable: Set
COMPTOX_API_KEYenvironment variable - Direct Parameter: Pass
api_keyparameter when creating the client
API Key Storage
Your API key is stored securely in your user's application data directory:
- Windows:
C:\Users\<username>\AppData\Roaming\PyCompTox\api_key.txt - macOS/Linux:
~/.pycomptox/api_key.txt
The file is created with user-only read permissions on Unix-like systems.
API Documentation
For detailed API documentation, visit:
Chemical, Bioactivity, Exposure, and Hazard.
License
See the LICENSE file for details.
Disclaimer
This package is not officially affiliated with or endorsed by the U.S. Environmental Protection Agency (EPA). It is an independent implementation of a Python client for the publicly available CompTox Dashboard API.
You can find the official Python client from the official USEPA GitHub page.
Also, note that there is another package called pycomptox that is registered on PyPi nder the same name, which is why this package is installed by pip install comptox-python.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file comptox_python-0.6.0.tar.gz.
File metadata
- Download URL: comptox_python-0.6.0.tar.gz
- Upload date:
- Size: 180.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3924179128d4e6630613e3fc186be9e9265d308cee5601b2fb9b88a2b2e96a1
|
|
| MD5 |
263bea5a3e8ff64537011e79e870b4fe
|
|
| BLAKE2b-256 |
f20a990ad102aff885089b9f79cebc0944e2d5ca8ecfb7b9ef8f1058aea5f452
|
Provenance
The following attestation bundles were made for comptox_python-0.6.0.tar.gz:
Publisher:
publish.yml on USEtox/PyCompTox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
comptox_python-0.6.0.tar.gz -
Subject digest:
c3924179128d4e6630613e3fc186be9e9265d308cee5601b2fb9b88a2b2e96a1 - Sigstore transparency entry: 708565689
- Sigstore integration time:
-
Permalink:
USEtox/PyCompTox@57e253d20eb2e0f31b5f7481cfb10d15ab3fbe62 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/USEtox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57e253d20eb2e0f31b5f7481cfb10d15ab3fbe62 -
Trigger Event:
release
-
Statement type:
File details
Details for the file comptox_python-0.6.0-py3-none-any.whl.
File metadata
- Download URL: comptox_python-0.6.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c140483262fb61c1936e46a3790e18090dcd2b8eb2445b126e6861ed73f4b7
|
|
| MD5 |
845ca0127d4c5f5bcd4b615c215d3d4c
|
|
| BLAKE2b-256 |
85acdd369a116467cb8ea2228107cb0d72476ca50f69b0e578b8a36bb40d9424
|
Provenance
The following attestation bundles were made for comptox_python-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on USEtox/PyCompTox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
comptox_python-0.6.0-py3-none-any.whl -
Subject digest:
e1c140483262fb61c1936e46a3790e18090dcd2b8eb2445b126e6861ed73f4b7 - Sigstore transparency entry: 708565695
- Sigstore integration time:
-
Permalink:
USEtox/PyCompTox@57e253d20eb2e0f31b5f7481cfb10d15ab3fbe62 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/USEtox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57e253d20eb2e0f31b5f7481cfb10d15ab3fbe62 -
Trigger Event:
release
-
Statement type: