stevools


Namestevools JSON
Version 0.1.2 PyPI version JSON
download
home_page
Summary
upload_time2024-01-29 08:23:21
maintainer
docs_urlNone
authorsteveflyer
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Steveflyer's Stevools ๐Ÿ’Ž

This is a versatile, Python-based toolbox crafted with โค๏ธ by Steveflyer. It serves not only as a standalone repository of utilities but also as an essential package for other innovative projects under Steveflyer's belt.

Projects such as:
- **zephyrion**: A ๐Ÿš€ pyppeteer-based headless web automation tool.
- **cetino**: A ๐ŸŽˆ lightweight and pythonic database manipulation tool.

## ๐Ÿ›  Toolbox Contents

Stevools encapsulates a plethora of utilities streamlined for daily use, including:

### Core Utilities
- **date_utils**: ๐Ÿ“… Tools for effective date manipulations.
- **debug_utils**: ๐Ÿ› Essential debugging aids for developers.
- **re_utils**: ๐Ÿงต Regular expression utilities for efficient string processing.

### I/O Utilities
- **io**:
  - **pandas_io**: ๐Ÿผ I/O operations centered around Pandas.
  - **text_reader**: ๐Ÿ“– Efficient reading capabilities across multiple formats.
  - **_io**: Core I/O functionalities.

### Multiprocessing Utilities ๐Ÿš€

Stevools's multiprocessing utilities are tailored for efficient, parallel execution of both synchronous and asynchronous tasks. Leveraging the power of Python's multiprocessing and asyncio modules, it provides a seamless way to distribute and execute tasks across multiple CPU cores.

#### ParallelExecutor

The crown jewel of the multiprocessing utilities. `ParallelExecutor` facilitates the parallel execution of tasks. Whether you're dealing with synchronous or asynchronous tasks, this class got you covered.

Features:
- **Asynchronous Task Execution**: Seamlessly execute asynchronous functions in parallel across multiple processes.
- **Weighted Task Splitting**: Dynamically split tasks amongst worker processes based on their assigned weights, ensuring balanced work distribution.

Usage:
```python
tasks = [Task(function_name, params_dict), ...]
results = ParallelExecutor.run(tasks, n_workers=number_of_processes)
```

#### Task
A robust wrapper for any task (function) that you wish to execute, be it asynchronous or synchronous. The Task class ensures that each task is handled appropriately based on its nature.

Features:
- **Async Detection**: Automatically detects if a task is asynchronous and handles it accordingly during execution.
- **Weighted Execution**: Assign weights to tasks, which can then be used by the `ParallelExecutor` for balanced task distribution.

Usage:

With `stevools` ๐Ÿš€, you can parallel your codes really easy
```python
# for example, you have a function:
def calc_something(input_df, threshold):
    # do something
    return output_df
```

Then, you can parallel it by:
```python
import asyncio
from Stevools.multiprocessing import Task, ParallelExecutor

input_df_list = [df1, df2, df3, df4, df5]  # your input dataframes
tasks = [Task(calc_something, {'input_df': df, 'threshold': 0.5}) for df in input_df_list]

asyncio.run(ParallelExecutor.run(tasks, n_workers=5))
```

Super Easy, right? (โœฟโ— โ€ฟโ— )

This multiprocess utility ensures that your CPU cores are efficiently utilized, boosting the performance of your applications manifold.

### OpenAI Utilities
- **openai_util**: ๐Ÿค– Utilities tailored for OpenAI integrations.

### Pandas Utilities
- **pandas_util**: ๐Ÿผ Tools to supercharge your Pandas operations.

### Windows Utilities
- **win_utils**: ๐ŸชŸ Specific tools for Windows operations, including word utilities.

### Scripts Utilities ๐Ÿ› ๏ธ

Stevools's script utilities offer a set of practical scripts that simplify frequent tasks, encapsulating complex operations into a single command. Currently, we've introduced a script that offers a fresh perspective on directory listing, aptly named `ls-py`.

#### ls-py

Move over traditional directory listing; `ls-py` is here to revolutionize the way you view your directory's contents!

Features:
- **Intuitive Listing**: Display directory contents in a structured tree format.
- **Recursive Listing**: Dive deep into directories with the recursive option.
- **Exclude Specific Items**: Have control over what you wish to see or skip.
- **Expand Hidden Directories**: Decide whether to peek into those hidden gems starting with "__" or ".".
- **Cross-Platform**: Whether you're on Windows, macOS, or Linux, `ls-py` has got you covered.

Usage:
```bash
ls-py [path] [options]
```

Examples:

1. **Simple Listing**: Just want to see what's in your current directory?
    ```bash
    ls-py
    ```
2. **Recursive Listing**: Want a deeper dive? No problem!
    ```bash
    ls-py -r ..
    ```
3. **Exclude Specific Items**: Want to skip those pesky .git and .idea folders? Easy easy!
    ```bash
    ls-py -r -x .git .idea __pycache__
    ```
4. **Expand Hidden Directories**: Want to peek into those hidden gems starting with "__" or "."? No problem!
    ```bash
    ls-py -r -e
    ```
Enhance your terminal experience with `ls-py` on any platform, a modern directory listing for the modern developer.

## ๐Ÿ“ฆ Installation

To get started with Stevools, you can simply clone this repository or install it via pip (assuming it's available on PyPi).

```bash
pip install Stevools
```

## Requirements

The required packages for Stevools are listed in requirements.txt. Ensure to install them for a smooth experience.

## ๐Ÿค Contribution

Feel free to fork, enhance, create PRs and spread the word. Any contributions, big or small, are welcomed with open arms!

## โญ Star the Repo 
If you find this project useful, please consider giving it a star on [GitHub](https://github.com/stevieflyer/stevools).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "stevools",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "steveflyer",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/dd/00/2bdd372a0d39a3415ae76b92ecd7a8a5501b1e0618c0ca7c493d1e3e0716/stevools-0.1.2.tar.gz",
    "platform": null,
    "description": "# Steveflyer's Stevools \ud83d\udc8e\r\n\r\nThis is a versatile, Python-based toolbox crafted with \u2764\ufe0f by Steveflyer. It serves not only as a standalone repository of utilities but also as an essential package for other innovative projects under Steveflyer's belt.\r\n\r\nProjects such as:\r\n- **zephyrion**: A \ud83d\ude80 pyppeteer-based headless web automation tool.\r\n- **cetino**: A \ud83c\udf88 lightweight and pythonic database manipulation tool.\r\n\r\n## \ud83d\udee0 Toolbox Contents\r\n\r\nStevools encapsulates a plethora of utilities streamlined for daily use, including:\r\n\r\n### Core Utilities\r\n- **date_utils**: \ud83d\udcc5 Tools for effective date manipulations.\r\n- **debug_utils**: \ud83d\udc1b Essential debugging aids for developers.\r\n- **re_utils**: \ud83e\uddf5 Regular expression utilities for efficient string processing.\r\n\r\n### I/O Utilities\r\n- **io**:\r\n  - **pandas_io**: \ud83d\udc3c I/O operations centered around Pandas.\r\n  - **text_reader**: \ud83d\udcd6 Efficient reading capabilities across multiple formats.\r\n  - **_io**: Core I/O functionalities.\r\n\r\n### Multiprocessing Utilities \ud83d\ude80\r\n\r\nStevools's multiprocessing utilities are tailored for efficient, parallel execution of both synchronous and asynchronous tasks. Leveraging the power of Python's multiprocessing and asyncio modules, it provides a seamless way to distribute and execute tasks across multiple CPU cores.\r\n\r\n#### ParallelExecutor\r\n\r\nThe crown jewel of the multiprocessing utilities. `ParallelExecutor` facilitates the parallel execution of tasks. Whether you're dealing with synchronous or asynchronous tasks, this class got you covered.\r\n\r\nFeatures:\r\n- **Asynchronous Task Execution**: Seamlessly execute asynchronous functions in parallel across multiple processes.\r\n- **Weighted Task Splitting**: Dynamically split tasks amongst worker processes based on their assigned weights, ensuring balanced work distribution.\r\n\r\nUsage:\r\n```python\r\ntasks = [Task(function_name, params_dict), ...]\r\nresults = ParallelExecutor.run(tasks, n_workers=number_of_processes)\r\n```\r\n\r\n#### Task\r\nA robust wrapper for any task (function) that you wish to execute, be it asynchronous or synchronous. The Task class ensures that each task is handled appropriately based on its nature.\r\n\r\nFeatures:\r\n- **Async Detection**: Automatically detects if a task is asynchronous and handles it accordingly during execution.\r\n- **Weighted Execution**: Assign weights to tasks, which can then be used by the `ParallelExecutor` for balanced task distribution.\r\n\r\nUsage:\r\n\r\nWith `stevools` \ud83d\ude80, you can parallel your codes really easy\r\n```python\r\n# for example, you have a function:\r\ndef calc_something(input_df, threshold):\r\n    # do something\r\n    return output_df\r\n```\r\n\r\nThen, you can parallel it by:\r\n```python\r\nimport asyncio\r\nfrom Stevools.multiprocessing import Task, ParallelExecutor\r\n\r\ninput_df_list = [df1, df2, df3, df4, df5]  # your input dataframes\r\ntasks = [Task(calc_something, {'input_df': df, 'threshold': 0.5}) for df in input_df_list]\r\n\r\nasyncio.run(ParallelExecutor.run(tasks, n_workers=5))\r\n```\r\n\r\nSuper Easy, right? (\u273f\u25e0\u203f\u25e0)\r\n\r\nThis multiprocess utility ensures that your CPU cores are efficiently utilized, boosting the performance of your applications manifold.\r\n\r\n### OpenAI Utilities\r\n- **openai_util**: \ud83e\udd16 Utilities tailored for OpenAI integrations.\r\n\r\n### Pandas Utilities\r\n- **pandas_util**: \ud83d\udc3c Tools to supercharge your Pandas operations.\r\n\r\n### Windows Utilities\r\n- **win_utils**: \ud83e\ude9f Specific tools for Windows operations, including word utilities.\r\n\r\n### Scripts Utilities \ud83d\udee0\ufe0f\r\n\r\nStevools's script utilities offer a set of practical scripts that simplify frequent tasks, encapsulating complex operations into a single command. Currently, we've introduced a script that offers a fresh perspective on directory listing, aptly named `ls-py`.\r\n\r\n#### ls-py\r\n\r\nMove over traditional directory listing; `ls-py` is here to revolutionize the way you view your directory's contents!\r\n\r\nFeatures:\r\n- **Intuitive Listing**: Display directory contents in a structured tree format.\r\n- **Recursive Listing**: Dive deep into directories with the recursive option.\r\n- **Exclude Specific Items**: Have control over what you wish to see or skip.\r\n- **Expand Hidden Directories**: Decide whether to peek into those hidden gems starting with \"__\" or \".\".\r\n- **Cross-Platform**: Whether you're on Windows, macOS, or Linux, `ls-py` has got you covered.\r\n\r\nUsage:\r\n```bash\r\nls-py [path] [options]\r\n```\r\n\r\nExamples:\r\n\r\n1. **Simple Listing**: Just want to see what's in your current directory?\r\n    ```bash\r\n    ls-py\r\n    ```\r\n2. **Recursive Listing**: Want a deeper dive? No problem!\r\n    ```bash\r\n    ls-py -r ..\r\n    ```\r\n3. **Exclude Specific Items**: Want to skip those pesky .git and .idea folders? Easy easy!\r\n    ```bash\r\n    ls-py -r -x .git .idea __pycache__\r\n    ```\r\n4. **Expand Hidden Directories**: Want to peek into those hidden gems starting with \"__\" or \".\"? No problem!\r\n    ```bash\r\n    ls-py -r -e\r\n    ```\r\nEnhance your terminal experience with `ls-py` on any platform, a modern directory listing for the modern developer.\r\n\r\n## \ud83d\udce6 Installation\r\n\r\nTo get started with Stevools, you can simply clone this repository or install it via pip (assuming it's available on PyPi).\r\n\r\n```bash\r\npip install Stevools\r\n```\r\n\r\n## Requirements\r\n\r\nThe required packages for Stevools are listed in requirements.txt. Ensure to install them for a smooth experience.\r\n\r\n## \ud83e\udd1d Contribution\r\n\r\nFeel free to fork, enhance, create PRs and spread the word. Any contributions, big or small, are welcomed with open arms!\r\n\r\n## \u2b50 Star the Repo \r\nIf you find this project useful, please consider giving it a star on [GitHub](https://github.com/stevieflyer/stevools).\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8331138d332f67c8ff700bc336f560623ccd0d985f0b79d71b06c9f68c709eae",
                "md5": "57936d4b600699a9d39be811ee055936",
                "sha256": "203dc9839c5f9647c9ad3ee6e826c9a1648d5e1d207d7a0b743e04e177426495"
            },
            "downloads": -1,
            "filename": "stevools-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "57936d4b600699a9d39be811ee055936",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16761,
            "upload_time": "2024-01-29T08:23:19",
            "upload_time_iso_8601": "2024-01-29T08:23:19.450744Z",
            "url": "https://files.pythonhosted.org/packages/83/31/138d332f67c8ff700bc336f560623ccd0d985f0b79d71b06c9f68c709eae/stevools-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd002bdd372a0d39a3415ae76b92ecd7a8a5501b1e0618c0ca7c493d1e3e0716",
                "md5": "2864e8b7980ea32a4ce7f18294ea236f",
                "sha256": "0bbdf82a0ba6e4c914b85cf4161c0f3695fac87b8424a93f53181c639e8e3894"
            },
            "downloads": -1,
            "filename": "stevools-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2864e8b7980ea32a4ce7f18294ea236f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15574,
            "upload_time": "2024-01-29T08:23:21",
            "upload_time_iso_8601": "2024-01-29T08:23:21.163947Z",
            "url": "https://files.pythonhosted.org/packages/dd/00/2bdd372a0d39a3415ae76b92ecd7a8a5501b1e0618c0ca7c493d1e3e0716/stevools-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-29 08:23:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "stevools"
}
        
Elapsed time: 0.95814s