Skip to main content

Firepipe

Framework for Iterative, Resumable Processing and Interpretation of Parseable Entities

A generator framework for iterative, serializable parsers and processors for arbitrary structured data.

Usage

pip install firepipe-gen
import firepipe

Documentation and detailed explanation will follow in distant future. For now, see examples.

Description

firepipe is a library aimed at generating lexers, parsers and processors dynamically from a set of rules. It provides a powerful yet simple API suitable for designing tools that work with parseable and interpretable contents, such as DSLs, scripting languages, expression evaluators, type inferrers or transpilers.

Common use cases:

  • Programming Language
    1. A user decides to design a programming language
    2. They use this library to define and generate lexers, parsers and interpreters for that language
    3. They serialize the finished language toolkit and use it in production environments through a small python wrapper
  • Configuration Files
    1. A user decides to write a reusable config library for their other projects
    2. During initialization, the library generates a liteweight parser optimized for the provided config
    3. Projects can provide their own typing and meta-parameters, and the generated parser will handle the user input
  • Type Analysis
    1. A user decides to write a type analyzer for a language that currently lacks one
    2. They create a parser and make the processor reduce the parsed values to a type
    3. They embed the parser and the processor in their product and ship it

Features

Iterative Approach

  • Both the parser and the processor are executed iteratively
  • Reduces call-overhead and removes the recursion limit
  • Provides explicit frame and stack implementations
  • Enables serialization, stepping and easier debugging

Typing

  • The runtime environment is designed to support typing at interpreter-level
  • Simple integration of domain-specific types and python-like operator overloading

Grammar

  • Parser rules (a.k.a. grammar), are defined similar to regular expressions, with an additional ability for circular references
  • The library is equipped with a set of useful, predefined rules, such as Ordered, Or, Repeat or Star, as well as aliases for common operator configurations such as BinInfLeft or UnPref
  • Operators are defined directly at the grammar level through Op and ArgOp and can support any number of arguments
  • The grammar allows any types of associativity
  • The AST produced by the parser is flattened, making the handling of nested abstract rules easier (note: the resulting AST is not flat, but all unnecessary tree levels are removed in the process of construction)

Serialization

  • Every component of the library is serializable
  • Allows checkpointing, resumable runtime, processing pipelines and distributed execution

Design Decisions

Top-Down Parsing

The parser uses top-down methods to process the data.

Pros:

  • Top-down parsers can process highly ambiguous grammars
  • The recursion has been replaced with an iterative stack-based approach, which improves flexibility

Cons:

  • Backtracking top-down parsers may exhibit exponential worst-case complexity on ambiguous grammars
  • Requires the user to manually write a curated rule list free from left recursion or other infinitely recursive rule definitions

Metadata

Release files for firepipe-gen 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for firepipe-gen 1.0.0
File Size Uploaded Provenance Actions
firepipe_gen-1.0.0.tar.gz 12.5 kB Without provenance Details for firepipe_gen-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for firepipe-gen 1.0.0
File Interpreter ABI Platform Actions
firepipe_gen-1.0.0-py3-none-any.whl Python 3 none any Details for firepipe_gen-1.0.0-py3-none-any.whl

Total release size: 25.9 kB

Release files / firepipe_gen-1.0.0.tar.gz

Download URL firepipe_gen-1.0.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e2c2b3dfd31ad28b11071f3b4495bc5d6012616c8e3504aa59f155c1ec5f1a3f
BLAKE2b-256 checksum
How to use checksums
4facd3c25d3ddaadf723ec67929e7754ffce319a81a3dd9435b31f56df685b67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / firepipe_gen-1.0.0-py3-none-any.whl

Download URL firepipe_gen-1.0.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc4e08941559a7539324941cd9302cbe70ad2b4826083ab721ccadf9339292fc
BLAKE2b-256 checksum
How to use checksums
9ec2831ec1351d433010f6f80930537098d4831716917299930637eeedfe86e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for firepipe-gen 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page