fliq


Namefliq JSON
Version 1.12.0 PyPI version JSON
download
home_page
SummaryFluent-based Lazily-evaluated Integrated Query for Python
upload_time2024-01-09 17:22:23
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT License Copyright (c) 2023 Ori Bar-ilan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords fliq lazy fluent lisp linq
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #  <img src="docs/assets/flick_emoji_2_small.png" alt="drawing" width="40" height="40"/> Fliq

Fluent-syntaxed Lazily-evaluated Integrated Query.

[//]: # (bages using https://shields.io/badges/)
[![build](https://img.shields.io/github/actions/workflow/status/oribarilan/fliq/package_build.yml)](https://github.com/oribarilan/fliq/actions/workflows/package_build.yml)
[![lint](https://img.shields.io/github/actions/workflow/status/oribarilan/fliq/lint.yml?label=lint)](https://github.com/oribarilan/fliq/actions/workflows/lint.yml)
[![coverage](https://img.shields.io/github/actions/workflow/status/oribarilan/fliq/coverage.yml?label=coverage%3E95%25)](https://github.com/oribarilan/fliq/actions/workflows/coverage.yml)

[![Python Versions](https://img.shields.io/badge/python-3.9+-blue)](https://www.python.org/downloads/)
[![PyPI - Version](https://img.shields.io/pypi/v/fliq?color=1E7FBF)](https://pypi.org/project/fliq/)
[![Downloads](https://img.shields.io/pypi/dm/fliq?color=1E7FBF)](https://pypi.org/project/fliq/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Fliq is a lightweight Python library for high-performance lazy processing of iterables.
Inspired by [Django's ORM](https://docs.djangoproject.com/en/4.2/topics/db/queries/)
and [LINQ](https://learn.microsoft.com/en-us/dotnet/standard/linq/), it provides a fluent syntax for lazily-evaluated operations on iterables, 
and it is tested to have on-par performance with the standard library.
Also, for all you type-a-holics, Fliq is fully equipped with generic type hints, so it supports mypy in strict mode.

* Documentation: [https://oribarilan.github.io/fliq](https://oribarilan.github.io/fliq)
* Source Code: [https://github.com/oribarilan/fliq](https://github.com/oribarilan/fliq)

## Installation

```shell
pip install fliq
```

* Fliq does not have any dependencies.
* Fliq supports Python 3.9 and above.

## Fliq is

- ๐Ÿ’ก **Intuitive** to use. Built for readability and usability. Fully typed.
- ๐Ÿชถ **Lightweight** wrapper for the standard library. No dependencies or bloat.
- โšก๏ธ **Efficient** as the standard library. Abstraction overhead is kept to a minimum. 
- โณ **Lazy** evaluated, executed only _when_ needed and only _as_ needed.
- ๐Ÿ”— **Versatile** by supporting any iterable type, including infinite iterables.
- ๐Ÿงฉ **Compatible** with APIs consuming iterables. No integration or setup required.

## Motivation

What is the output of the following code?
```python
next(map(lambda x: x * 2, filter(lambda x: x % 2 == 0, [1, 2, 3, 4, 5])), -1)
```

And what about this?
```python
from fliq import q

(q([1, 2, 3, 4, 5])
    .where(lambda x: x % 2 == 0)
    .select(lambda x: x * 2)
    .first(default=-1))
```

And this is just a simple example.

Python's standard library provides a rich set of functions for processing iterables.
However, it is not always easy to read and use. 

This is especially true when chaining multiple operations together.
This is where Fliq comes in.
Fliq provides a fluent, easy to read syntax for processing iterables, while keeping
performance on-par with the standard library.

## Performance

Fliq is geared for performance:

* ๐Ÿ›Œ It is lazily evaluated without requiring any intentional effort from the user.
* โšก๏ธ It is also tested to have on-par performance with the standard library.

There are two mechanisms for checking Fliq's performance: 

* ๐Ÿงช **Performance tests** are ran on every commit, and they compare Fliq's performance to the standard library.
* ๐Ÿ“Š **Benchmarking** is done against the standard library.

Here is a glimpse of the benchmarking results:
![Benchmarking](docs/assets/s2.png "Scenario 2")

You can read more about Fliq's performance [here](https://oribarilan.github.io/fliq/misc/performance/).



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fliq",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "fliq,lazy,fluent,lisp,linq",
    "author": "",
    "author_email": "Ori Bar-ilan <python.oplog@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d1/70/3842b918fcd01c24b46bdde27cf515bee94f5d80539cef08627cdf0a4534/fliq-1.12.0.tar.gz",
    "platform": null,
    "description": "#  <img src=\"docs/assets/flick_emoji_2_small.png\" alt=\"drawing\" width=\"40\" height=\"40\"/> Fliq\n\nFluent-syntaxed Lazily-evaluated Integrated Query.\n\n[//]: # (bages using https://shields.io/badges/)\n[![build](https://img.shields.io/github/actions/workflow/status/oribarilan/fliq/package_build.yml)](https://github.com/oribarilan/fliq/actions/workflows/package_build.yml)\n[![lint](https://img.shields.io/github/actions/workflow/status/oribarilan/fliq/lint.yml?label=lint)](https://github.com/oribarilan/fliq/actions/workflows/lint.yml)\n[![coverage](https://img.shields.io/github/actions/workflow/status/oribarilan/fliq/coverage.yml?label=coverage%3E95%25)](https://github.com/oribarilan/fliq/actions/workflows/coverage.yml)\n\n[![Python Versions](https://img.shields.io/badge/python-3.9+-blue)](https://www.python.org/downloads/)\n[![PyPI - Version](https://img.shields.io/pypi/v/fliq?color=1E7FBF)](https://pypi.org/project/fliq/)\n[![Downloads](https://img.shields.io/pypi/dm/fliq?color=1E7FBF)](https://pypi.org/project/fliq/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nFliq is a lightweight Python library for high-performance lazy processing of iterables.\nInspired by [Django's ORM](https://docs.djangoproject.com/en/4.2/topics/db/queries/)\nand [LINQ](https://learn.microsoft.com/en-us/dotnet/standard/linq/), it provides a fluent syntax for lazily-evaluated operations on iterables, \nand it is tested to have on-par performance with the standard library.\nAlso, for all you type-a-holics, Fliq is fully equipped with generic type hints, so it supports mypy in strict mode.\n\n* Documentation: [https://oribarilan.github.io/fliq](https://oribarilan.github.io/fliq)\n* Source Code: [https://github.com/oribarilan/fliq](https://github.com/oribarilan/fliq)\n\n## Installation\n\n```shell\npip install fliq\n```\n\n* Fliq does not have any dependencies.\n* Fliq supports Python 3.9 and above.\n\n## Fliq is\n\n- \ud83d\udca1 **Intuitive** to use. Built for readability and usability. Fully typed.\n- \ud83e\udeb6 **Lightweight** wrapper for the standard library. No dependencies or bloat.\n- \u26a1\ufe0f **Efficient** as the standard library. Abstraction overhead is kept to a minimum. \n- \u23f3 **Lazy** evaluated, executed only _when_ needed and only _as_ needed.\n- \ud83d\udd17 **Versatile** by supporting any iterable type, including infinite iterables.\n- \ud83e\udde9 **Compatible** with APIs consuming iterables. No integration or setup required.\n\n## Motivation\n\nWhat is the output of the following code?\n```python\nnext(map(lambda x: x * 2, filter(lambda x: x % 2 == 0, [1, 2, 3, 4, 5])), -1)\n```\n\nAnd what about this?\n```python\nfrom fliq import q\n\n(q([1, 2, 3, 4, 5])\n    .where(lambda x: x % 2 == 0)\n    .select(lambda x: x * 2)\n    .first(default=-1))\n```\n\nAnd this is just a simple example.\n\nPython's standard library provides a rich set of functions for processing iterables.\nHowever, it is not always easy to read and use. \n\nThis is especially true when chaining multiple operations together.\nThis is where Fliq comes in.\nFliq provides a fluent, easy to read syntax for processing iterables, while keeping\nperformance on-par with the standard library.\n\n## Performance\n\nFliq is geared for performance:\n\n* \ud83d\udecc It is lazily evaluated without requiring any intentional effort from the user.\n* \u26a1\ufe0f It is also tested to have on-par performance with the standard library.\n\nThere are two mechanisms for checking Fliq's performance: \n\n* \ud83e\uddea **Performance tests** are ran on every commit, and they compare Fliq's performance to the standard library.\n* \ud83d\udcca **Benchmarking** is done against the standard library.\n\nHere is a glimpse of the benchmarking results:\n![Benchmarking](docs/assets/s2.png \"Scenario 2\")\n\nYou can read more about Fliq's performance [here](https://oribarilan.github.io/fliq/misc/performance/).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Ori Bar-ilan  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Fluent-based Lazily-evaluated Integrated Query for Python",
    "version": "1.12.0",
    "project_urls": {
        "Homepage": "https://github.com/oribarilan/fliq"
    },
    "split_keywords": [
        "fliq",
        "lazy",
        "fluent",
        "lisp",
        "linq"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e275e44ccd4b611c7a451bc7e9bcc6be82a1fdb3e1b4de4626703e6e2c44f743",
                "md5": "4de5babbd56181a3a07415a671699b46",
                "sha256": "06db57916e8e03d449fa17a19156d82b5eb8165393f35004c60ed44324129718"
            },
            "downloads": -1,
            "filename": "fliq-1.12.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4de5babbd56181a3a07415a671699b46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 47212,
            "upload_time": "2024-01-09T17:22:21",
            "upload_time_iso_8601": "2024-01-09T17:22:21.822043Z",
            "url": "https://files.pythonhosted.org/packages/e2/75/e44ccd4b611c7a451bc7e9bcc6be82a1fdb3e1b4de4626703e6e2c44f743/fliq-1.12.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d1703842b918fcd01c24b46bdde27cf515bee94f5d80539cef08627cdf0a4534",
                "md5": "15a5b5aa6b042c6274d3bffa207d8d60",
                "sha256": "bdb6450cef48ccc704382cafe25ac5e884abe59fb1eb652b059b1559527f56fe"
            },
            "downloads": -1,
            "filename": "fliq-1.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "15a5b5aa6b042c6274d3bffa207d8d60",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 353248,
            "upload_time": "2024-01-09T17:22:23",
            "upload_time_iso_8601": "2024-01-09T17:22:23.595400Z",
            "url": "https://files.pythonhosted.org/packages/d1/70/3842b918fcd01c24b46bdde27cf515bee94f5d80539cef08627cdf0a4534/fliq-1.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-09 17:22:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oribarilan",
    "github_project": "fliq",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "fliq"
}
        
Elapsed time: 0.15923s