polars-cli


Namepolars-cli JSON
Version 0.7.0 PyPI version JSON
download
home_page
SummaryCLI interface for running SQL queries with Polars as backend
upload_time2024-03-07 10:20:27
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords dataframe arrow out-of-core sql
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Polars CLI

[![Crates.io](https://img.shields.io/crates/v/polars-cli)](https://crates.io/crates/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.

## Installation

The recommended way to install the Polars CLI is by using [pip](https://pip.pypa.io/):

```bash
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](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 polars-cli
```

## Usage

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

```shell
$ 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.

```bash
$ 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     |


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "polars-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "dataframe,arrow,out-of-core,sql",
    "author": "",
    "author_email": "Ritchie Vink <ritchie46@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/5c/65/1f8ab5be9ae0f79674ed0d03c9efd1e682b32f1114d069ac65fcf4b3bdc1/polars_cli-0.7.0.tar.gz",
    "platform": null,
    "description": "# Polars CLI\n\n[![Crates.io](https://img.shields.io/crates/v/polars-cli)](https://crates.io/crates/polars-cli)\n[![PyPI](https://img.shields.io/pypi/v/polars-cli)](https://pypi.org/project/polars-cli/)\n\nThe Polars command line interface provides a convenient way to execute SQL commands using Polars as a backend.\n\n## Installation\n\nThe recommended way to install the Polars CLI is by using [pip](https://pip.pypa.io/):\n\n```bash\npip install polars-cli\n```\n\nThis will install a pre-compiled binary and make it available on your path under `polars`.\nIf 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/).\n\nAlternatively, you can install the Polars CLI using [cargo](https://doc.rust-lang.org/cargo/), which will compile the code from scratch:\n\n```bash\ncargo install --locked polars-cli\n```\n\n## Usage\n\nRunning `polars` without any arguments will start an interactive shell in which you can run SQL commands.\n\n```shell\n$ polars\nPolars CLI version 0.4.0\nType .help for help.\n\n>> select * FROM read_csv('examples/datasets/foods.csv');\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 category   \u2506 calories \u2506 fats_g \u2506 sugars_g \u2502\n\u2502 ---        \u2506 ---      \u2506 ---    \u2506 ---      \u2502\n\u2502 str        \u2506 i64      \u2506 f64    \u2506 i64      \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 vegetables \u2506 45       \u2506 0.5    \u2506 2        \u2502\n\u2502 seafood    \u2506 150      \u2506 5.0    \u2506 0        \u2502\n\u2502 meat       \u2506 100      \u2506 5.0    \u2506 0        \u2502\n\u2502 fruit      \u2506 60       \u2506 0.0    \u2506 11       \u2502\n\u2502 \u2026          \u2506 \u2026        \u2506 \u2026      \u2506 \u2026        \u2502\n\u2502 seafood    \u2506 200      \u2506 10.0   \u2506 0        \u2502\n\u2502 seafood    \u2506 200      \u2506 7.0    \u2506 2        \u2502\n\u2502 fruit      \u2506 60       \u2506 0.0    \u2506 11       \u2502\n\u2502 meat       \u2506 110      \u2506 7.0    \u2506 0        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\nAlternatively, SQL commands can be piped directly into the Polars CLI.\n\n```bash\n$ echo \"SELECT category FROM read_csv('examples/datasets/foods.csv')\" | polars\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 category   \u2502\n\u2502 ---        \u2502\n\u2502 str        \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 vegetables \u2502\n\u2502 seafood    \u2502\n\u2502 meat       \u2502\n\u2502 fruit      \u2502\n\u2502 \u2026          \u2502\n\u2502 seafood    \u2502\n\u2502 seafood    \u2502\n\u2502 fruit      \u2502\n\u2502 meat       \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Features\n\nWhen compiling the Polars CLI from source, the following features can be enabled:\n\n| Feature   | Description                                               |\n| --------- | --------------------------------------------------------- |\n| default   | The default feature set that includes all other features. |\n| highlight | Provides syntax highlighting                              |\n| parquet   | Enables reading and writing of Apache Parquet files.      |\n| json      | Enables reading and writing of JSON files.                |\n| ipc       | Enables reading and writing of IPC/Apache Arrow files     |\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI interface for running SQL queries with Polars as backend",
    "version": "0.7.0",
    "project_urls": {
        "Changelog": "https://github.com/pola-rs/polars-cli/releases",
        "Documentation": "https://github.com/pola-rs/polars-cli",
        "Homepage": "https://www.pola.rs/",
        "Repository": "https://github.com/pola-rs/polars-cli"
    },
    "split_keywords": [
        "dataframe",
        "arrow",
        "out-of-core",
        "sql"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e40bf102c34f0c53f4321e66c3fb106703f2a2573d077f87233e8a91a1bb6528",
                "md5": "a241265860afda921b3777136001d7cd",
                "sha256": "5d04b4be1f013c5a22d0f92d6b9ce903c4762e145c35e9148226854e89f6d2e3"
            },
            "downloads": -1,
            "filename": "polars_cli-0.7.0-py3-none-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a241265860afda921b3777136001d7cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10188859,
            "upload_time": "2024-03-07T10:20:13",
            "upload_time_iso_8601": "2024-03-07T10:20:13.493148Z",
            "url": "https://files.pythonhosted.org/packages/e4/0b/f102c34f0c53f4321e66c3fb106703f2a2573d077f87233e8a91a1bb6528/polars_cli-0.7.0-py3-none-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7391cf4a7cff10374461a5a8ec9f4a8fdc66bb2c8d22a0dc8ddaf4d10d7aaec3",
                "md5": "d3a7bbe7a2f35f02a31a302316b4760c",
                "sha256": "3074b8b30349cf2d2ef4ff2e1f6e0bc02fb887e80ceb9b6cb394bfde929fa1e6"
            },
            "downloads": -1,
            "filename": "polars_cli-0.7.0-py3-none-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "d3a7bbe7a2f35f02a31a302316b4760c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8683171,
            "upload_time": "2024-03-07T10:20:16",
            "upload_time_iso_8601": "2024-03-07T10:20:16.613229Z",
            "url": "https://files.pythonhosted.org/packages/73/91/cf4a7cff10374461a5a8ec9f4a8fdc66bb2c8d22a0dc8ddaf4d10d7aaec3/polars_cli-0.7.0-py3-none-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d1b19755dce19342d74c9888e804c8f602f9de17ed7eb65de6d7f5bfea1fa0d",
                "md5": "332f0dea75830fd585ea55dcd1c76615",
                "sha256": "b35bbd2bba3839a2ed2bca72bf70af82019bbee8eeaa4f4e22a6ab29fe2c8a10"
            },
            "downloads": -1,
            "filename": "polars_cli-0.7.0-py3-none-manylinux_2_28_aarch64.whl",
            "has_sig": false,
            "md5_digest": "332f0dea75830fd585ea55dcd1c76615",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9959588,
            "upload_time": "2024-03-07T10:20:18",
            "upload_time_iso_8601": "2024-03-07T10:20:18.727634Z",
            "url": "https://files.pythonhosted.org/packages/7d/1b/19755dce19342d74c9888e804c8f602f9de17ed7eb65de6d7f5bfea1fa0d/polars_cli-0.7.0-py3-none-manylinux_2_28_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "10580a5ff2d843c67bb69ec3d3fdbc1ab97fb9cca77fcc2fe431537d2c21f0a3",
                "md5": "8b439c69f4375c5fc2f834ec3a4d0d52",
                "sha256": "6b2f242b9d0c04e413c34002dd12a92cd1a9d88c833b0523042f2d4b14575160"
            },
            "downloads": -1,
            "filename": "polars_cli-0.7.0-py3-none-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "8b439c69f4375c5fc2f834ec3a4d0d52",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11307516,
            "upload_time": "2024-03-07T10:20:20",
            "upload_time_iso_8601": "2024-03-07T10:20:20.826678Z",
            "url": "https://files.pythonhosted.org/packages/10/58/0a5ff2d843c67bb69ec3d3fdbc1ab97fb9cca77fcc2fe431537d2c21f0a3/polars_cli-0.7.0-py3-none-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "636c1a00f96f4b2140381f63b6b8dd8ebf963d274c38484e8d1fa608a50b1052",
                "md5": "2eeda6381b7cbbf7db71177fecfbecda",
                "sha256": "4c6fac69251b0d0baf91dba1f8c2f81416ecad84c3b8420b2eb50f209f84bb90"
            },
            "downloads": -1,
            "filename": "polars_cli-0.7.0-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2eeda6381b7cbbf7db71177fecfbecda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9862347,
            "upload_time": "2024-03-07T10:20:24",
            "upload_time_iso_8601": "2024-03-07T10:20:24.799473Z",
            "url": "https://files.pythonhosted.org/packages/63/6c/1a00f96f4b2140381f63b6b8dd8ebf963d274c38484e8d1fa608a50b1052/polars_cli-0.7.0-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c651f8ab5be9ae0f79674ed0d03c9efd1e682b32f1114d069ac65fcf4b3bdc1",
                "md5": "6d76889f5871e54915690b78315623ab",
                "sha256": "2debc3d59e9a2b46c426b55037e406a5c0f24fa1cbbfc09cf33fbe1d148bad43"
            },
            "downloads": -1,
            "filename": "polars_cli-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6d76889f5871e54915690b78315623ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 34685,
            "upload_time": "2024-03-07T10:20:27",
            "upload_time_iso_8601": "2024-03-07T10:20:27.149904Z",
            "url": "https://files.pythonhosted.org/packages/5c/65/1f8ab5be9ae0f79674ed0d03c9efd1e682b32f1114d069ac65fcf4b3bdc1/polars_cli-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 10:20:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pola-rs",
    "github_project": "polars-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "polars-cli"
}
        
Elapsed time: 0.20777s