Skip to main content

Linq for python

Project description

Linq for Python

What's that

Simple Language integrated query for Python

This package helps you write queries on Iterable objects in python

It makes it easy to deal with iterators.

Why should i use this?

Well you should not! i mean you don't need such thing at all. python has already fully implemented methods for iterables, but if you used to Linq in C# ( like me ), you are probably want to use such package.

How to?

Well it's super easy

Let's take a look at the examples

from ipyquery import Linq

my_list = Linq([5, 1, 7, 2, 3, 10, 1, 4, 5])

powered_cleaned = my_list.distinct().where(
    lambda x: x <= 5).orderby().select(lambda x: x**2).tolist()

print(powered_cleaned)

# [1, 4, 9, 16, 25]

You can use methods to do whatever you want with your list just that easy!

More Examples?

Take a look at tests folder ( There are a lot to explore )

Currently available methods

Below you can see all currently available methods, all of these can be used on Linq object ( which contains your list )

  • select
  • select_many
  • enum_select
  • tolist
  • todict
  • groupby
  • where
  • first
  • first_or_default
  • any
  • all
  • orderby
  • orderby_desc
  • max
  • min
  • sum
  • average
  • distinct
  • single
  • single_or_default

Don't worry will add more methods.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ipyquery-0.0.4-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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