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.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

linqex-1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for linqex-1.3.tar.gz
Algorithm Hash digest
SHA256 d6ded1bcb5a944870551352f5ccd34dc7a32a0b654808b54fa9be110f6bd7094
MD5 fff58c3d63893057b3f6f14d4c6ed8cc
BLAKE2b-256 b9a8ddf26f8697db14efa9843ff4fc47748b0bc664cc4f570acbc7dc78a73dd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: linqex-1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8831c40f6e694bd6b2c0a30016f615c0fd064b4b2a5df02f3f3d7fe564ee803b
MD5 3d3028db92e9308b28beffb8896d1f0f
BLAKE2b-256 5ee62ab5c6ec1d5cf7a5eda467d514746618956857730e399c4ac916b8b53726

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