From 55d5bb5e3fa6a2be416749be79403dc1a15d2480 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 13 Oct 2023 00:13:34 +0200 Subject: [PATCH 1/5] ci: Disable dependabot for cargo deps --- .github/dependabot.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index defea6b..7ec32af 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,15 +11,3 @@ updates: commit-message: prefix: ci labels: ['skip changelog'] - - # Rust - - package-ecosystem: cargo - directory: '/' - schedule: - interval: monthly - ignore: - - dependency-name: '*' - update-types: ['version-update:semver-patch'] - commit-message: - prefix: 'build!:' - prefix-development: chore From 44713ff22423977413ac046fcfe2cc21b7ddb8dc Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 13 Oct 2023 21:04:27 +0200 Subject: [PATCH 2/5] lockfile --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3835457..f1d5b7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1662,9 +1662,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.18" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ "bitflags 2.4.0", "errno", From 76836a75eb9809367381084e36608fb5d05256d4 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 13 Oct 2023 21:04:34 +0200 Subject: [PATCH 3/5] Update readme --- README.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 762ee79..c55b096 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,37 @@ # Polars CLI +[![Crates.io](https://img.shields.io/crates/v/polars-cli)](https://crates.io/crates/polars-cli) +[![PyPI - Version](https://img.shields.io/pypi/v/polars-cli)](https://pypi.org/project/polars-cli/) + +The Polars command line interface provides a convenient way to execute SQL commands using Polars as a backend. + ## Installation -Until binaries are available, the only way to install the Polars CLI is by building it from source: +The recommended way to install the Polars CLI is by using [pip](https://pip.pypa.io/): ```bash -cargo +nightly install --locked polars-cli +pip install polars-cli ``` -Alternatively, clone the repository and install the latest version on the main branch: +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](https://github.com/pola-rs/polars-cli/releases/latest/). + +Alternatively, you can install the Polars CLI using [cargo](https://doc.rust-lang.org/cargo/), which will compile the code from scratch: ```bash -cargo install --locked --path . +cargo install --locked polars-cli ``` -#### Prerequisites - -1. `rustup`: which provides the `cargo` executable. You can get it from the [official website](https://rustup.rs/). -2. `rustup install nightly` - The `nightly` version of rust, since some of our dependencies use unstable features. - ## Usage +Running `polars` without any arguments will start an interactive shell in which you can run SQL commands. + ```shell $ polars -Polars CLI version 0.3.0 +Polars CLI version 0.4.0 Type .help for help. ->> select * FROM read_csv('examples/datasets/foods1.csv'); +>> select * FROM read_csv('examples/datasets/foods.csv'); ┌────────────┬──────────┬────────┬──────────┐ │ category ┆ calories ┆ fats_g ┆ sugars_g │ │ --- ┆ --- ┆ --- ┆ --- │ @@ -44,10 +49,10 @@ Type .help for help. └────────────┴──────────┴────────┴──────────┘ ``` -Or pipe your SQL command directly inline: +Alternatively, SQL commands can be piped directly into the Polars CLI. ```bash -$ echo "SELECT category FROM read_csv('examples/datasets/foods1.csv')" | polars +$ echo "SELECT category FROM read_csv('examples/datasets/foods.csv')" | polars ┌────────────┐ │ category │ │ --- │ @@ -67,6 +72,8 @@ $ echo "SELECT category FROM read_csv('examples/datasets/foods1.csv')" | polars ## 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. | From 82610053fa0eafc366e8eeacfc0c772c75292149 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 13 Oct 2023 21:36:28 +0200 Subject: [PATCH 4/5] Rename dataset --- examples/datasets/{foods1.csv => foods.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/datasets/{foods1.csv => foods.csv} (100%) diff --git a/examples/datasets/foods1.csv b/examples/datasets/foods.csv similarity index 100% rename from examples/datasets/foods1.csv rename to examples/datasets/foods.csv From ebc1ddfe313e3302f6e7e8fa86e8ab877a481835 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 13 Oct 2023 21:41:37 +0200 Subject: [PATCH 5/5] Minor update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c55b096..64896b2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Polars CLI [![Crates.io](https://img.shields.io/crates/v/polars-cli)](https://crates.io/crates/polars-cli) -[![PyPI - Version](https://img.shields.io/pypi/v/polars-cli)](https://pypi.org/project/polars-cli/) +[![PyPI](https://img.shields.io/pypi/v/polars-cli)](https://pypi.org/project/polars-cli/) The Polars command line interface provides a convenient way to execute SQL commands using Polars as a backend.