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.

Documentation

Of course, there is full Narrative and reference documentation for asq

Status

Build status:

Build Status Documentation Status

How to get it

asq is available on the Python Package Index and can be installed with easy_install or pip:

$ pip install asq

Requirements

This version of asq works with and 3.9 and higher

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-2.0.0.tar.gz (44.9 kB view hashes)

Uploaded Source

Built Distribution

asq-2.0.0-py3-none-any.whl (29.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