Helium is a Python library that provides a higher-level, more intuitive API for browser automation, built on top of Selenium. It simplifies common web automation tasks such as clicking buttons, filling forms, handling alerts, switching windows, and dragging elements by allowing developers to reference page elements by their visible labels rather than low-level CSS selectors or XPath expressions. Under the hood, Helium translates each high-level command into Selenium calls, managing implicit waits, iframe traversal, and window focus automatically. The library is designed for both interactive use (e.g., testing) and scripting (e.g., web scraping), and it seamlessly integrates with raw Selenium for advanced use cases. The architecture follows a layered pattern: a public API module (`helium/__init__.py`) exposes functions and GUI element classes; an implementation layer (`helium/_impl/__init__.py`) contains the core logic including element location via XPath construction, frame iteration, and error handling; and utility modules provide geometry, string, and system helpers. The codebase is well-organized with clear separation between API and implementation, though the main implementation file is large and tightly coupled. The library is actively used (over 8,300 stars) and though maintenance is low-effort, it remains functional with recent Selenium compatibility.
nodriver is an asynchronous Python library for browser automation that communicates directly with Chrome/Chromium via the Chrome DevTools Protocol (CDP), bypassing Selenium and WebDriver. It provides a high-level API (Browser, Tab, Element) for navigating pages, finding and interacting with DOM elements, managing cookies, proxies, and taking screenshots, with built-in anti-detection measures to evade bot blockers like Cloudflare. The codebase includes auto-generated low-level bindings for all CDP domains, a custom async WebSocket connection manager, a dict wrapper with attribute access (ContraDict), and a sofisticated async TCP proxy forwarder for authenticated proxies. The library is alpha-stage but actively maintained, though some CDP domain messagers are depreicated and the generated code requires periodic regeneration to stay in sync with Chrome updates.
This repository is a Python library and command-line tool for extracting structured data from HTML documents. It supports multiple formats including W3C HTML Microdata, JSON-LD, Microformat, Open Graph, RDFa, and Dublin Core. The project provides a main extract function that runs all enabled extractors and returns the results in a dictionary, with an option to convert the output to a uniform JSON-LD-like structure for easier consumption. The architecture is modular, with each format handled by a separate extractor class. The main orchestration function in `_extruct.py` manages the extraction process, error handling, and result aggregation. The command-line interface allows users to extract data from a URL or file and output JSON directly. The project includes an extensive test suite with sample HTML files and expected outputs for each format, covering valid cases, edge cases, and invalid inputs. Key reusable components include the uniform output transformation module (`extruct/uniform.py`), which normalizes data from different formats into a common structure, and the error handling pattern used throughout the extraction pipeline. The project is actively maintained, with recent updates adding support for newer Python versions and maintaining compatibility with dependencies. Technical drift is low due to regular updates and a focus on compatibility.
pyGIMLi is a mature open-source geophysical modelling and inversion library, implemented as a C++ core with Python bindings. It provides mesh generation, finite-element solvers, data containers, and high-level manager classes for methods such as electrical resistivity tomography (ERT), vertical electrical sounding (VES), frequency-domain electromagnetics (FDEM), magnetics, gravity, traveltime, and spectral induced polarization. The library is not a GUI application; it is a programmatic toolkit with Python entry points, example scripts, and a console-app pattern in some managers.
This repository is a Python application/library for generating 2D heatmaps from coordinate data. The core module src/heatmap77/heatmap.py implements a complete pipeline: file readers parse plain text, CSV, GPX, and ESRI Shapefile inputs; coordinate systems and projections (equirectangular, mercator) map lat/lon to pixel space; linear and gaussian kernels spread point mass; sparse matrix classes accumulate contributions with optional decay; and an ImageMaker renders the result to PNG/PPM, optionally compositing over OSM tiles or custom backgrounds. The package exposes both a CLI entry point (heatmap77) and a programmatic API used by the examples.
Sphinx Book Theme is a Python package implementing a book-style HTML theme for Sphinx documentation builds. It extends pydata-sphinx-theme (pinned to 0.22.0) and adds custom docutils directives (Margin), a build-time transform that rewrites footnotes into Tufte-style side/margin notes, and header-button generators that emit launch links for Binder/Colab/JupyterHub/Deepnote/JupyterLite plus source links for GitHub/GitLab/Bitbucket. It is distributed on PyPI and serves as the default theme for Jupyter Book, making it a foundational component of the scientific Python documentation ecosystem. Despite this research-communication role, it is a software library, not a data tool — it renders and styles documentation rather than analyzing data. This hybrid character is worth noting: the repo does not contain data pipelines, notebooks for analysis, or research outputs; it contains a Sphinx plugin and frontend asset pipeline. The Python layer is thin but carefully engineered. Theme setup in __init__.py registers Sphinx events, directives, nodes, and transforms; header_buttons/ uses a clean per-provider functional abstraction for generating URLs; _compat.py guards against docutils API drift; and _compile_translations.py coordinates a JSON-to-PO/MO translation workflow. The frontend is compiled with Webpack from a 7-1-architecture SCSS codebase with sections for layout, content, and third-party extension overrides. Tests build real sample sites and use pytest-regressions to verify rendered HTML across Python 3.11-3.14 and Sphinx 8-9, which demonstrates solid engineering discipline for a theme project. The README explicitly declares maintenance mode: bug fixes only, no new features. The last commit is recent and CI runs continuously, but the tightly pinned pydata-sphinx-theme dependency, Sphinx 11 deprecation warnings in the test config, and hand-maintained translation files indicate slow technical drift. For engineers looking for reusable pieces, the standout items are the footnote-to-sidenote transform, the header-button provider pattern, and the HTML asset-hashing utility; the Jinja templates and SCSS are heavily theme-specific and not worth extracting.
PyEMD is a pure Python library for computing the Earth Mover's Distance (also known as Wasserstein distance) between histograms. As of version 2.0, it serves as a thin wrapper around the POT (Python Optimal Transport) library, providing three main functions: `emd()` for computing the EMD value, `emd_with_flow()` for getting both the EMD value and the flow matrix, and `emd_samples()` for computing EMD directly from sample arrays. The library implements optimizations from the original C++ implementation, including pre-flow cancellation of mass within same bins for zero-cost transport. It follows modern Python packaging practices with pyproject.toml, uses setuptools_scm for version management, and maintains comprehensive test coverage.
GWASLab is a Python library and CLI tool for comprehensive processing, quality control, harmonization, visualization, and downstream analysis of GWAS summary statistics. The core object is the `Sumstats` class, which wraps a pandas DataFrame with metadata, status codes, and methods for common operations such as basic QC (`basic_check()`), genome build inference, rsID assignment, allele harmonization, liftover, and format conversion (TSV, VCF, LDSC, PLINK, etc.). The architecture follows a modular design: a pure-calculation `algorithm` subpackage (numpy/scipy only) for effect-size conversions, fine-mapping (ABF), meta-analysis, and power calculations; a `qc` layer for pipeline orchestration with a decorator (`@with_logging`) that enforces column validation, tool availability, and logging; a `hm` layer for variant lookup and harmonization using VCF/BCF and caching (Parquet); a `viz` layer with dozens of plot types (Manhattan, QQ, regional, Miami, forest, phenogram, Sankey) using matplotlib; and an `extension` layer for integrating external tools like LDSC, PRS-CS, SuSiE, and GWAS Catalog API. The CLI (`gwaslab_cli`) exposes subcommands for all major workflows. External dependencies include `pysam`, `polars`, `pyarrow`, `h5py`, `adjustText`, and system tools (`bcftools`, `plink`, `R`). The library is actively developed with extensive test coverage (200+ test files) and bundled reference data for HapMap3, chain files, and cytoband annotations.
PySB is a Python framework for building and simulating rule-based mathematical models of biochemical systems. It provides a domain-specific language (DSL) embedded in Python for defining monomers, rules, parameters, and observables, with operator overloading to express reactions concisely. The library supports multiple simulation backends (SciPy ODE, BioNetGen, StochKit, Kappa, CUDA/OpenCL SSA, cupSODA) and can export models to SBML, MATLAB, Mathematica, BNGL, JSON, and other formats. It includes tools for sensitivity analysis, pattern matching, model testing, and parameter estimation. While primarily a software library, it also contains research examples, paper figure reproduction scripts, and experimental data, making it a hybrid project with a strong application core. The codebase is well-structured with clean abstractions (simulator base class, exporter registry, composable filter predicates) and extensive test coverage, though it carries some technical debt from deprecated modules and external tool dependencies.
This repository is the `pyTelegramBotAPI` Python library, providing both synchronous (`TeleBot`) and asynchronous (`AsyncTeleBot`) implementations for building Telegram bots. It acts as a wrapper around the Telegram Bot API, handling all message types, inline queries, payments, webhooks, polling, and more. The library's architecture is layered: a user-facing bot class that exposes method calls to a core API helper module (`apihelper.py` / `asyncio_helper.py`), which performs HTTP requests to Telegram servers. Bot logic is structured via message handlers (decorator-based), custom filters, middleware hooks, and a state machine with pluggable storage backends (memory, Redis, pickle). Key entry points include `TeleBot` and `AsyncTeleBot` classes, with webhook support via `SyncWebhookListener` and `AsyncWebhookListener` in the `ext` module. The library relies on `requests` (sync) and `aiohttp` (async) for HTTP, with optional dependencies `redis`, `Pillow`, `fastapi`, `uvicorn`, and `watchdog`. It is extensively tested and documented, with over 50 examples covering typical bot patterns. While the codebase is mature and well-maintained, it exhibits some technical drift: duplicated sync/async helper modules, deprecated API parameters maintained for backward compatibility, and incomplete localization files. Overall, it is a solid, production-ready library for Telegram bot development.
PhySO (Physical Symbolic Optimization) is a Python library for symbolic regression using deep reinforcement learning, with a strong emphasis on physics-informed constraints such as dimensional analysis. It discovers closed-form analytical expressions from data, supporting both single-dataset symbolic regression (SR) and multi-dataset class symbolic regression (Class SR) where the same functional form is shared across realizations with per-dataset free constants. The core architecture consists of a token-based program representation (reverse Polish notation), a custom LSTM-based policy network, a modular prior system (hard/soft length, physical units, nesting limits), and an efficient batch execution engine with optional parallel free-constant optimization. The library provides high-level entry points (`physo.SR()` and `physo.ClassSR()`), configuration presets, and a toolkit for expression manipulation and random generation. It includes extensive benchmarking infrastructure (Feynman and Class benchmarks), demos for real-world problems (e.g., Milky Way streams, US tariffs), and unit tests. External dependencies include PyTorch, NumPy, SymPy, pandas, scikit-learn, and matplotlib. While primarily a software library for symbolic regression, it is deeply research-oriented with benchmark result CSVs and analysis scripts, giving it a hybrid application/research character.
This repository is a pure Python library implementing elliptic curve cryptography algorithms, specifically ECDSA (Elliptic Curve Digital Signature Algorithm), ECDH (Elliptic Curve Diffie-Hellman), and EdDSA (Edwards-curve Digital Signature Algorithm). It provides key generation, signing, verification, and shared secret derivation functionalities across multiple curve types including NIST prime curves, Brainpool curves, and twisted Edwards curves (Ed25519/Ed448). The library is structured as a modular package with clear separation of concerns: high-level API in `keys.py`, low-level arithmetic in `ellipticcurve.py`, curve definitions in `curves.py`, ASN.1 DER handling in `der.py`, and utility functions for encoding/decoding in `util.py`. While the code is well-structured and includes comprehensive test suites, the project explicitly states it is not designed for production security due to vulnerability to side-channel attacks, recommending wrappers like `pyca/cryptography` for sensitive applications.
Kaleido is a Python library for static image export of Plotly figures (PNG, SVG, PDF, etc.) by rendering them in a headless Chrome browser via the DevTools protocol. The library provides both async and sync APIs, with an optional singleton server mode for reuse across calls. It manages a pool of browser tabs for parallel rendering, supports chunked JSON transfer for large figures (>10MB), and includes profiling capabilities. The architecture is centered around the `Kaleido` class, which orchestrates browser lifecycle, tab allocation, and rendering through `_KaleidoTab` instances. The library is consumed by Plotly.py and can be used standalone or via CLI tools (`kaleido_mocker`, `kaleido_get_chrome`). Dependencies include `choreographer` (Python-DevTools bridge), `orjson`, and `logistro`. The test suite includes extensive integration tests with hundreds of Plotly figure mocks covering a vast range of trace types and layout features.
The hyperlink library is a pure-Python implementation of immutable URLs, designed for correctness and compliance with RFC 3986 and RFC 3987. It provides two main classes: the low-level `URL` class, which requires explicit handling of encoding and decoding, and the high-level `DecodedURL` class, which automatically handles encoding and decoding for ease of use. The library supports parsing, manipulating, and unparsing URLs, including operations on query strings, path segments, and internationalized domain names (IDNA). It is designed to be a drop-in replacement for Twisted's URL type and is tested across a wide range of Python versions (2.6 to 3.9 and PyPy). The architecture centers around the `_url.py` module, which contains the core parsing logic, the `URL` and `DecodedURL` classes, and helper functions for encoding and decoding. The library also includes a compatibility module (`_socket.py`) that provides a cross-platform implementation of `inet_pton` for older Python versions, particularly on Windows. Testing is facilitated by hypothesis strategies in `hypothesis.py` for generating valid URL components. The library has minimal external dependencies, relying only on the `idna` package for IDNA support and conditionally on `typing` for older Python versions. It is well-maintained with a comprehensive test suite and continuous integration setup, though it continues to support legacy Python versions, which introduces some maintenance overhead.
This is a monorepo of 80+ Haystack integrations maintained by deepset, extending the Haystack framework with production-ready components for RAG, search, and agent pipelines. Each integration is a Python package wrapping an external service (AWS, OpenAI, Cohere, Jina, Brave, MongoDB, Qdrant, Azure, etc.) or providing specialized NLP/agent functionality. The code is library code, not research code — every component follows the Haystack component contract: @component decorator, default_to_dict/from_dict serialization, lazy warm_up, run/run_async, close_async, and Secret-based authentication. The dominant architecture is a collection of thin-to-medium wrappers unified by Haystack's pipeline abstractions, with consistent FilterPolicy (REPLACE/MERGE) document filtering and output type declarations across all integrations.
This is a mature Python library for global optimization of expensive black-box functions using Bayesian optimization. It provides the `BayesianOptimization` class that iteratively fits a Gaussian process regressor (via scikit-learn) to observed function evaluations and uses an acquisition function (Upper Confidence Bound, Expected Improvement, Probability of Improvement, or combined) to propose the next point to evaluate. The library supports constrained optimization, domain reduction, mixed continuous/integer/categorical parameters, asynchronous/parallel optimization, and state persistence. Its architecture is modular: acquisition functions are organized in a strategy pattern, parameters are polymorphic with a base class for custom types, constraints are modeled with separate GPs, and domain reduction is implemented as a transformer. The core algorithm is well-tested and documented, with examples ranging from toy functions to hyperparameter tuning. It is not a research notebook collection or data pipeline; it is a production-grade library intended for integration into optimization workflows.
This is the core implementation of UMAP (Uniform Manifold Approximation and Projection), a scikit-learn-compatible library for non-linear dimensionality reduction. The repository provides a well-structured modular architecture with core classes UMAP, ParametricUMAP (TensorFlow-based), and AlignedUMAP for jointly embedding multiple related datasets. It features a rich set of numba-accelerated distance functions, sparse matrix support, spectral initialization, and a sophisticated optimization engine. Although primarily a library, the repo includes extensive Jupyter notebooks and documentation demonstrating research workflows (parametric UMAP with reconstruction, hyperparameter animation, global loss tuning). The codebase is actively maintained, with ongoing work to remove deprecated patterns such as fastmath, but retains some technical debt (unresolved FIXMEs, sparse test coverage in some areas, and dependency on older scikit-learn APIs). Overall, it is a high-quality, reusable library with clear separation of concerns, making it suitable for integration into data science pipelines and for study of manifold learning techniques.
PyRanges (version 0, legacy) is a Python library for genomic interval operations, analogous to Bioconductor's GenomicRanges. It provides a comprehensive set of tools for manipulating, comparing, and analyzing genomic intervals and annotations. The library supports reading and writing common bioinformatics file formats (BED, GTF, GFF3, BAM, BigWig), and implements a wide range of operations including merging, intersection, subtraction, join, nearest neighbor, clustering, coverage, and statistical methods like Jaccard and Fisher exact. Internally, PyRanges represents intervals as a dictionary of pandas DataFrames keyed by chromosome and optionally strand. This design enables efficient per-chromosome parallelism and easy integration with the Python data science stack. Operations are implemented as modular functions in separate files under the `methods/` directory, each accepting a DataFrame and keyword arguments from a central dispatcher. The library also provides a parallel execution framework using Ray via `pyrange_apply` and related functions, allowing users to apply custom functions to each chromosome/strand group in parallel. Although primarily a software library, this repository has a strong research character: it includes built-in example datasets (e.g., ChIP-seq peaks, CpG islands, Ensembl annotations), a bookdown tutorial with executable R Markdown, property-based tests that compare results against the bedtools suite, and statistical methods designed for colocalization and annotation enrichment. This makes it equally valuable as a research tool for bioinformatics analysis. Maintenance note: This is the legacy version 0 of PyRanges, superseded by a redesigned version 1 (pyranges1). Despite the deprecation, the codebase is mature, well-tested, and still functional. The design patterns (modular operations, per-chromosome dispatch, property-based testing against a reference tool) are noteworthy and could be reused in other bioinformatics and data engineering projects.
eppy is a Python library for programmatic manipulation of EnergyPlus input files (IDF) and simulation output. It provides an object-oriented API to read, write, search, modify, and create IDF objects (materials, constructions, zones, HVAC loops, surfaces, etc.), run EnergyPlus simulations from Python, and parse HTML tabular results. The core architecture centers on the `IDF` class (`eppy.modeleditor`) and the `EpBunch` class (`eppy.bunch_subclass`), which represents individual IDF objects with attribute-based field access, type conversion, unit-aware read/write (SI and IP), and automatic extensible field handling. The library also includes subsystems for building geometry calculations (surface area, tilt, azimuth, zone volume), thermal property computations (R-value, U-factor), HVAC loop construction, fan power calculations, and lazy HTML table extraction. Key entry points are `eppy.easyopen.easyopen()` for opening IDF files with automatic IDD detection, `IDF` for full file management, and `run_functions.run()` for simulation execution. External dependencies include EnergyPlus (for running simulations), plus Python packages like beautifulsoup4, lxml, pydot, and pyparsing. While primarily a library for building energy modeling workflows, it also contains reusable data-oriented components (geometry, thermal calculations, unit conversion) that can be applied to other energy simulation or engineering domains. The codebase has some legacy code from early Python 2 days and a high number of open issues, but remains actively developed with ongoing fixes for extensible fields and new EnergyPlus versions.
This repository provides the Python library `uiautomator2` for Android UI automation. It allows scripts to control Android devices by sending HTTP/JSON-RPC requests to an on-device server (either a Java-based UiAutomator2 jar or the older atx-agent). The core functionality includes element selection via selectors and XPath, gesture simulation (click, swipe, drag), text input via an IME, screenshot capture, UI hierarchy dumps, and app management. It also ships a CLI tool (`u2cli`) with subcommands for device inspection, app operations, and an agent server that exposes a persistent API for LLM/agent-based interactions. The architecture follows a client-server pattern where the Python client communicates over ADB-forwarded ports. The repository includes extensions for HTML reports, performance monitoring, and device info lookups, as well as archived modules for OCR and image recognition. It is widely used for automated testing of Android applications.