Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linq_py_net-0.0.2-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

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

Hashes for linq_py_net-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e3186f250ad860ef82b4ea4872d9699b5fc8f1ad348a80b07b892bed89bd9345
MD5 c6a413552b23b40e9ec27069e498bd36
BLAKE2b-256 b420d138743fc31d36088146e5a971fc7588b68820dac3f7da47762b9a8beb18

See more details on using hashes here.

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

Hashes for linq_py_net-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af603bf4418531530d4038c6157c2f5b76be7072d4cf6c1c261427930f1fa8b0
MD5 e72ec34d090f49d6d7ad3a815d84e025
BLAKE2b-256 36a0dcbb1756576eb451358023998786ce8401c19b8a9e141c16094a631eac51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page