A collection of useful functions operating on iterables
Project description
PyAoI (Python Algorithms on Iterables)
This project provides a bunch of functions to interact with 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
-
remove
-
remove_if
-
replace
-
replace_if
-
reverse_copy
-
rotate
-
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
- Read the docs
- Get in touch with other contributors at gitter
- If you think you found a bug, or documentation could be improved, please open an issue
License
Copyright (C) 2020 Jonas Muehlmann
The project is licensed under the terms of the GPL-V3 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.