### Development Setup for plquery Source: https://github.com/pavelzw/plquery/blob/main/README.md Provides instructions for setting up the plquery project for development. This includes cloning the repository, installing pre-commit hooks, running post-installation steps, and executing tests using pixi. ```bash git clone https://github.com/pavelzw/plquery cd plquery pixi run pre-commit-install pixi run postinstall pixi run test ``` -------------------------------- ### Install and Run plquery using pip Source: https://github.com/pavelzw/plquery/blob/main/README.md Installs the plquery package using pip and demonstrates how to run it to query a Parquet file. It also shows how to execute it within a temporary environment using uvx. ```bash pip install plquery # or to run it in a temporary environment uvx plquery my-df.parquet ``` -------------------------------- ### Install plquery (Bash) Source: https://context7.com/pavelzw/plquery/llms.txt Provides commands for installing plquery using different package managers. Includes installation via pixi (recommended), pip, conda, and a development setup guide. ```bash # Install globally with pixi (recommended) pixi global install plquery # Install with pip pip install plquery # Install with conda conda install -c conda-forge plquery # Development installation git clone https://github.com/pavelzw/plquery cd plquery pixi run pre-commit-install pixi run postinstall pixi run test ``` -------------------------------- ### Install and Run plquery using conda-forge Source: https://github.com/pavelzw/plquery/blob/main/README.md Installs plquery globally using pixi and demonstrates running it to query a Parquet file. It also shows how to execute it in a temporary environment using pixi exec. ```bash pixi global install plquery # or to run it in a temporary environment pixi exec plquery my-df.parquet # or pixi exec plq my-df.parquet ``` -------------------------------- ### Interactive Polars Query Examples (Python) Source: https://context7.com/pavelzw/plquery/llms.txt Demonstrates various Polars expressions that can be executed within the plquery TUI. The 'df' variable is pre-loaded with the data. Examples include selecting, filtering, grouping, sorting, and describing data. ```python # Select specific columns df.select(pl.col("name"), pl.col("age")) # Filter rows based on conditions df.filter(pl.col("age") > 30) # Group by and aggregate df.group_by("department").agg( pl.count(), pl.mean("salary") ) # Sort data df.sort("created_at", descending=True) # Chain multiple operations df.filter(pl.col("status") == "active").select( pl.col("user_id"), pl.col("email") ).head(20) # Get statistical summary df.describe() # Check schema df.schema ``` -------------------------------- ### Run plquery directly Source: https://github.com/pavelzw/plquery/blob/main/README.md Demonstrates the basic command to run the plquery binary, aliased as plq, to interactively query a specified Parquet file. ```bash plquery my-df.parquet # or plq my-df.parquet ``` -------------------------------- ### Initialize and Run PlqueryApp (Python) Source: https://context7.com/pavelzw/plquery/llms.txt Initializes the PlqueryApp with a Polars DataFrame and runs the interactive Textual TUI. Users can then enter Polars expressions directly in the TUI. Requires 'polars', 'plquery', and 'pathlib'. ```python import polars as pl from plquery import PlqueryApp, read_df import pathlib # Load data and create the app df = read_df(pathlib.Path("sales.parquet")) app = PlqueryApp(df) # Run the interactive TUI app.run() # Once in the TUI, enter Polars expressions in the input field: # df.select(pl.col("product"), pl.col("revenue")) # df.filter(pl.col("revenue") > 1000) # df.group_by("category").agg(pl.sum("revenue")) # df.describe() # df.head(10) ``` -------------------------------- ### Launch plquery TUI (Bash) Source: https://context7.com/pavelzw/plquery/llms.txt Launches the plquery interactive terminal UI. Accepts a path to a parquet or CSV file as an argument. Supports direct execution or via package managers like pixi and uvx. ```bash # Using the full command name plquery my-data.parquet # Using the short alias plq my-data.parquet # Loading a CSV file plquery dataset.csv # Running in a temporary environment with pixi pixi exec plquery my-df.parquet # Running in a temporary environment with uvx uvx plquery my-df.parquet ``` -------------------------------- ### Read DataFrame from File (Python) Source: https://context7.com/pavelzw/plquery/llms.txt Reads a dataframe from a specified file path, supporting both CSV and parquet formats. It returns a Polars DataFrame object. Requires the 'pathlib' and 'plquery' libraries. ```python import pathlib from plquery import read_df # Read a parquet file df = read_df(pathlib.Path("data.parquet")) print(df.head()) # Read a CSV file df = read_df(pathlib.Path("data.csv")) print(df.shape) # Example output for parquet file: # shape: (5, 3) # ┌─────┬───────┬────────┐ # │ id │ name │ value │ # │ --- │ --- │ --- │ # │ i64 │ str │ f64 │ # ╞═════╪═══════╪════════╡ # │ 1 │ Alice │ 100.0 │ # │ 2 │ Bob │ 200.5 │ # │ 3 │ Carol │ 150.25 │ # └─────┴───────┴────────┘ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.