Skip to main content

A collection of useful functions operating on iterables

Project description

PyAoI (Python Algorithms on Iterables)

Join the chat at https://gitter.im/pyaoi/community Build Status img Conventional Commits pre-commit

This project provides convenient functions to process iterables, it is inspired by the algorithm header from the C++ standard template library (STL for short).

Installation

pip install pyaoi

How to use

All functions live in the pyaoi namespace, you can import it with import pyaoi and then call the functions like this: pyaio.all_of()

Implemented functions

The following list shows planned functions and whether they are implemented yet. Feel free to make a PR for a listed function's implementation. This list is subject to change at any time.

Click to expand!

Non-modifying sequence operations

  • all_of

  • any_of

  • none_of

  • for_each

  • for_each_n

  • count

  • count_if

  • mismatch

  • find

  • find_if

  • find_end

  • find_first_of

  • adjacent_find

  • search

  • search_n

  • copy_replace

  • copy_replace_if

  • copy_replace_if_not

  • copy_except

  • copy_except_if

  • copy_except_if_not

Modifying sequence operations

  • fill

  • fill_n

  • transform

  • transform_n

  • rotate_copy

  • shift_left

  • shift_right

  • random_shuffle

  • shuffle

  • sample

  • unique

  • unique_copy

Partitioning operations

  • is_partitioned

  • partition

  • partition_copy

  • stable_partition

  • partition_point

Sorting operations

  • is_sorted

  • is_sorted_until

  • partial_sort

  • partial_sort_copy

  • stable_sort

  • nth_element

Binary search operations (on sorted ranges)

  • lower_bound

  • upper_bound

  • binary_search

  • equal_range

Other operations on sorted ranges

  • merge
  • implace_merge

Set operations (on sorted ranges)

  • includes

  • set_difference

  • set_intersection

  • set_symmetric_difference

  • set_union

Heap operations

  • is_heap

  • is_heap_until

  • make_heap

  • push_heap

  • pop_heap

  • sort_heap

Minimum/maximum operations

  • max_index

  • min_index

  • minmax

  • minmax_index

  • clamp

Comparison operations

  • lexicographical_compare
  • lexicographical_compare_threeway

Permutation operations

  • is_permutation

  • next_permutation

  • prev_permutation

Contributing

First of all, thanks a lot for your contribution, any form of contribution is very welcome and appropriated!

Please familiarise yourself with this project's code of conduct and contribution guidelines.

Getting help

  1. Read the docs
  2. Get in touch with other contributors at gitter
  3. If you think you found a bug, or documentation could be improved, please open an issue

License

Copyright (C) 2020-2021 Jonas Muehlmann

The project is licensed under the terms of the MIT license, you can view it here.

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

pyaoi-2.5.0.tar.gz (18.8 kB view hashes)

Uploaded Source

Built Distribution

pyaoi-2.5.0-py3-none-any.whl (7.8 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