Skip to main content

CLI interface for running SQL queries with Polars as backend

Project description

Polars CLI

Installation

Until binaries are available, the only way to install the Polars CLI is by building it from source:

cargo +nightly install --locked polars-cli

Alternatively, clone the repository and install the latest version on the main branch:

cargo install --locked --path .

Prerequisites

  1. rustup: which provides the cargo executable. You can get it from the official website.
  2. rustup install nightly - The nightly version of rust, since some of our dependencies use unstable features.

Usage

$ polars
Polars CLI version 0.3.0
Type .help for help.

>> select * FROM read_csv('examples/datasets/foods1.csv');
┌────────────┬──────────┬────────┬──────────┐
│ category    calories  fats_g  sugars_g │
│ ---         ---       ---     ---      │
│ str         i64       f64     i64      │
╞════════════╪══════════╪════════╪══════════╡
│ vegetables  45        0.5     2        │
│ seafood     150       5.0     0        │
│ meat        100       5.0     0        │
│ fruit       60        0.0     11       │
│                                    │
│ seafood     200       10.0    0        │
│ seafood     200       7.0     2        │
│ fruit       60        0.0     11       │
│ meat        110       7.0     0        │
└────────────┴──────────┴────────┴──────────┘

Or pipe your SQL command directly inline:

$ echo "SELECT category FROM read_csv('examples/datasets/foods1.csv')" | polars
┌────────────┐
│ category   │
│ ---        │
│ str        │
╞════════════╡
│ vegetables │
│ seafood    │
│ meat       │
│ fruit      │
│           │
│ seafood    │
│ seafood    │
│ fruit      │
│ meat       │
└────────────┘

Features

Feature Description
default The default feature set that includes all other features.
highlight Provides syntax highlighting
parquet Enables reading and writing of Apache Parquet files.
json Enables reading and writing of JSON files.
ipc Enables reading and writing of IPC/Apache Arrow files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_cli-0.4.0.tar.gz (32.2 kB view hashes)

Uploaded Source

Built Distributions

polars_cli-0.4.0-py3-none-win_amd64.whl (8.9 MB view hashes)

Uploaded Python 3 Windows x86-64

polars_cli-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.0 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

polars_cli-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.8 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

polars_cli-0.4.0-py3-none-macosx_11_0_arm64.whl (7.9 MB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

polars_cli-0.4.0-py3-none-macosx_10_12_x86_64.whl (9.2 MB view hashes)

Uploaded Python 3 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page