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 List
linq = List([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.2.tar.gz
(1.9 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.2.tar.gz.
File metadata
- Download URL: linq_py_net-0.0.2.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3186f250ad860ef82b4ea4872d9699b5fc8f1ad348a80b07b892bed89bd9345
|
|
| MD5 |
c6a413552b23b40e9ec27069e498bd36
|
|
| BLAKE2b-256 |
b420d138743fc31d36088146e5a971fc7588b68820dac3f7da47762b9a8beb18
|
File details
Details for the file linq_py_net-0.0.2-py3-none-any.whl.
File metadata
- Download URL: linq_py_net-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.1 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 |
af603bf4418531530d4038c6157c2f5b76be7072d4cf6c1c261427930f1fa8b0
|
|
| MD5 |
e72ec34d090f49d6d7ad3a815d84e025
|
|
| BLAKE2b-256 |
36a0dcbb1756576eb451358023998786ce8401c19b8a9e141c16094a631eac51
|