Skip to main content

Tool to classify novel drugs and other health-related chemicals by origin

Project description

chemsource

Documentation Status PyPI version Python 3.8+ License: MIT

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:

Read the Docs

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chemsource-1.1.15.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chemsource-1.1.15-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file chemsource-1.1.15.tar.gz.

File metadata

  • Download URL: chemsource-1.1.15.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for chemsource-1.1.15.tar.gz
Algorithm Hash digest
SHA256 14f0a14534b82196c43c5be4702aeca5c51e39e96322d4a9ddc7163b9719f394
MD5 b8c92cf8d7119a898e3959f68360d67d
BLAKE2b-256 4282adace7f88c0e8a78cb7f045e93308727ba2d03efdc135f214e94fac34141

See more details on using hashes here.

File details

Details for the file chemsource-1.1.15-py3-none-any.whl.

File metadata

  • Download URL: chemsource-1.1.15-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for chemsource-1.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 dc2ccde91f4065f157ef7bbfcadb7129515a93a34f6fdec85adf8239f59f7974
MD5 72b626dfff8a8351ae623930cc627c02
BLAKE2b-256 982f3f45b6a0ddd3c3df93e2e078d52eabdb0e5195451d745d65fa0d4aed527b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page