pydot is a pure Python library for creating, reading, editing, and rendering graphs in Graphviz's DOT language. It provides an object-oriented interface with classes like Graph, Node, Edge, Subgraph, and Cluster, allowing programmatic graph construction. The library can parse existing DOT files or strings into pydot objects, and render graphs to multiple output formats (PNG, SVG, PDF, etc.) by invoking external Graphviz executables. It depends on pyparsing for DOT parsing and on a separate Graphviz installation for rendering. The codebase demonstrates moderate craftsmanship with dynamic method generation for attributes and formats, an immutable FrozenDict class, and context manager support for nested graph building. However, it carries some technical debt: a vendored copy of CPython's tempfile module, incomplete type annotations, and a handful of long-standing known bugs (marked xfail in tests). The library is actively maintained with CI workflows across multiple Python versions and operating systems, but the dependency on an external binary and the vendored stdlib code are moderate risks.
CellTypist is a Python library and command-line tool for cell type classification in single-cell RNA-seq (scRNA-seq) data. It implements a complete annotation workflow: training logistic regression classifiers on labeled expression matrices (with optional SGD mini-batching and GPU-accelerated cuML backends), annotating query cells using either custom-trained or pre-trained models, and visualizing marker gene expression via dotplots. The package is architected as a conventional Python library with a click-based CLI (entry point: celltypist.command_line:main), a models submodule that manages remote pre-trained artifacts, and a samples module for loading bundled example data. The primary data flow starts with an AnnData object containing raw counts, which is normalized, scaled, and filtered through feature selection before being passed to the classifier. For annotation, the trained model (or a downloaded pre-trained model) is applied to query cells, producing cell type labels and confidence scores. Models are fetched on-demand from celltypist.cog.sanger.ac.uk and cached locally, with a force_update flag to bypass the cache. External dependencies include scanpy, anndata, scikit-learn, click, numpy, scipy, pandas, and matplotlib. The repository is hybrid in nature: while the core deliverable is a software library, it also ships pre-trained models, a cross-species gene mapping reference (Cynomolgus/Rhesus orthologs), and tutorial Jupyter notebooks that demonstrate the API. These data assets make it a valuable resource for bioinformatics researchers even beyond the code itself. The tutorial notebook (docs/notebook/celltypist_tutorial_ml.ipynb) is a usage guide rather than a research artifact, relying on 12 built-in pre-trained models and demo data fetched from the same remote server. The project is maintained but not rapidly evolving; the last significant release was January 2025, and the codebase shows signs of technical drift. The pickle-based model format could break across Python or scikit-learn versions, and the tutorial notebook may produce different outputs with newer versions of scanpy or CellTypist. The force_update mechanism and backup_url fallback in the data-loading code indicate awareness of external data unavailability, but these fallbacks could themselves become stale.
This repository provides a Python library for creating, reading, and writing AUTOSAR XML (ARXML) files, targeting Classic AUTOSAR platforms from R19-11 to R22-11. It covers a broad range of AUTOSAR elements—software components, port interfaces, data types, constants, compu methods, service needs, and more—through an object-oriented model with full XML serialization. The library is not an end-user application but a tool for automotive engineers and tool integrators to programmatically generate ARXML artifacts for import into commercial AUTOSAR toolchains. It also includes an early-stage code generator that produces C type definitions (Rte_Type.h) from the XML model. The architecture follows a layered design: an XML model layer (autosar.xml) with element classes, enums, and references; a workspace abstraction that manages packages, documents, and template application; and a generator layer that transforms the XML model into an intermediate representation for code generation. A notable design pattern is the template system (ElementTemplate/GenericTemplate) that decouples high-level element recipes from their serialization, enabling config-driven generation of entire projects from TOML configuration files. The library is supported by a comprehensive test suite that exercises round-trip XML serialization for hundreds of element types. The codebase shows good craftsmanship—clean separation of concerns, consistent use of base classes (Identifiable, Describable), version-aware enum handling, and typed reference system. However, it is still in development (v0.5.7) with many planned releases and a roadmap that implies future breaking changes. Several AUTOSAR elements remain unimplemented, and the test suite relies on exact XML string comparisons, making it brittle. The project is maintained by a single contributor with no PyPI release, posing adoption and continuity risks. Overall, it is a solid, functional library for its domain but not yet production-ready for all use cases.
factur-x is a Python library for generating, validating, and extracting Factur-X/ZUGFeRD hybrid PDF+XML invoices. It exposes a high-level API (generate_from_file, generate_from_binary, get_xml_from_pdf, xml_check_xsd, xml_check_schematron, generate_cii_xml, generate_ubl_xml) and three CLI entry points (facturx-pdfgen, facturx-pdfextractxml, facturx-xmlcheck). The library supports both CII (Cross-Industry Invoice) and UBL 2.1 XML profiles, and bundles the necessary XSD schemas, Schematron/XSLT validation rules, and code-list databases. It is a standards-compliance tool for e-invoicing, not a data pipeline or research project.
Dataclass CSV is a Python library that maps CSV rows to dataclass instances, providing type-safe reading and writing of CSV files. It leverages Python's standard `csv` module and dataclasses to automatically convert and validate fields based on type annotations. The library supports common types (int, str, float, bool, datetime, date), custom user-defined types, optional fields with defaults, field mapping for mismatched column names, and decorators for date format and whitespace handling. It includes both a `DataclassReader` (iterable over dataclass instances) and a `DataclassWriter` (writes dataclass lists to CSV). The codebase is small, well-structured, and has no external dependencies beyond the Python standard library. It is primarily a library for application developers who need to integrate CSV data with Python dataclasses in a clean, validated manner.
This is a Python library for working with GeoJSON data, providing classes for all GeoJSON geometry types (Point, LineString, Polygon, etc.), Feature and FeatureCollection objects, and utility functions for encoding/decoding to/from JSON. It implements the __geo_interface__ protocol for integration with other geospatial tools and includes validation for GeoJSON spec compliance. The code is pure Python with no external dependencies, well-tested, and actively maintained by the Jazzband community.
Parsons is a Python library providing a unified interface to dozens of third-party services commonly used in progressive political campaigns and advocacy organizations. It acts as an ETL/integration toolkit, with a core `Table` abstraction (backed by petl) that normalizes data from APIs, databases, and file formats. The library includes connectors for voter file platforms (NGP VAN, PDI, TargetSmart, Catalist), fundraising (ActBlue, Donorbox, Braintree), communication (Twilio, Slack, Gmail), event management (MobilizeAmerica, ActionNetwork), and cloud storage (S3, GCS, Azure). It also provides database connectors (Postgres, Redshift, BigQuery, MySQL, SQLite) and utilities for dbt integration, credential management, and file handling. The architecture is a monolith of loosely coupled connector modules, each following a consistent pattern of credential resolution via environment variables and returning `Table` objects. The codebase is well-tested with unit tests (mocked) and some integration tests, but many connectors rely on external APIs that may drift. The library is actively maintained by The Movement Cooperative, with recent commits and CI/CD pipelines.
pylinac is a Python library for performing TG-142 QA tasks on linear accelerators. It provides high-level analysis modules for common radiotherapy QA tests—VMAT, Winston-Lutz, PIPS, field analysis, planar imaging, log analysis, CT, and star shot—plus lower-level core modules for image handling, gamma analysis, ROI calculations, and structured results. The library is used as a dependency in clinical QA workflows and exposes a consistent API: instantiate an analysis class with a DICOM/log file path, call `.analyze(...)`, then access `.results_data()`, `.publish_pdf()`, or `.plot_analyzed_image()`.
This repository is a well-established Python library (`SpeechRecognition`) that provides a unified interface for multiple speech recognition engines, including Google Speech, CMU Sphinx (PocketSphinx), Vosk, OpenAI Whisper (both local and API), Groq, Cohere, and several others. The architecture follows a facade pattern via a central `Recognizer` class, which handles audio capture (microphone, files) and delegates recognition to pluggable backends – each implemented as a standalone function in the `recognizers/` subpackage and attached to the `Recognizer` instance at import time. The library bundles FLAC encoder binaries for audio conversion, offers a CLI tool for model downloads, and includes comprehensive test suites with audio fixtures in multiple formats. While the code is well-structured and features clean abstractions (e.g., `AudioData` for format conversion, `OpenAICompatibleRecognizer` base class), it exhibits some technical drift: bundled FLAC binaries are outdated (v1.3.2 from 2014), it depends on `audioop` (deprecated in Python 3.13+), and several backend APIs are at risk of deprecation. The library is production-grade (v3.17.0) and widely used, but its reliance on hardcoded API keys and legacy workarounds for old Python versions suggests maintenance is ongoing but with moderate lag. Overall, it is a solid, reusable codebase with several components that could be extracted independently.
DeepTeam is a production-oriented Python library and CLI for red-teaming LLM applications. It does not merely document vulnerabilities; it executes automated adversarial campaigns against a user-supplied model callback, generating attack prompts through LLM-driven templates (single-turn, multi-turn, tree/crescendo jailbreaks), scoring target responses with LLM-as-judge metrics, and aggregating outcomes into risk assessments with CVSS scoring. It also ships a code scanner for static AI-security review, a trace scanner for agent executions, and deployable input/output guardrails. Main entry points are the red_team() Python API and the deepteam CLI (login, run, scan), with YAML configuration driving model selection, vulnerability types, and attack budgets. Architecturally, the repo is a modular Python package built on deepeval: vulnerabilities inherit from BaseVulnerability, all metrics inherit from BaseRedTeamingMetric, attacks implement configurable templates and schemas, and frameworks (OWASP, MITRE ATLAS, NIST, EU AI Act, BeaverTails, Aegis) map risks to pre-built categories. Results flow through RTTestCase objects and can be saved locally as JSON or pushed to the Confident AI platform. The library is dual sync/async and includes progress reporting, cost accumulation, and retry logic. Although it embeds research-style synthetic data generation and dataset-driven framework integrations, the dominant character is an application library/CLI rather than a data research project. Strengths include broad vulnerability and attack coverage, clear base-class contracts, a substantial test suite, and active CI. Weaknesses include heavy copy-paste duplication across 30+ vulnerability, metric, and template modules, tight coupling to deepeval internals, reliance on hardcoded model defaults such as gpt-3.5-turbo-0125, and a known logic bug where is_successful in the metric base class compares instead of assigns, always returning False unless an error is set. Telemetry code also contains hardcoded service keys. Overall, it is a functional, well-documented framework with real reuse value, but it would benefit from deduplication and dependency hardening.
This repository is a community-driven collection of Streamlit 'extras' — custom components and utilities that extend Streamlit's functionality. It is a Python library (package `streamlit-extras`) that provides over 40 self-contained subpackages, each implementing a specific UI widget, layout helper, or data exploration tool. The architecture is modular: each extra is a subpackage under `src/streamlit_extras/` with a standardized metadata convention (`__title__`, `__desc__`, etc.) and a central `@extra` decorator for registration. Some extras are pure Python wrappers around Streamlit's native APIs (e.g., `grid`, `stateful_button`, `stoggle`), while others are full Custom Components v2 (CCv2) with React/TypeScript frontends built with Vite (e.g., `three_viewer`, `json_editor`, `sigma_graph`). The build system uses Hatch with a custom build hook to compile React frontends during wheel packaging. The gallery app (`gallery/streamlit_app.py`) serves as a demo and documentation explorer. The codebase is well-organized but has several deprecated extras that rely on private Streamlit APIs, and test coverage is limited to metadata validation. Overall, it is a solid, actively maintained library with reusable patterns for Streamlit component development.
ChefBoost is a Python library implementing decision tree algorithms (ID3, C4.5, CART, CHAID, regression) and ensemble methods (AdaBoost, Gradient Boosting, Random Forest). It provides a simple API for building models from pandas DataFrames and making predictions. The library handles both categorical and numerical features without requiring preprocessing. Architecture consists of modular components: main interface (Chefboost.py), utilities (commons/), core training algorithms (training/), and ensemble methods (tuning/). Key strengths include proper packaging, unit tests, documentation, and solutions to technical challenges like recursive multiprocessing. The implementation correctly follows standard ML algorithms while providing a usable framework for developers.
WebTech is a Python-based tool for detecting technologies used on websites. It analyzes HTTP responses by examining headers, HTML content, meta tags, cookies, JavaScript, and URL patterns to identify web servers, frameworks, CMS, and other technologies. The tool provides both a command-line interface and a library API, with optional integration as a Burp Suite extension for active/passive scanning. Technology detection relies on a JSON-based signature database that is regularly updated from a Wappalyzer-compatible source. The architecture is modular, separating concerns into distinct modules: database management (downloading and merging signature files), HTML parsing (extracting meta tags and scripts), core detection logic (checking each technology signature across multiple vectors), and utility functions. The command-line tool processes single URLs or files containing multiple URLs, outputting results in human-readable, grep-friendly, or JSON formats. The Burp extension functions as a passive scanner, analyzing traffic intercepted by Burp Suite. While the core detection logic is well-structured and demonstrates reusable patterns, the codebase shows signs of technical debt. It maintains Python 2/3 compatibility (increasing burden as Python 2 is EOL), disables SSL verification by default (creating security risks), and the Burp extension depends on outdated Jython 2.7.0. The dependency on an external signature database introduces potential fragility if the upstream format changes. Despite these issues, the modular design allows for extraction of reusable components such as the Tech namedtuple, custom JSON encoder for sets, and HTML parser for meta/script extraction.
Troposphere is a mature, well-established Python library for programmatically generating AWS CloudFormation templates. It provides a rich set of Python classes that map to AWS resource types, allowing developers to define infrastructure as code using familiar Python constructs. The library covers hundreds of AWS services through auto-generated modules derived from the official CloudFormation resource specification, with per-service validators and patches to correct naming conflicts and maintain backward compatibility. Its architecture centers on base classes (AWSObject, AWSProperty, Template) that handle serialization, validation, and CloudFormation intrinsic functions. The project also includes a template generator for converting existing JSON/YAML templates back into Python objects, utility helpers for user data scripts, and optional integration with the awacs library for IAM policy documents. While the core is manually maintained, the vast majority of service modules are auto-generated, necessitating regular regeneration to keep pace with AWS changes. The library is extensively tested with example-based regression tests and unit tests for critical services and validators.
amazoncaptcha is a pure Python library for solving Amazon's image-based text captchas. It does not rely on external OCR or machine learning models; instead, it uses a custom algorithm that converts the captcha image to monochrome, segments individual letters, and matches each extracted letter against a precomputed library of compressed patterns (stored as zlib-compressed byte strings in JSON files). The library provides a simple API: the `AmazonCaptcha` class can be instantiated with an image file path, URL, or a Selenium WebDriver screenshot, and its `solve()` method returns the predicted captcha text. The architecture is monolithic: a single package with image processing utilities (utils.py), the solving logic (solver.py), optional data collection tools (devtools.py), and embedded training data for letters A–Z. Externally, it depends on Pillow for image manipulation and requests for downloading captchas from URLs. The solver is designed for high accuracy (claimed 99.9% on various tests) and lightness, making it suitable for web automation and scraping tasks that encounter Amazon captchas. While the core algorithm is elegant and self-contained, its effectiveness is tightly coupled to the specific font, distortion, and noise patterns used by Amazon in its captchas. Any change to Amazon's captcha design would likely require retraining or updating the embedded pattern database. The repository also includes a test suite, CI configuration, and documentation for integration with Selenium.
This repository is the data source and historical archive for the 'best-of-python' curated list of open-source Python projects. It contains a central YAML configuration file (projects.yaml) that defines categories, projects, and metadata (GitHub IDs, PyPI IDs, descriptions, labels). The history/ directory holds weekly CSV snapshots of project metrics (stars, forks, downloads, issue counts, release info, computed ranks) dating from 2021 to mid-2026. The actual generation of the ranked markdown list is performed by an external tool (best-of-generator), which reads the YAML and CSV data and produces the README. The repository itself is not a runnable application or pipeline; it is a structured dataset with a consistent schema for tracking Python ecosystem project popularity and health over time. It serves as a reference for anyone wanting to analyze trends in Python open-source projects or reuse the categorization and ranking methodology for other ecosystems.
face_recognition is a Python library and CLI toolkit that wraps dlib's deep-learning-based face recognition models behind a simple, high-level API. It provides functions to detect face locations (HOG or CNN-based), extract 68-point or 5-point facial landmarks, compute 128-dimensional face encodings, and compare faces via Euclidean distance. The package ships two Click-based CLI entry points — `face_recognition` for batch identification against a known-people folder and `face_detection` for locating faces in images — both supporting multiprocessing and tunable tolerance/upsample parameters. The core logic lives in `face_recognition/api.py`, which is essentially a thin, well-abstracted wrapper around dlib detectors, shape predictors, and the ResNet face encoder, with coordinate conversion helpers to keep the public API in (top, right, bottom, left) tuple form. The repo also includes a large examples directory (webcam recognition, KNN/SVM classifiers, blink detection, batch GPU inference, Flask web service, Raspberry Pi integration) and multi-stage Docker builds for CPU and GPU deployment. Last tagged release is 1.4.0 (2020); the final commit on master dates to mid-2026 but the project shows little active development and many open issues, placing it in 'stale' maintenance status. Technical drift is medium: the codebase still references Python 2.7 in places, pins older dlib versions in some Dockerfiles, and has CI only through 3.10, while the ecosystem has moved to Python 3.12+ and dlib 19.24+. The API wrapper itself is clean and reusable, but the CLI modules and examples are too tightly coupled to the library and filesystem assumptions to be extracted as standalone components.
This repository is a Python framework for constrained nonlinear optimization, with a strong emphasis on uncertainty quantification (UQ) and scientific machine learning. It provides a suite of derivative-free global and local optimizers (differential evolution, Nelder-Mead, Powell, etc.) through a common abstract interface, alongside powerful constraint and penalty handling via symbolic equations (using sympy) and decorator-based composition. The library supports ensemble solvers, parallel execution (via pathos/pyina), and includes extensive UQ tools: discrete measures, product measures, expectation bounds, probability of failure, and McDiarmid bounds. It is structured as a reusable Python package with well-documented modules and a large collection of example scripts demonstrating applications from benchmark optimization to XRD surrogate design and geophysical inversion. While the core library is solid and showcases high craftsmanship in its symbolic constraint generation and abstract solver pattern, many example scripts are exploratory and contain hardcoded parameters or incomplete code, reflecting its research origins. The framework is actively maintained but shows some technical drift (e.g., a forked legacy SciPy optimizer, use of eval/exec in logging and plotting, and heavy reliance on optional dependencies like sympy, klepto, and pathos).
VASPy is a pure Python library for manipulating and analyzing VASP (Vienna Ab initio Simulation Package) input and output files. It provides object-oriented parsers for common VASP formats including POSCAR, CONTCAR, XDATCAR, OUTCAR, OSZICAR, INCAR, DOS, ELFCAR, CHGCAR, and also supports Materials Studio formats (XSD, ARC, XTD). The library exposes high-level classes like PosCar, OutCar, DosX, and InCar that encapsulate file parsing, coordinate transformations, and data extraction, enabling users to programmatically read, modify, and visualize simulation results. It also includes a set of command-line scripts for common tasks such as creating VASP inputs, extracting forces, computing zero-point energies, and converting between file formats. The architecture is modular, with separate modules for atomic coordinates, electronic structure, iterative outputs, and Material Studio interoperability, all built on a shared base class and utility functions. Visualization is a key feature, with matplotlib and PyVista backends for plotting DOS, charge densities, and trajectories. The library is designed for computational materials science researchers and DFT practitioners who need to automate post-processing and workflow tasks around VASP calculations.
PyLTSpice is a Python library and CLI toolkit for automating LTspice circuit simulations. It exposes programmatic editing of .asc netlists (AscEditor/SpiceEditor), reading of LTspice .raw binary output files (RawRead), histogram generation for Monte Carlo analysis, and command-line utilities (ltsteps, histogram, raw_convert, rawplot, run_server, asc_to_qsch). The codebase is primarily a compatibility layer over the spicelib package: many modules are thin re-exports that emit deprecation notices and delegate to spicelib, while preserving legacy class names such as SimCommander and LTSpiceRawRead. The repository includes unit tests with sample .raw/.log/.asc files, Sphinx documentation, and examples. Although it processes simulation data, this is an application/library rather than a data-research repository. Maintenance is active, but the tight dependency on spicelib and the presence of legacy shims create moderate drift risk.