How fawq/test-polars works
Main Components
• Command-Line Interface (CLI) Entrypoints:
– Python Runner: Using the “uv” manager (see README commands). This uses the Python module in src/test_polars (with its __main__.py acting as an entry point) and its supporting utilities (process_csv.py and process_data.py).
– Rust Runner: The Rust side uses Cargo; the main.rs in src/ is the entry point, with core processing code in src/utils (with modules such as process_csv.rs and process_data.rs).
• Core Processing Components:
– CSV Processing: Both implementations provide modules for reading and processing CSV files. For Python, this is under src/test_polars/utils; for Rust it is located in src/utils.
– Data Processing / Join Logic: This encapsulates the join operations (inner, outer, left, right, etc.) as depicted in the README’s “Results” section. These algorithms are implemented respectively in Rust and Python.
• Data Resources:
– Test Data Directory (test/data): Contains CSV files (ip_request.csv and ip_response.csv) which serve as input examples for running the tool.
Relationships and Interactions
• Both languages’ entry points accept CSV file paths as input parameters via the command line.
• They pass these inputs to their respective CSV processing modules.
• After ingesting the CSV files, the data processing components perform various join operations and data manipulations, outputting DataFrames similar to those described in the README.
Architectural Patterns and Design Principles
• Separation of Concerns: Distinct modules handle input parsing, CSV processing, and data joining.
• Dual Implementation Layers: The system is intentionally split to provide parallel Python and Rust implementations for similar functionality, which suggests an experimental or comparative design.
• Modularity and Reusability: The utility functions (e.g., those in the “utils” directories) are clearly separated, making it easier to identify and isolate components.
Relevant Technologies, Frameworks, and Tools
• For the Python side: The use of the “uv” manager (an external dependency) along with typical Python module structure.
• For the Rust side: Cargo as the build and package manager, using multiple source modules.
• Both parts process CSV data–which is likely based on the polars library (hinted by the project name “Test Polars”).
Elements
• Clear labels for each major component (CLI, CSV Processor, Data Processor/Join Engine, Test Data).
– Shared resources (like test data)
• External dependencies such as the uv and Cargo tools.