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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for linqex-1.2.tar.gz
Algorithm Hash digest
SHA256 43dfd0b6ab3c385f95ba3211ea06775fdc07fa3d5cb3856ef7e421729a25f49d
MD5 9546812ed55ca39e67f49a0ec473d98e
BLAKE2b-256 2a5bc966199e504ea1621cdeb9f0f4e014dfefb071638c4e629cd97f0d2b1e65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: linqex-1.2-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.1

File hashes

Hashes for linqex-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c547958aa0ae82d311d5d3cdb9d99061d85400b5b4a92c51726dcf6e0ff808c7
MD5 c21a5bbaccae932a9aac4a679bc54429
BLAKE2b-256 349d4ea34040b90eea0cbb06b23efa224ee37b1686ee9a2635d6de853cab4064

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