Common use utilities for python done easy.
Project description
mpyez
Common use utilities for python done easy.
What is mpyez
mpyez
is a library made specifically to make the daily mundane tasks as easily doable as possible.
- Want to get a list of all python files in your folder? Use
ListOfFilesFromExtensions
class. - Want to convert a nested list to a 1D list? Use
nested_list_to_list()
. - Want to convert a simple list to nested list? Use
list_to_nested_list()
.
This library is intended to lower complexity of daily recurring tasks.
How to install
Use pip: pip install mpyez
Examples
Let's say, you want to convert a nested list
>>> my_nested_list = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10]]
to a 1D list, with mpyez
you can do it using nested_list_to_list
function in ez_list
module (see, Current
implementations for details).
>>> nested_list_to_list(my_nested_list)
>>> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Modules
Current implementations
misc
is_numeric
: To check if the input is numeric or not.
os_
ListOfFilesFromExtensions
: To pick files of specific extensionsListOfFilesFromNames
: To pick files matching a specific name pattern.
list_
numeric_list_to_string
: To convert a list of numeric values to string.string_list_to_numeric
: To convert a list of string number values to numeric.nested_list_to_list
: To convert a nested list to 1D list.list_to_nested_list
: To convert a simple 1D list to a nested list.join_lists
: To join multiple lists into a single oneReplace
: To replace values in a list, either by given value or by the index.is_contained
: To check if a given list is contained within another list.get_object_count
: To get an object count from the list. Has an added capability of returning sorted list of objects or top N objects.sort_
: To sort a list. Can also return the sort indices.remove_
: To remove a value from a given list. Can also removetuple
,str
, or a nestedlist
.move_element_in_list
: To move a given element present in the list to a new location within the list.
read_files
read_text_file_in_a_list
: Reads an entiretxt
file.read_specific_lines_from_a_file
: Reads specific lines (index based) from a giventxt
file.
Future implementations
read_files
- Whole files using generator to reduce memory issues,
- Implementation of reading other files, especially
.csv
.
dict_
- For handling dictionary manipulations methods easily. For example,
- updating dictionaries,
- index retrieval, and/or
- dictionary comparisons.
- For handling dictionary manipulations methods easily. For example,
- And more
Documentation: IN PROGRESS
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
mpyez-0.0.5.tar.gz
(15.1 kB
view hashes)
Built Distribution
mpyez-0.0.5-py3-none-any.whl
(17.5 kB
view hashes)