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 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


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)

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.3-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

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

Hashes for linq_py_net-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f8d7a7d60e2a16a901283b625dcb3e4a41242ade194dc502e959032d79771cf9
MD5 a35559435a159ab36aeaf562c544f5d9
BLAKE2b-256 b721200d9c460184f62c2f3ffd653ad61f30f7ce4e056d52c9841ad8abbb9989

See more details on using hashes here.

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

Hashes for linq_py_net-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77d37e433f96bd1fe4a76ba17eb83fd1437372382d007fcf6d49d7b2c1567314
MD5 1e389aa272b049e471cc3f5c0bd3543e
BLAKE2b-256 79cdf639174e875061456563fbc9c72ce30b3b9be53799040d4377792d6142ba

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