Installation Guide¶
Modern Setup (Recommended)¶
PyCompTox now uses modern Python packaging standards (PEP 621) with pyproject.toml.
Quick Install¶
# Install from source
pip install .
# Install with development dependencies
pip install -e ".[dev]"
# Install with notebook support
pip install -e ".[notebook]"
# Install everything
pip install -e ".[all]"
Install Options¶
Standard Installation:
Installs only the core dependencies (requests).Development Installation:
Includes: - pytest, pytest-cov (testing) - black (code formatting) - flake8 (linting) - mypy (type checking) - types-requests (type stubs)Notebook Support:
Includes: - jupyter (notebooks) - pandas (data analysis) - matplotlib (visualization)Everything:
Includes all optional dependencies.Editable Install¶
For development, use editable mode (-e flag):
This allows you to make changes to the code without reinstalling.
Build Distribution¶
To build distribution packages:
This creates:
- dist/pycomptox-0.3.0-py3-none-any.whl (wheel)
- dist/pycomptox-0.3.0.tar.gz (source)
Configuration Files¶
pyproject.toml¶
All project metadata and build configuration is in pyproject.toml:
- Package metadata (name, version, description)
- Dependencies
- Optional dependencies (dev, notebook, all)
- Tool configurations (black, mypy, pytest, coverage)
setup.py¶
The setup.py file is now a minimal shim for backward compatibility with older tools. All configuration is in pyproject.toml.
MANIFEST.in¶
Controls which files are included in source distributions: - Documentation (README, LICENSE, docs/) - Type information (py.typed) - Tests (optional)
Type Checking Support¶
PyCompTox is fully typed and includes a py.typed marker file (PEP 561), enabling:
Command-Line Interface¶
After 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 delete
Or use Python module syntax:
Virtual Environment (Recommended)¶
Always 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]"
Verify Installation¶
import pycomptox
print(pycomptox.__version__) # Should print: 0.3.0
# Check available classes
from pycomptox.chemical import Chemical, ChemicalDetails, ChemicalProperties
Development Workflow¶
-
Clone repository:
-
Create virtual environment:
-
Install in editable mode with dev dependencies:
-
Run tests:
-
Format code:
-
Type check:
-
Lint:
Troubleshooting¶
"No module named 'pycomptox'"¶
Make sure you installed the package:
Import errors after changes¶
If you installed in editable mode, Python should pick up changes automatically. If not:
Type checking issues¶
Install type stubs:
Build errors¶
Make sure you have the latest build tools:
Requirements¶
- Python 3.8 or higher
- pip (usually comes with Python)
- Internet connection (for API access)
Platform Support¶
PyCompTox is pure Python and works on: - ✓ Windows - ✓ macOS - ✓ Linux - ✓ Any platform with Python 3.8+
Getting Help¶
- GitHub Issues: https://github.com/USEtox/PyCompTox/issues
- Documentation: https://github.com/USEtox/PyCompTox/blob/main/README.md