Skip to main content

CLI interface for running SQL queries with Polars as backend

Project description

Polars CLI

Crates.io PyPI

The Polars command line interface provides a convenient way to execute SQL commands using Polars as a backend.

Installation

The recommended way to install the Polars CLI is by using pip:

pip install polars-cli

This will install a pre-compiled binary and make it available on your path under polars. If you do not have Python available, you can download a suitable binary from the most recent GitHub release.

Alternatively, you can install the Polars CLI using cargo, which will compile the code from scratch:

cargo install --locked polars-cli

Usage

Running polars without any arguments will start an interactive shell in which you can run SQL commands.

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

>> select * FROM read_csv('examples/datasets/foods.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        │
└────────────┴──────────┴────────┴──────────┘

Alternatively, SQL commands can be piped directly into the Polars CLI.

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

Features

When compiling the Polars CLI from source, the following features can be enabled:

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.9.0.tar.gz (35.2 kB view details)

Uploaded Source

Built Distributions

polars_cli-0.9.0-py3-none-win_amd64.whl (12.9 MB view details)

Uploaded Python 3Windows x86-64

polars_cli-0.9.0-py3-none-manylinux_2_28_x86_64.whl (14.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

polars_cli-0.9.0-py3-none-manylinux_2_28_aarch64.whl (12.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

polars_cli-0.9.0-py3-none-macosx_11_0_arm64.whl (13.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

polars_cli-0.9.0-py3-none-macosx_10_12_x86_64.whl (15.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file polars_cli-0.9.0.tar.gz.

File metadata

  • Download URL: polars_cli-0.9.0.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for polars_cli-0.9.0.tar.gz
Algorithm Hash digest
SHA256 9d8ddaebd87e4280839eb3755217d7e7dcdef70873f152ac8d7e09dca71cde99
MD5 60eba862b107c37d5c20d1ead5d08eb7
BLAKE2b-256 8b86572d41c5f5591f1ce27a8da6689764f9de5c5cd993dd0c22be88002746d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_cli-0.9.0.tar.gz:

Publisher: release.yml on pola-rs/polars-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polars_cli-0.9.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: polars_cli-0.9.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for polars_cli-0.9.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 72c45441a15a435c239227b7db2df02490ea7f4f8e49ae79f62fe0ec8e2581cf
MD5 60c383034b14ed01c214f511048332ea
BLAKE2b-256 caceea444f8d738e0779312ca179f808583f342d853c9a0aaab726ae8543720b

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_cli-0.9.0-py3-none-win_amd64.whl:

Publisher: release.yml on pola-rs/polars-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polars_cli-0.9.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polars_cli-0.9.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8a31fb708594b54faf16753fffb1252bcfea0c783ec47c6a58c71d1bdab04294
MD5 a0bf800ed885095ef1e6181595fbaff8
BLAKE2b-256 413dde27ba695a5ed6c28733da09ce626154f8d01de96f2dba77a6a05c76300c

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_cli-0.9.0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on pola-rs/polars-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polars_cli-0.9.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for polars_cli-0.9.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 24886d842cc2681f0a4e55c3c8cfac857fc51aa880ba1dd00e6ed0d7811ebfd5
MD5 f1a2de375f8df8daf0bdb31bbe5a7f95
BLAKE2b-256 a13ffa898ed6f57aa86a134ac6ebd1f2cbc0919d95d930f8e55cea4f11053c87

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_cli-0.9.0-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on pola-rs/polars-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polars_cli-0.9.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_cli-0.9.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 844f2983e9720cd282cee2265cf9a484e54d61dcd049a5bab50bcba6079b127f
MD5 c73b2a432b5f3602580d2a430c275198
BLAKE2b-256 aa065302e10ecfeb397d51afe0fa0906454aaf92cc9a2270a23d1f43538ca1d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_cli-0.9.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on pola-rs/polars-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polars_cli-0.9.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_cli-0.9.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e34d5b646b0fc11a95b227cb94e626268ec7f6f2bed6f5f3d1c8fc3193ab6f84
MD5 e878ff8c242b5e11091c38f97c340631
BLAKE2b-256 c5f0ef901dd46730fdbf37adf2a2f2a2ef6735b453ffcad729a90ba0cb9a0b66

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_cli-0.9.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on pola-rs/polars-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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