Metadata-Version: 2.4
Name: chemsource
Version: 1.1.14
Summary: Tool to classify novel drugs and other health-related chemicals by origin
Author-email: Prajit Rajkumar <prajkumar@ucsd.edu>
Project-URL: Homepage, https://github.com/prajitrr/chemsource
Project-URL: Documentation, https://chemsource.readthedocs.io/
Project-URL: Repository, https://github.com/prajitrr/chemsource.git
Project-URL: Issues, https://github.com/prajitrr/chemsource/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml>=4.9.4
Requires-Dist: openai>=1.23.2
Requires-Dist: pyspellchecker>=0.8.1
Requires-Dist: requests<3,>=2.0.0
Requires-Dist: wikipedia>=1.4.0
Dynamic: license-file

# chemsource

[![Documentation Status](https://readthedocs.org/projects/chemsource/badge/?version=latest)](https://chemsource.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/chemsource.svg)](https://badge.fury.io/py/chemsource)
[![Python 3.6+](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/)

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

```python
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:

```bash
pip install chemsource
```

## Documentation

For detailed documentation, tutorials, and API reference, visit:

**[Read the Docs](https://chemsource.readthedocs.io/)**

The documentation includes:
- Installation and setup instructions
- Comprehensive API reference
- Usage examples and tutorials
- Configuration options
- Error handling guides

## Requirements

- Python 3.6+
- 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](LICENSE) file for details.

## Citation

If you use chemsource in your research, please cite:
(Preprint coming soon)

```
```

## Support

- [Documentation](https://chemsource.readthedocs.io/)
- [Issue Tracker](https://github.com/prajitrr/chemsource/issues)
- [Contact](mailto:prajkumar@ucsd.edu)

---

**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. 
