Extensions methods for the list, inspired in linq csharp
Project description
linq_py_net
The linq_py_net package is used to manage list collections:
| methods | description |
|---|---|
| where | filter itens by lambda predicate |
| count | count itens, lambda predicate is optiona |
| first_or_default | find first item on the sequence, predicate is optional |
| select | project data from list |
Installation
Use the package manager pip to install linq_py_net
pip install linq-py-net
Usage
from linq_py_net import Linq
linq = Linq([1,2,3,4,5,6,7,8,9,10])
linq.first_or_default() # 1
pares = linq.where(lambda x: x % 2 == 0) # [2,4,6,8,10]
pares.count() # 5
pares.count(lambda x: x > 6) # 2
project = (
linq.where(lambda x: x % 2 == 0)
.select(lambda x: { "item": x })
)
Author
Wellington Junior
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
linq_py_net-0.0.3.tar.gz
(1.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linq_py_net-0.0.3.tar.gz.
File metadata
- Download URL: linq_py_net-0.0.3.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d7a7d60e2a16a901283b625dcb3e4a41242ade194dc502e959032d79771cf9
|
|
| MD5 |
a35559435a159ab36aeaf562c544f5d9
|
|
| BLAKE2b-256 |
b721200d9c460184f62c2f3ffd653ad61f30f7ce4e056d52c9841ad8abbb9989
|
File details
Details for the file linq_py_net-0.0.3-py3-none-any.whl.
File metadata
- Download URL: linq_py_net-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77d37e433f96bd1fe4a76ba17eb83fd1437372382d007fcf6d49d7b2c1567314
|
|
| MD5 |
1e389aa272b049e471cc3f5c0bd3543e
|
|
| BLAKE2b-256 |
79cdf639174e875061456563fbc9c72ce30b3b9be53799040d4377792d6142ba
|