Skip to main content

Brings LINQ to Python

Project description

LINQ

Provides simple to use LINQ features to Python 3.x.

Documentation

See this link: https://jakkes.github.io/python-linq/

Installing

From pip

pip install python-linq

From source

git clone https://github.com/jakkes/python-linq.git
cd python-linq
pip install -r requirements.txt

Usage

  1. Import the Query class
  2. Write beautiful queries!
>>> from linq import Query
>>> x = Query([1, 2, 3]).select(lambda x: x * x + 3).to_list()
>>> assert x == [4, 7, 12]

Distribute heavy queries across multiple processes.

>>> import time
>>> from linq import DistributedQuery
>>> 
>>> def heavy_transformation(x: int):
>>>     time.sleep(10)
>>>     return x*2
>>> 
>>> def less_than_5(x: int):
>>>     return x < 5
>>> 
>>> x = (
>>>     DistributedQuery(range(100))
>>>     .where(less_than_5)
>>>     .select(heavy_transformation)
>>>     .to_list()
>>> )
>>> assert x == [0, 1, 4, 9, 16]

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

python-linq-2.0.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_linq-2.0.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file python-linq-2.0.0.tar.gz.

File metadata

  • Download URL: python-linq-2.0.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for python-linq-2.0.0.tar.gz
Algorithm Hash digest
SHA256 697de56c20effddd7bba241becdaa0817e65e53bc44c9b4411cca121c266ff22
MD5 db0e1ea23b55b733c98a67495c6b8a7c
BLAKE2b-256 45893665fae1fdac36418fde8e7fdb12754cd9a5d2d61763fc4750870e7c9a30

See more details on using hashes here.

File details

Details for the file python_linq-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_linq-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for python_linq-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aef295f28717d01b23d7e120bf3ac2789ebc06dac9c955f3825fdd2d5e7582ed
MD5 6bfc4d748965f5fdf3e554129f683e32
BLAKE2b-256 9d717f41008b80392c5a49757f506801a391fd5c1a71a1ec1b9fa076ccb980b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page