Skip to main content

Common use utilities for python done easy.

Project description

mpyez

Common use utilities for python done easy.

GitHub-licence GitHub top language GitHub contributors Github Issues GitHub PRs

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

  1. misc
    1. is_numeric : To check if the input is numeric or not.
  2. os_
    1. ListOfFilesFromExtensions : To pick files of specific extensions
    2. ListOfFilesFromNames: To pick files matching a specific name pattern.
  3. list_
    1. numeric_list_to_string : To convert a list of numeric values to string.
    2. string_list_to_numeric : To convert a list of string number values to numeric.
    3. nested_list_to_list : To convert a nested list to 1D list.
    4. list_to_nested_list : To convert a simple 1D list to a nested list.
    5. join_lists : To join multiple lists into a single one
    6. Replace : To replace values in a list, either by given value or by the index.
    7. is_contained : To check if a given list is contained within another list.
    8. 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.
    9. sort_: To sort a list. Can also return the sort indices.
    10. remove_: To remove a value from a given list. Can also remove tuple, str, or a nested list.
    11. move_element_in_list: To move a given element present in the list to a new location within the list.
  4. read_files
    1. read_text_file_in_a_list: Reads an entire txt file.
    2. read_specific_lines_from_a_file: Reads specific lines (index based) from a given txt file.

Future implementations

  1. read_files
    1. Whole files using generator to reduce memory issues,
    2. Implementation of reading other files, especially .csv.
  2. dict_
    1. For handling dictionary manipulations methods easily. For example,
      1. updating dictionaries,
      2. index retrieval, and/or
      3. dictionary comparisons.
  3. 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)

Uploaded Source

Built Distribution

mpyez-0.0.5-py3-none-any.whl (17.5 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