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_frameworkoralternative_parentswhen they dynamically alternate between plain strings, nested dictionaries, or arrays). - High-Resolution Taxonomy Capture: Extracts deep structural metadata, including
direct_parent,subclass, andmolecular_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 Requestsfaults. - 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f3ac132b3326244598ab349b703d2d4f88dc79117afe159d5e84540e5c4b4f6
|
|
| MD5 |
dc1b30f420164bc553d0a09a463bf104
|
|
| BLAKE2b-256 |
c29e1ead20b5135e546bcbac3632eb65684219e5887b6549ed38e9c122ea4993
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646978f61f76a3256f22815072e3b90b6679cc9694aa095d478c66a9b4decd70
|
|
| MD5 |
ff8ac7eb8adfffb6fb545872c84324a6
|
|
| BLAKE2b-256 |
b7654c1a243de7ca3a7c203e42fe402af76fa5cfb107356a75edd42cebf24c9f
|