Kapitan is a configuration-as-code CLI tool that renders infrastructure manifests (Kubernetes, Terraform, Docker, etc.) from a hierarchical YAML inventory and pluggable template engines (Jsonnet, Jinja2, Kadet, Helm, Kustomize, CUE). It manages secrets via references (GPG, cloud KMS, Vault, base64), fetches remote dependencies (Git, HTTP, OCI, Helm charts), and supports multiple inventory backends (Reclass, OmegaConf). The compilation pipeline is inventory-driven: targets define classes and parameters, which are deep-merged and interpolated, then passed to input-type compilers that produce deterministic output files. The architecture is modular—separate packages for inputs, inventory backends, secrets/references, and dependency management—all orchestrated by the `kapitan compile` CLI command. It is not a data research project; it is a production-grade infrastructure tool with a large test suite, CI/CD, and documented extension points.
This repository is a CLI tool and Python library that generates modern, typed Python HTTP client libraries from OpenAPI 3.0 and 3.1 specifications. The system parses an OpenAPI document (YAML or JSON), validates it against Pydantic models of the OpenAPI schema, and then converts the parsed structure into an internal representation of endpoints, models, and properties. Using Jinja2 templates, it generates a complete Python package with attrs-based model classes, httpx-based sync/async endpoint functions, a Client class with authentication support, and packaging metadata (Poetry, PDM, uv, or setup.py). The generated code is fully typed and includes serialization/deserialization methods, error handling, and support for complex OpenAPI features like allOf, oneOf, discriminated unions, enums, circular references, and custom content types. The architecture is a monolithic Python package with clear separation of concerns: a CLI entry point (typer), a configuration system (YAML/JSON config files with class overrides), a parser module that converts OpenAPI schemas into a property type hierarchy (StringProperty, IntProperty, UnionProperty, ModelProperty, etc.), and a template rendering engine. The parser uses a protocol-based design for property types, making it extensible. The system also includes a vendored copy of the openapi-schema-pydantic library for schema validation. Security is a key concern, with features like UntrustedString to prevent code injection in generated output and fuzz testing that generates random OpenAPI documents with dangerous strings. The project has extensive testing: unit tests for all parser components, end-to-end snapshot tests using golden records, functional tests that execute the generated code, integration tests against a live test server, and property-based fuzz testing. The generated client libraries are production-ready, using modern Python features like `from __future__ import annotations`, `|` union syntax, StrEnum/IntEnum, and the UNSET sentinel for optional fields. The tool is configurable via CLI flags and config files, supporting custom templates, post-generation hooks, and various packaging backends.
nbconvert is a mature, actively maintained CLI tool and Python library for converting Jupyter Notebooks (.ipynb) into a wide variety of static formats, including HTML, LaTeX, PDF, Markdown, reStructuredText, AsciiDoc, slides (Reveal.js), executable scripts, and even back to notebook format. The architecture is a pipeline: a notebook is first processed by a chain of configurable preprocessors (e.g., for executing code, removing tags, extracting attachments, converting SVG to PDF), then rendered through Jinja2 templates into the target format, and finally written to disk or stdout via a writer, with optional post-processing (e.g., serving slides). The system is highly extensible via Python entry points for custom exporters, preprocessors, and templates, and all components are configurable through traitlets, enabling both programmatic and command-line use. The codebase is well-structured with clear separation of concerns: exporters (base, template-based, and format-specific), preprocessors (over a dozen), filters (for Jinja2 templates), writers, and postprocessors. The template system supports inheritance and custom syntax for LaTeX. Notable implementation highlights include a custom Markdown parser with LaTeX math support (handling both Mistune v2 and v3), ANSI-to-HTML/LaTeX conversion, SVG-to-PDF conversion with security hardening, and a context manager for directory changes. The test suite is extensive, covering exporters, filters, preprocessors, and the CLI application, with CI testing across multiple Python versions and platforms. While the core functionality is robust, the codebase shows signs of technical drift: some modules are deprecated (e.g., lexers.py), external tool dependencies (pandoc, Inkscape, Playwright) introduce version-specific behavior, and the template system has accumulated complexity with multiple inheritance chains and legacy compatibility paths. The project is actively maintained with recent security fixes and releases, but the breadth of supported formats and external dependencies creates ongoing maintenance overhead.