PyCompTox now uses modern Python packaging standards (PEP 621) with pyproject.toml.
# Install from source
pip install .
# Install with development dependencies
pip install -e ".[dev]"
# Install with documentation tools
pip install -e ".[docs]"Standard Installation:
pip install .Installs only the core dependencies (requests).
Development Installation:
pip install -e ".[dev]"Includes:
- pytest, pytest-cov (testing)
- pytest-mock (test mocking)
- types-requests (type stubs)
Documentation Support:
pip install -e ".[docs]"Includes:
- mkdocs (documentation site)
- mkdocs-material (theme)
- mkdocstrings[python] (API docs)
For development, use editable mode (-e flag):
# Editable install with dev dependencies
pip install -e ".[dev]"This allows you to make changes to the code without reinstalling.
To build distribution packages:
# Install build tools
pip install build
# Build wheel and source distribution
python -m buildThis creates:
dist/pycomptox-0.3.0-py3-none-any.whl(wheel)dist/pycomptox-0.3.0.tar.gz(source)
All project metadata and build configuration is in pyproject.toml:
- Package metadata (name, version, description)
- Dependencies
- Optional dependencies (dev, docs)
- Tool configurations (black, mypy, pytest, coverage)
The setup.py file is now a minimal shim for backward compatibility with older tools. All configuration is in pyproject.toml.
Controls which files are included in source distributions:
- Documentation (README, LICENSE, docs/)
- Type information (py.typed)
- Tests (optional)
PyCompTox is fully typed and includes a py.typed marker file (PEP 561), enabling:
# Type check your code that uses PyCompTox
mypy your_script.pyAfter installation, you can use the CLI:
# Save API key
pycomptox-setup set YOUR_API_KEY
# Show configuration
pycomptox-setup show
# Test API connection
pycomptox-setup test
# Delete API key
pycomptox-setup deleteOr use Python module syntax:
python -m pycomptox set YOUR_API_KEYAlways use a virtual environment:
# Create virtual environment
python -m venv venv
# Activate (Windows)
venv\Scripts\activate
# Activate (Unix/macOS)
source venv/bin/activate
# Install PyCompTox
pip install -e ".[dev]"import pycomptox
print(pycomptox.__version__) # Should print: 0.3.0
# Check available classes
from pycomptox.chemical import Chemical, ChemicalDetails, ChemicalProperties-
Clone repository:
git clone https://github.com/USEtox/PyCompTox.git cd PyCompTox -
Create virtual environment:
python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows
-
Install in editable mode with dev dependencies:
pip install -e ".[dev]" -
Run tests:
pytest tests/
-
Format code:
black src/ tests/
-
Type check:
mypy src/pycomptox
-
Lint:
flake8 src/ tests/
Make sure you installed the package:
pip install -e .If you installed in editable mode, Python should pick up changes automatically. If not:
pip install -e . --force-reinstall --no-depsInstall type stubs:
pip install types-requestsMake sure you have the latest build tools:
pip install --upgrade pip setuptools wheel build- Python 3.8 or higher
- pip (usually comes with Python)
- Internet connection (for API access)
PyCompTox is pure Python and works on:
- ✓ Windows
- ✓ macOS
- ✓ Linux
- ✓ Any platform with Python 3.8+
- GitHub Issues: https://github.com/USEtox/PyCompTox/issues
- Documentation: https://github.com/USEtox/PyCompTox/blob/main/README.md