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

Uploaded Source

Built Distribution

linqex-1.4-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for linqex-1.4.tar.gz
Algorithm Hash digest
SHA256 a708ea6284cea698dd73202ae8d295676df3013347891011c86b3451fd5baf2a
MD5 80629984a594bb108228c1646a73b35f
BLAKE2b-256 96e777a92203397170b02c55aa8f4e2fde2d56c8ec58cb152928d847a667347d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: linqex-1.4-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d02283a09eee7c63f14c74aee853f1f3b708d26e730d8393ef548d91a0e22d29
MD5 7edf50b62d2b0d63d6844752788447eb
BLAKE2b-256 c4a3586dd10a83a94841b939610694f89aa9bdc4e7a56653e88f6c4b619abca3

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