Querpyable
A Python implementation of LINQ
:bulb: Example
# Calculating the first 10000 primes
primes = (
Queryable.range(2, 1_000_000)
.where(lambda n: all(n % i != 0 for i in range(2, int(n**0.5) + 1)))
.take(10000)
.to_list()
)
# Calculating Factorials using Aggregate:
factorial = (
Queryable
.range(1, 5)
.aggregate(lambda result, current: result * current)
)
# Finding Palindromic Words in a List:
words = ["level", "hello", "world", "radar", "LINQ", "civic"]
palindromic_words = (
Queryable(words)
.where(lambda word: word == word[::-1])
.to_list()
)
# Selecting Unique Characters from a Sentence:
sentence = "LINQ is fun and powerful"
unique_characters = (
Queryable(sentence)
.where(lambda char: char.isalpha())
.select(lambda char: char.lower())
.distinct()
.to_list()
)
:cd: Installation
pip install querpyable
In order to locally set up the project please follow the instructions below:
# Set up the GitHub repository
git clone https://github.com/billsioros/querpyable
# Create a virtual environment using poetry and install the required dependencies
poetry shell
poetry install
# Install pre-commit hooks
pre-commit install --install-hooks
pre-commit autoupdate
:book: Documentation
The project's documentation can be found here.
:heart: Support the project
Feel free to Buy me a coffee! ☕.
:sparkles: Contributing
If you would like to contribute to the project, please go through the Contributing Guidelines first.
:label: Credits
This project was generated with billsioros/cookiecutter-pypackage cookiecutter template.
Metadata
Release files for Querpyable 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| querpyable-3.0.0.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| querpyable-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.2 kB
Release files / querpyable-3.0.0.tar.gz
| Download URL | querpyable-3.0.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4faf846b60540437b985b1024515f709001cda69258de900e563576978c9ec29
|
|
BLAKE2b-256 checksum How to use checksums |
95fc9d11ccb4a74d64dd997bc63f88effa7263f3c3be204a0dc1c24f8c23a45b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.10.0 readme-renderer/43.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.2.1 tqdm/4.66.2 importlib-metadata/7.0.2 keyring/24.3.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.13
|
Release files / querpyable-3.0.0-py3-none-any.whl
| Download URL | querpyable-3.0.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0ba410210208a284c8c36582e2995ab7194077e83cd7f2a630782c01699ed7e
|
|
BLAKE2b-256 checksum How to use checksums |
7ca4f4d8cfe6ad3d9f8c8e925c05d35414c25a254ff8d73867f49f96c21ec39e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.10.0 readme-renderer/43.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.2.1 tqdm/4.66.2 importlib-metadata/7.0.2 keyring/24.3.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.13
|