%global _empty_manifest_terminate_build 0 Name: python-d8s-lists Version: 0.8.0 Release: 1 Summary: Democritus functions for working with lists. License: GNU Lesser General Public License v3 URL: https://github.com/democritus-project/d8s-lists Source0: https://mirrors.nju.edu.cn/pypi/web/packages/8d/1e/5303df0a4b55f3db49805e9a34c20eecb67ea7855ac348d17ee80d7816a9/d8s_lists-0.8.0.tar.gz BuildArch: noarch Requires: python3-d8s-dicts Requires: python3-more-itertools Requires: python3-importlib-metadata %description # Democritus Lists [![PyPI](https://img.shields.io/pypi/v/d8s-lists.svg)](https://pypi.python.org/pypi/d8s-lists) [![CI](https://github.com/democritus-project/d8s-lists/workflows/CI/badge.svg)](https://github.com/democritus-project/d8s-lists/actions) [![Lint](https://github.com/democritus-project/d8s-lists/workflows/Lint/badge.svg)](https://github.com/democritus-project/d8s-lists/actions) [![codecov](https://codecov.io/gh/democritus-project/d8s-lists/branch/main/graph/badge.svg?token=V0WOIXRGMM)](https://codecov.io/gh/democritus-project/d8s-lists) [![The Democritus Project uses semver version 2.0.0](https://img.shields.io/badge/-semver%20v2.0.0-22bfda)](https://semver.org/spec/v2.0.0.html) [![The Democritus Project uses black to format code](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://choosealicense.com/licenses/lgpl-3.0/) Democritus functions[1] for working with lists. [1] Democritus functions are simple, effective, modular, well-tested, and well-documented Python functions. We use `d8s` (pronounced "dee-eights") as an abbreviation for `democritus` (you can read more about this [here](https://github.com/democritus-project/roadmap#what-is-d8s)). ## Installation ``` pip install d8s-lists ``` ## Usage You import the library like: ```python from d8s_lists import * ``` Once imported, you can use any of the functions listed below. ## Functions - ```python def iterable_sort_by_length(iterable: Iterable[Any], **kwargs) -> List[Any]: """.""" ``` - ```python def longest(iterable: Iterable[Any]) -> Any: """.""" ``` - ```python def shortest(iterable: Iterable[Any]) -> Any: """.""" ``` - ```python def flatten(iterable: Iterable[Any], level: int = None, **kwargs) -> Iterator[Any]: """Flatten all items in the iterable so that they are all items in the same list.""" ``` - ```python def has_index(iterable: Sized, index: int) -> bool: """.""" ``` - ```python def types(iterable: Iterable[Any]) -> Iterator[Type]: """Return a set containing the types of all items in the list_arg.""" ``` - ```python def iterable_item_of_types(iterable: Iterable[Any], item_types: Iterable[type]) -> bool: """Return True if the iterable has any item that is of the item_types. Otherwise, return False.""" ``` - ```python def iterable_all_items_of_types(iterable: Iterable[Any], item_types: Iterable[type]) -> bool: """Return True if all items in the iterable are of a type given in item_types. Otherwise, return False.""" ``` - ```python def iterable_has_all_items_of_type(iterable: Iterable[Any], type_arg: type) -> bool: """Return whether or not all iterable in iterable are of the type specified by the type_arg.""" ``` - ```python def deduplicate(iterable: Iterable[Any]) -> Iterator[Any]: """Deduplicate the iterable.""" ``` - ```python def cycle(iterable: Iterable[Any], length: Optional[int] = None) -> Iterator[Any]: """Cycle through the iterable as much as needed.""" ``` - ```python def truthy_items(iterable: Iterable[Any]) -> Iterator[Any]: """Return an iterable with only elements of the given iterable which evaluate to True. (see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)""" ``` - ```python def nontruthy_items(iterable: Iterable[Any]) -> Iterator[Any]: """Return an iterable with only elements of the given iterable which evaluate to False. (see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)""" ``` - ```python def iterable_has_single_item(iterable: Iterable[Any]) -> bool: """Return whether the iterable has a single item in it.""" ``` - ```python def iterables_are_same_length(a: Sized, b: Sized, *args: Sized, debug_failure: bool = False) -> bool: """Return whether or not the given iterables are the same lengths.""" ``` - ```python def iterables_have_same_items(a: Sequence, b: Sequence, *args: Sequence) -> bool: """Return whether iterables have identical items (considering both identity and count).""" ``` - ```python def run_length_encoding(iterable: Iterable[Any]) -> Iterator[str]: """Perform run-length encoding on the given array. See https://en.wikipedia.org/wiki/Run-length_encoding for more details.""" ``` - ```python def iterable_count(iterable: Iterable[Any]) -> Dict[Any, int]: """Count each item in the iterable.""" ``` - ```python def iterable_item_index(iterable: Sequence, item: Any) -> int: """Find the given item in the iterable. Return -1 if the item is not found.""" ``` - ```python def iterable_item_indexes(iterable: Iterable[Any], item: Any) -> Iterator[int]: """Find the given item in the iterable. Return -1 if the item is not found.""" ``` - ```python def duplicates(iterable: Sequence) -> Iterator[Sequence]: """Find duplicates in the given iterable.""" ``` - ```python def iterable_has_mixed_types(iterable: Iterable[Any]) -> bool: """Return whether or not the iterable has items with two or more types.""" ``` - ```python def iterable_has_single_type(iterable: Iterable[Any]) -> bool: """Return whether or not the iterable has items of only one type.""" ``` - ```python def iterable_replace(iterable: Iterable[Any], old_value: Any, new_value: Any) -> Iterator[Any]: """Replace all instances of the old_value with the new_value in the given iterable.""" ``` ## Development ๐Ÿ‘‹  If you want to get involved in this project, we have some short, helpful guides below: - [contribute to this project ๐Ÿฅ‡][contributing] - [test it ๐Ÿงช][local-dev] - [lint it ๐Ÿงน][local-dev] - [explore it ๐Ÿ”ญ][local-dev] If you have any questions or there is anything we did not cover, please raise an issue and we'll be happy to help. ## Credits This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and Floyd Hightower's [Python project template](https://github.com/fhightower-templates/python-project-template). [contributing]: https://github.com/democritus-project/.github/blob/main/CONTRIBUTING.md#contributing-a-pr- [local-dev]: https://github.com/democritus-project/.github/blob/main/CONTRIBUTING.md#local-development- %package -n python3-d8s-lists Summary: Democritus functions for working with lists. Provides: python-d8s-lists BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-d8s-lists # Democritus Lists [![PyPI](https://img.shields.io/pypi/v/d8s-lists.svg)](https://pypi.python.org/pypi/d8s-lists) [![CI](https://github.com/democritus-project/d8s-lists/workflows/CI/badge.svg)](https://github.com/democritus-project/d8s-lists/actions) [![Lint](https://github.com/democritus-project/d8s-lists/workflows/Lint/badge.svg)](https://github.com/democritus-project/d8s-lists/actions) [![codecov](https://codecov.io/gh/democritus-project/d8s-lists/branch/main/graph/badge.svg?token=V0WOIXRGMM)](https://codecov.io/gh/democritus-project/d8s-lists) [![The Democritus Project uses semver version 2.0.0](https://img.shields.io/badge/-semver%20v2.0.0-22bfda)](https://semver.org/spec/v2.0.0.html) [![The Democritus Project uses black to format code](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://choosealicense.com/licenses/lgpl-3.0/) Democritus functions[1] for working with lists. [1] Democritus functions are simple, effective, modular, well-tested, and well-documented Python functions. We use `d8s` (pronounced "dee-eights") as an abbreviation for `democritus` (you can read more about this [here](https://github.com/democritus-project/roadmap#what-is-d8s)). ## Installation ``` pip install d8s-lists ``` ## Usage You import the library like: ```python from d8s_lists import * ``` Once imported, you can use any of the functions listed below. ## Functions - ```python def iterable_sort_by_length(iterable: Iterable[Any], **kwargs) -> List[Any]: """.""" ``` - ```python def longest(iterable: Iterable[Any]) -> Any: """.""" ``` - ```python def shortest(iterable: Iterable[Any]) -> Any: """.""" ``` - ```python def flatten(iterable: Iterable[Any], level: int = None, **kwargs) -> Iterator[Any]: """Flatten all items in the iterable so that they are all items in the same list.""" ``` - ```python def has_index(iterable: Sized, index: int) -> bool: """.""" ``` - ```python def types(iterable: Iterable[Any]) -> Iterator[Type]: """Return a set containing the types of all items in the list_arg.""" ``` - ```python def iterable_item_of_types(iterable: Iterable[Any], item_types: Iterable[type]) -> bool: """Return True if the iterable has any item that is of the item_types. Otherwise, return False.""" ``` - ```python def iterable_all_items_of_types(iterable: Iterable[Any], item_types: Iterable[type]) -> bool: """Return True if all items in the iterable are of a type given in item_types. Otherwise, return False.""" ``` - ```python def iterable_has_all_items_of_type(iterable: Iterable[Any], type_arg: type) -> bool: """Return whether or not all iterable in iterable are of the type specified by the type_arg.""" ``` - ```python def deduplicate(iterable: Iterable[Any]) -> Iterator[Any]: """Deduplicate the iterable.""" ``` - ```python def cycle(iterable: Iterable[Any], length: Optional[int] = None) -> Iterator[Any]: """Cycle through the iterable as much as needed.""" ``` - ```python def truthy_items(iterable: Iterable[Any]) -> Iterator[Any]: """Return an iterable with only elements of the given iterable which evaluate to True. (see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)""" ``` - ```python def nontruthy_items(iterable: Iterable[Any]) -> Iterator[Any]: """Return an iterable with only elements of the given iterable which evaluate to False. (see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)""" ``` - ```python def iterable_has_single_item(iterable: Iterable[Any]) -> bool: """Return whether the iterable has a single item in it.""" ``` - ```python def iterables_are_same_length(a: Sized, b: Sized, *args: Sized, debug_failure: bool = False) -> bool: """Return whether or not the given iterables are the same lengths.""" ``` - ```python def iterables_have_same_items(a: Sequence, b: Sequence, *args: Sequence) -> bool: """Return whether iterables have identical items (considering both identity and count).""" ``` - ```python def run_length_encoding(iterable: Iterable[Any]) -> Iterator[str]: """Perform run-length encoding on the given array. See https://en.wikipedia.org/wiki/Run-length_encoding for more details.""" ``` - ```python def iterable_count(iterable: Iterable[Any]) -> Dict[Any, int]: """Count each item in the iterable.""" ``` - ```python def iterable_item_index(iterable: Sequence, item: Any) -> int: """Find the given item in the iterable. Return -1 if the item is not found.""" ``` - ```python def iterable_item_indexes(iterable: Iterable[Any], item: Any) -> Iterator[int]: """Find the given item in the iterable. Return -1 if the item is not found.""" ``` - ```python def duplicates(iterable: Sequence) -> Iterator[Sequence]: """Find duplicates in the given iterable.""" ``` - ```python def iterable_has_mixed_types(iterable: Iterable[Any]) -> bool: """Return whether or not the iterable has items with two or more types.""" ``` - ```python def iterable_has_single_type(iterable: Iterable[Any]) -> bool: """Return whether or not the iterable has items of only one type.""" ``` - ```python def iterable_replace(iterable: Iterable[Any], old_value: Any, new_value: Any) -> Iterator[Any]: """Replace all instances of the old_value with the new_value in the given iterable.""" ``` ## Development ๐Ÿ‘‹  If you want to get involved in this project, we have some short, helpful guides below: - [contribute to this project ๐Ÿฅ‡][contributing] - [test it ๐Ÿงช][local-dev] - [lint it ๐Ÿงน][local-dev] - [explore it ๐Ÿ”ญ][local-dev] If you have any questions or there is anything we did not cover, please raise an issue and we'll be happy to help. ## Credits This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and Floyd Hightower's [Python project template](https://github.com/fhightower-templates/python-project-template). [contributing]: https://github.com/democritus-project/.github/blob/main/CONTRIBUTING.md#contributing-a-pr- [local-dev]: https://github.com/democritus-project/.github/blob/main/CONTRIBUTING.md#local-development- %package help Summary: Development documents and examples for d8s-lists Provides: python3-d8s-lists-doc %description help # Democritus Lists [![PyPI](https://img.shields.io/pypi/v/d8s-lists.svg)](https://pypi.python.org/pypi/d8s-lists) [![CI](https://github.com/democritus-project/d8s-lists/workflows/CI/badge.svg)](https://github.com/democritus-project/d8s-lists/actions) [![Lint](https://github.com/democritus-project/d8s-lists/workflows/Lint/badge.svg)](https://github.com/democritus-project/d8s-lists/actions) [![codecov](https://codecov.io/gh/democritus-project/d8s-lists/branch/main/graph/badge.svg?token=V0WOIXRGMM)](https://codecov.io/gh/democritus-project/d8s-lists) [![The Democritus Project uses semver version 2.0.0](https://img.shields.io/badge/-semver%20v2.0.0-22bfda)](https://semver.org/spec/v2.0.0.html) [![The Democritus Project uses black to format code](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://choosealicense.com/licenses/lgpl-3.0/) Democritus functions[1] for working with lists. [1] Democritus functions are simple, effective, modular, well-tested, and well-documented Python functions. We use `d8s` (pronounced "dee-eights") as an abbreviation for `democritus` (you can read more about this [here](https://github.com/democritus-project/roadmap#what-is-d8s)). ## Installation ``` pip install d8s-lists ``` ## Usage You import the library like: ```python from d8s_lists import * ``` Once imported, you can use any of the functions listed below. ## Functions - ```python def iterable_sort_by_length(iterable: Iterable[Any], **kwargs) -> List[Any]: """.""" ``` - ```python def longest(iterable: Iterable[Any]) -> Any: """.""" ``` - ```python def shortest(iterable: Iterable[Any]) -> Any: """.""" ``` - ```python def flatten(iterable: Iterable[Any], level: int = None, **kwargs) -> Iterator[Any]: """Flatten all items in the iterable so that they are all items in the same list.""" ``` - ```python def has_index(iterable: Sized, index: int) -> bool: """.""" ``` - ```python def types(iterable: Iterable[Any]) -> Iterator[Type]: """Return a set containing the types of all items in the list_arg.""" ``` - ```python def iterable_item_of_types(iterable: Iterable[Any], item_types: Iterable[type]) -> bool: """Return True if the iterable has any item that is of the item_types. Otherwise, return False.""" ``` - ```python def iterable_all_items_of_types(iterable: Iterable[Any], item_types: Iterable[type]) -> bool: """Return True if all items in the iterable are of a type given in item_types. Otherwise, return False.""" ``` - ```python def iterable_has_all_items_of_type(iterable: Iterable[Any], type_arg: type) -> bool: """Return whether or not all iterable in iterable are of the type specified by the type_arg.""" ``` - ```python def deduplicate(iterable: Iterable[Any]) -> Iterator[Any]: """Deduplicate the iterable.""" ``` - ```python def cycle(iterable: Iterable[Any], length: Optional[int] = None) -> Iterator[Any]: """Cycle through the iterable as much as needed.""" ``` - ```python def truthy_items(iterable: Iterable[Any]) -> Iterator[Any]: """Return an iterable with only elements of the given iterable which evaluate to True. (see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)""" ``` - ```python def nontruthy_items(iterable: Iterable[Any]) -> Iterator[Any]: """Return an iterable with only elements of the given iterable which evaluate to False. (see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)""" ``` - ```python def iterable_has_single_item(iterable: Iterable[Any]) -> bool: """Return whether the iterable has a single item in it.""" ``` - ```python def iterables_are_same_length(a: Sized, b: Sized, *args: Sized, debug_failure: bool = False) -> bool: """Return whether or not the given iterables are the same lengths.""" ``` - ```python def iterables_have_same_items(a: Sequence, b: Sequence, *args: Sequence) -> bool: """Return whether iterables have identical items (considering both identity and count).""" ``` - ```python def run_length_encoding(iterable: Iterable[Any]) -> Iterator[str]: """Perform run-length encoding on the given array. See https://en.wikipedia.org/wiki/Run-length_encoding for more details.""" ``` - ```python def iterable_count(iterable: Iterable[Any]) -> Dict[Any, int]: """Count each item in the iterable.""" ``` - ```python def iterable_item_index(iterable: Sequence, item: Any) -> int: """Find the given item in the iterable. Return -1 if the item is not found.""" ``` - ```python def iterable_item_indexes(iterable: Iterable[Any], item: Any) -> Iterator[int]: """Find the given item in the iterable. Return -1 if the item is not found.""" ``` - ```python def duplicates(iterable: Sequence) -> Iterator[Sequence]: """Find duplicates in the given iterable.""" ``` - ```python def iterable_has_mixed_types(iterable: Iterable[Any]) -> bool: """Return whether or not the iterable has items with two or more types.""" ``` - ```python def iterable_has_single_type(iterable: Iterable[Any]) -> bool: """Return whether or not the iterable has items of only one type.""" ``` - ```python def iterable_replace(iterable: Iterable[Any], old_value: Any, new_value: Any) -> Iterator[Any]: """Replace all instances of the old_value with the new_value in the given iterable.""" ``` ## Development ๐Ÿ‘‹  If you want to get involved in this project, we have some short, helpful guides below: - [contribute to this project ๐Ÿฅ‡][contributing] - [test it ๐Ÿงช][local-dev] - [lint it ๐Ÿงน][local-dev] - [explore it ๐Ÿ”ญ][local-dev] If you have any questions or there is anything we did not cover, please raise an issue and we'll be happy to help. ## Credits This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and Floyd Hightower's [Python project template](https://github.com/fhightower-templates/python-project-template). [contributing]: https://github.com/democritus-project/.github/blob/main/CONTRIBUTING.md#contributing-a-pr- [local-dev]: https://github.com/democritus-project/.github/blob/main/CONTRIBUTING.md#local-development- %prep %autosetup -n d8s-lists-0.8.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-d8s-lists -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 0.8.0-1 - Package Spec generated