Skip to main content

LINQ-for-objects style queries for Python iterables.

Project description

asq is simple implementation of a LINQ-inspired API for Python which operates over Python iterables, including a parallel version implemented in terms of the Python standard library multiprocessing module.

What It Does

asq is a package implementing queries over iterables of Python objects. asq provides a fluent interface making extensive use of method chaining to create complex queries without compromising readability. For example, to take the first five uppercased results from a list of words sorted by length and then alphabetically, try:

>>> from asq import query
>>> words = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]
>>> query(words).order_by(len).then_by().take(5).select(str.upper).to_list()
['ONE', 'SIX', 'TEN', 'TWO', 'FIVE']

Over 40 standard query operators are provided together with various utilities to make the API even more convenient to use in Python.

How to get it

asq is available on the Python Package Index and can be installed with easy_install from setuptools:

$ pip install asq

Alternatively you can download and unpack the source and install using:

$ cd asq-1.2
$ python setup.py install

Requirements

This version of asq works with and 2.7 and higher, including Python 3. It is tested on Python 2.7, Python 3.3, Python 3.4 and Python 3.5. Furthermore it is tested on IronPython 2.7.

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

asq-1.3.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

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

asq-1.3-py2.py3-none-any.whl (31.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file asq-1.3.tar.gz.

File metadata

  • Download URL: asq-1.3.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for asq-1.3.tar.gz
Algorithm Hash digest
SHA256 aeed1e56369372a6666f69facb890c10a8e8a6c5b8898119ca5330b4bb879f7b
MD5 9611fec279eb82b7efbac61137d2f6cd
BLAKE2b-256 fd1355ea50a81ddd93a02fa49ead6e69cf7e7d19f328eb4e77a46218ae5f1262

See more details on using hashes here.

File details

Details for the file asq-1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: asq-1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for asq-1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6b5764aeb552679cd75e96bd7080a848a18b04f784328b5f6e8476e5176c0cbe
MD5 bad7d6cb42b831eeddd89d69a9beeebc
BLAKE2b-256 261bfa14c1101a40819652718701ad6b149dd009131d7b408efb1a834a688f4f

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