Skip to main content

casquery

ci/cd

Query the EPA Substance Registry Service (SRS) using CAS Registry Numbers (CASRN).

casquery provides:

  • A command-line tool for searching CASRN records
  • Normalization of messy CAS numbers
  • CAS resolution (superseded → current CASRN)
  • Batch processing of CSVs
  • Multiple output formats (table, JSON, XML, CSV)

It works both as:

  • A standalone script (python casquery.py)
  • A PyPI-installable CLI (casquery …)

Installation

# From PyPI
pip install casquery
# Or pip install git+
pip install "git+https://github.com/geocoug/casquery.git"

Command Line Usage

# Help
casquery --help
casquery search --help

# Search EPA SRS
casquery search 375-73-5 29420-43-3

# Search with synonyms
casquery search --synonyms 375-73-5

# Output formats
casquery search 375-73-5 --format json
casquery search 375-73-5 --format xml
casquery search 375-73-5 --format csv

# Normalize CAS numbers
casquery normalize 1234567
# → 1234-56-7

# Resolve superseded CAS numbers
casquery resolve 29420-43-3

# Batch-process a CSV (Input CSV must contain a column of CASRN values.)
casquery batch input.csv --column analyte_cas --output cleaned.csv

Examples

Search for two CAS numbers

casquery search 7440-66-6 7440097

╭───────────────────────────────────────────────╮
│        EPA SRS CASRN Search Results           │
╰───────────────────────────────────────────────╯
cas_rn     systematicName     epaName     currentCasNumber
---------  ------------------  ----------  -----------------
7440-66-6  Zinc                Zinc        7440-66-6
7440-09-7  Potassium           Potassium   7440-09-7

Output JSON instead of a table

casquery search --format json 7440-66-6 7440-09-7

[
  {
    "cas_rn": "7440-09-7",
    "systematicName": "Potassium",
    "epaName": "Potassium",
    "currentCasNumber": "7440-09-7"
  },
  {
    "cas_rn": "7440-66-6",
    "systematicName": "Zinc",
    "epaName": "Zinc",
    "currentCasNumber": "7440-66-6"
  }
]

Release files for casquery 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for casquery 0.2.3
File Size Uploaded
casquery-0.2.3.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for casquery 0.2.3
File Interpreter ABI Platform
casquery-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 41.4 kB

Release files / casquery-0.2.3.tar.gz

Download URL casquery-0.2.3.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3c933712dacdea6b3530b5529ebef2bc6fb27258e9a2b14198a646e43dc81b17
BLAKE2b-256 checksum
How to use checksums
0250ad993e1ad63cce2dba55e922f88eebcccb29717bf4fa1f35637e20788b77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2025.

Transparency log

Release files / casquery-0.2.3-py3-none-any.whl

Download URL casquery-0.2.3-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87cad32a4f600416ea2a656d0f1a00420d82ac6ccb313602ee517aa8c3fe2d73
BLAKE2b-256 checksum
How to use checksums
f9671404d322e2b7d4c7471e0e092a48555916bf94e1b71424013f44d7b0ada0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page