Skip to content

JonasMuehlmann/pyaoi

Repository files navigation

PyAoI (Python Algorithms on Iterables)

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

Conventient algorithms for processing iterables, inspired by the algorithm header from the C++ standard template library (STL for short).

Please do not expect a stable API at this point.

Sister project: https://github.com/JonasMuehlmann/goaoi

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

  • 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.

About

Conventient algorithms for processing iterables, inspired by the algorithm header from the C++ standard template library (STL for short).

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published