Skip to main content

A lightweight, zero-dependency ClassyFire wrapper

Project description

Mini-Classyfire

A lightweight, zero-dependency Python client and CLI tool designed to batch-process and extract high-resolution chemical taxonomy classifications from the ClassyFire API.


Key Features

  • Zero Dependencies: Built entirely on Python's native standard library (urllib, json, csv). No external heavy frameworks required.
  • Defensive Parsing Architecture: Dynamically inspects and normalizes unpredictable API schema variations (e.g., handling fields like molecular_framework or alternative_parents when they dynamically alternate between plain strings, nested dictionaries, or arrays).
  • High-Resolution Taxonomy Capture: Extracts deep structural metadata, including direct_parent, subclass, and molecular_framework, rather than just top-level categories.
  • Strict Upstream Rate-Limiting: Features an integrated throttling guard capped at ~6.6 requests per second to strictly honor ClassyFire's upstream limit (<10 req/s), preventing IP blocking or 429 Too Many Requests faults.
  • Progressive Disk Flushing: Writes outputs to a structured CSV file row-by-row in real-time. If a network disruption occurs mid-batch, data fetched up to that exact second is safely preserved on disk.

Project Architecture

mini_classifier/
│
├── src/
│   └── mini_classyfire/
│       ├── __init__.py
│       └── client.py
│
├── main.py
├── compounds.txt
└── pyproject.toml

Usage

Run the bulk processor by passing an input text file containing one InChIKey per line:

Command Line Interface (CLI)

python main.py -f compounds.txt

Optional Arguments

You can explicitly override the default output destination using the -o or --output flag: Bash

python main.py -f compounds.txt -o custom_output_report.csv


2. The LICENSE File

Create a separate text file named exactly LICENSE (no extension) in your root directory and paste this standard MIT text inside it. The placeholder name completely masks your real identity while granting open-source permissions:

MIT License

Copyright (c) 2026

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

mini_classyfire-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

mini_classyfire-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file mini_classyfire-0.1.0.tar.gz.

File metadata

  • Download URL: mini_classyfire-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mini_classyfire-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f3ac132b3326244598ab349b703d2d4f88dc79117afe159d5e84540e5c4b4f6
MD5 dc1b30f420164bc553d0a09a463bf104
BLAKE2b-256 c29e1ead20b5135e546bcbac3632eb65684219e5887b6549ed38e9c122ea4993

See more details on using hashes here.

File details

Details for the file mini_classyfire-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mini_classyfire-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mini_classyfire-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 646978f61f76a3256f22815072e3b90b6679cc9694aa095d478c66a9b4decd70
MD5 ff8ac7eb8adfffb6fb545872c84324a6
BLAKE2b-256 b7654c1a243de7ca3a7c203e42fe402af76fa5cfb107356a75edd42cebf24c9f

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