• Stars
    star
    195
  • Rank 199,374 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

asq is simple implementation of a LINQ-inspired API for Python which operates over Python iterables

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

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

$ cd asq-1.3
$ 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, and Python 3.4 to 3.7. Furthermore it is tested on IronPython 2.7.

More Repositories

1

cosmic-ray

Mutation testing for Python
Python
554
star
2

segpy

A Python package for reading and writing SEG Y files.
Python
99
star
3

python-transducers

Python
55
star
4

multiprocessing_on_dill

A friendly fork of the Python Standard Library multiprocessing package which uses dill instead of pickle
Python
34
star
5

python-camtasia

Python API for Camtasia projects.
Python
13
star
6

structurizr-python

A Python 3 port of Simon's Brown's Structurizr diagrams-as-code architecture description tool
Python
13
star
7

brooks

A software process dynamics simulator for Brooks' Law.
Python
10
star
8

elm-price-chart

An implementation of an SVG price chart in Elm.
Elm
9
star
9

rst_to_md

Markdown writer for Docutils
Python
7
star
10

emacs-wilt

Extension for calculating WILT metrics in emacs.
Emacs Lisp
6
star
11

pinventory

Ansible dynamic inventory for locating Raspberry Pi computers on the LAN.
Python
6
star
12

exit-codes

Platform-independent exit codes for Python
Python
5
star
13

cookiecutter-python-project

A standard Sixty North-style Python project cookiecutter template
Python
3
star
14

autottlcache

Time-to-live (TTL) cache dictionary with auto-expiry
Python
3
star
15

fixedpointtest

An arbitrary precision fixed-point binary number type for Python
Python
3
star
16

les_iterables

Les Itérables - a collection of utility functions for working with iterable series
Python
2
star
17

typename

A Python typename which returns the name of the type of any object as a string
Python
2
star
18

introduction-to-python

Some material for the "Introduction to Python" talk
Python
2
star
19

img2segy

Convert images (PNGs, JPEGs, etc) to 2D SEG-Y files
Python
2
star
20

euclidian

A lightweight 2D and 3D geometry library with no pretensions to be fast, or especially robust around difficult edge cases
Python
1
star