Tool to classify novel drugs and other health-related chemicals by origin
Project description
chemsource
chemsource is a Python tool for exposomics research that classifies chemical compounds based on their exposure sources. It retrieves information from Wikipedia and PubMed, then uses large language models to classify chemicals into user-defined categories.
Quick Start
from chemsource import ChemSource
# Initialize with your OpenAI API key
chem = ChemSource(model_api_key="your_openai_api_key")
# Classify a compound
info, classification = chem.chemsource("aspirin")
print(f"Classification: {classification}")
Installation
Install from PyPI:
pip install chemsource
Documentation
For detailed documentation, tutorials, and API reference, visit:
The documentation includes:
- Installation and setup instructions
- Comprehensive API reference
- Usage examples and tutorials
- Configuration options
- Error handling guides
Requirements
- Python 3.8+
- OpenAI (or other LLM) API key (for classification)
- NCBI API key (optional, for enhanced PubMed access)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
If you use chemsource in your research, please cite: (Preprint coming soon)
Support
Note: chemsource uses OpenAI's API services which incur costs based on usage. New users receive $5 in free credits, sufficient for testing purposes. Other lower-cost endpoints are also available for classification (e.g. DeepSeek, gpt-oss, etc.). In particular, as of the creation of this package, Google Gemini provides a reasonable amount of free API credits.
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 chemsource-1.1.18.tar.gz.
File metadata
- Download URL: chemsource-1.1.18.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30203f0956c822ac1cededce3451e7ac4bf960116ff75f89018b045ba1132016
|
|
| MD5 |
1561bc47e9ce6e1d19ca42679a8bd088
|
|
| BLAKE2b-256 |
e5b8468bbfc3878316b6d7414a270d9b8fef8063154b96316a418f62c0283966
|
File details
Details for the file chemsource-1.1.18-py3-none-any.whl.
File metadata
- Download URL: chemsource-1.1.18-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
319b691e7d4573ff187bdc0e4cee51d127406447e579d33972f58cc53dd97590
|
|
| MD5 |
5d25d383c24e101e26c08470131110ce
|
|
| BLAKE2b-256 |
117ad5935ffc10b2ef4f2cb3ca9086c5d5ca6f53e7b314f4f6946ba4515ffb0b
|