Skip to main content

The linq module in C# has been adapted for python with some modifications.

Project description

Contributors Forks Stargazers Issues MIT License LinkedIn

Python Linqex

The linq module in C# has been adapted for python with some modifications.

Changelog · Report Bug · Request Feature

About The Project

Provides simple to use LINQ features to Python 3.x.

Built With

  • Python

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Does not require any prerequisites

Installation

  1. Clone the repo
git clone https://github.com/TahsinCr/python-linqex.git
  1. Install PIP packages
pip install linqex

Usage

Let's have different customers. Let's choose the male ones among these customers. For this:

from linqex.linq import Enumerable
customers_list = [
    {'name' : 'Jonh', 'age' : 25, 'gender': 'male'}
    {'name' : 'Emma', 'age' : 44, 'gender': 'female'}
    {'name' : 'Steve', 'age' : 17, 'gender': 'male'}
]

customers_enumerable = Enumerable(customers_list)

# to select only male ones:
customers_male_enumerable = customers_enumerable.where(lambda key,value: value['gender'] == 'male')

for customer in customers_male_enumerable.toValue:
    print(customer)

Output

{'name' : 'Jonh', 'age' : 25, 'gender': 'male'}
{'name' : 'Steve', 'age' : 17, 'gender': 'male'}

For more examples, please refer to the Documentation

License

Distributed under the MIT License. See LICENSE.txt for more information.


Contact

Tahsin Çirkin - @TahsinCrs - TahsinCr@outlook.com

Project Link: https://github.com/TahsinCr/python-linqex

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

linqex-1.2.2.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

linqex-1.2.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file linqex-1.2.2.tar.gz.

File metadata

  • Download URL: linqex-1.2.2.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for linqex-1.2.2.tar.gz
Algorithm Hash digest
SHA256 0b4e11e19632fc2c6f821789fc7af7aa10d742b377d43671429d7f58e34969ef
MD5 25e282adcc5d45b3852a7041e3402b1b
BLAKE2b-256 96f3f06cadc2c86bc22ded88f3b82ded3e5ff70b710f574c64f5ac81a6f4ddc1

See more details on using hashes here.

File details

Details for the file linqex-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: linqex-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for linqex-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb9dbc4741e6a611cd2d0e30f294135d9a06c27eb0ae498b20b74381c22b5aa6
MD5 f0f3806ac3821758d0b39a332aa725ce
BLAKE2b-256 b59373c9e074e2c8bdb8ae9dc3a3a2740b2e30e4cadb7fc74d579340a9953157

See more details on using hashes here.

Supported by

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