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

Uploaded Source

Built Distribution

linqex-1.2.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: linqex-1.2.1.tar.gz
  • Upload date:
  • Size: 6.8 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.1.tar.gz
Algorithm Hash digest
SHA256 95f702b31180badf7d762efa809f1fa4bfd60773d89f527ee681138d25395ddf
MD5 2297bd83b190535eabecc05b59e8d956
BLAKE2b-256 9ff128e59872b3ed270beb2069fbb020e8a5709a473c34a03130d7c3e4788088

See more details on using hashes here.

File details

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

File metadata

  • Download URL: linqex-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a67608c58c57efd9e246e61e28f36d25d201e8aafcc13385f8475d78795800e
MD5 02eef14203fa0ef0ec63353565c39df2
BLAKE2b-256 3dbee6766b70d101f18974f851ba20dccbe402ec674d54bb67a0e73e9d420459

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