Metadata-Version: 2.4
Name: potato_util
Version: 0.0.2
Summary: 'potato_util' is collection of simple useful utils package for python.
Author-email: Batkhuu Byambajav <batkhuu10@gmail.com>
Project-URL: Homepage, https://github.com/bybatkhuu/module.python-utils
Project-URL: Documentation, https://pyutils-docs.bybatkhuu.dev
Project-URL: Repository, https://github.com/bybatkhuu/module.python-utils.git
Project-URL: Issues, https://github.com/bybatkhuu/module.python-utils/issues
Project-URL: Changelog, https://github.com/bybatkhuu/module.python-utils/blob/main/CHANGELOG.md
Keywords: potato_util,utils,utilities,tools,helpers
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <4.0,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: python-dotenv<2.0.0,>=1.0.1
Requires-Dist: pydantic[email,timezone]<3.0.0,>=2.0.3
Requires-Dist: pydantic-settings<3.0.0,>=2.2.1
Provides-Extra: async
Requires-Dist: aiofiles<25.0.0,>=24.1.0; extra == "async"
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "async"
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "async"
Provides-Extra: fastapi
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "fastapi"
Provides-Extra: all
Requires-Dist: aiofiles<25.0.0,>=24.1.0; extra == "all"
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "all"
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "all"
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "all"
Provides-Extra: test
Requires-Dist: aiofiles<25.0.0,>=24.1.0; extra == "test"
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "test"
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "test"
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "test"
Requires-Dist: pytest<9.0.0,>=8.0.2; extra == "test"
Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "test"
Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "test"
Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "test"
Provides-Extra: build
Requires-Dist: setuptools<81.0.0,>=70.3.0; extra == "build"
Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "build"
Requires-Dist: build<2.0.0,>=1.1.1; extra == "build"
Requires-Dist: twine<7.0.0,>=6.0.1; extra == "build"
Provides-Extra: docs
Requires-Dist: pylint<4.0.0,>=3.0.4; extra == "docs"
Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "docs"
Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "docs"
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "docs"
Requires-Dist: mike<3.0.0,>=2.1.3; extra == "docs"
Provides-Extra: dev
Requires-Dist: aiofiles<25.0.0,>=24.1.0; extra == "dev"
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "dev"
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "dev"
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "dev"
Requires-Dist: pytest<9.0.0,>=8.0.2; extra == "dev"
Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "dev"
Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "dev"
Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "dev"
Requires-Dist: setuptools<81.0.0,>=70.3.0; extra == "dev"
Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "dev"
Requires-Dist: build<2.0.0,>=1.1.1; extra == "dev"
Requires-Dist: twine<7.0.0,>=6.0.1; extra == "dev"
Requires-Dist: pylint<4.0.0,>=3.0.4; extra == "dev"
Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "dev"
Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "dev"
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "dev"
Requires-Dist: mike<3.0.0,>=2.1.3; extra == "dev"
Requires-Dist: pyright<2.0.0,>=1.1.392; extra == "dev"
Requires-Dist: pre-commit<5.0.0,>=4.0.1; extra == "dev"
Dynamic: license-file

# Potato Utils (Python Utils)

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bybatkhuu/module.python-utils/2.build-publish.yml?logo=GitHub)](https://github.com/bybatkhuu/module.python-utils/actions/workflows/2.build-publish.yml)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/bybatkhuu/module.python-utils?logo=GitHub&color=blue)](https://github.com/bybatkhuu/module.python-utils/releases)

'potato_util' is collection of simple useful utils package for python.

## ✨ Features

- Python utilities
- Datetime utilities
- File I/O utilities
- HTTP utilities
- Security utilities
- Sanitation utilities
- Validation utilities

---

## 🛠 Installation

### 1. 🚧 Prerequisites

- Install **Python (>= v3.10)** and **pip (>= 23)**:
    - **[RECOMMENDED] [Miniconda (v3)](https://www.anaconda.com/docs/getting-started/miniconda/install)**
    - *[arm64/aarch64] [Miniforge (v3)](https://github.com/conda-forge/miniforge)*
    - *[Python virutal environment] [venv](https://docs.python.org/3/library/venv.html)*

[OPTIONAL] For **DEVELOPMENT** environment:

- Install [**git**](https://git-scm.com/downloads)
- Setup an [**SSH key**](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) ([video tutorial](https://www.youtube.com/watch?v=snCP3c7wXw0))

### 2. 📥 Download or clone the repository

[TIP] Skip this step, if you're going to install the package directly from **PyPi** or **GitHub** repository.

**2.1.** Prepare projects directory (if not exists):

```sh
# Create projects directory:
mkdir -pv ~/workspaces/projects

# Enter into projects directory:
cd ~/workspaces/projects
```

**2.2.** Follow one of the below options **[A]**, **[B]** or **[C]**:

**OPTION A.** Clone the repository:

```sh
git clone https://github.com/bybatkhuu/module.python-utils.git && \
    cd module.python-utils
```

**OPTION B.** Clone the repository (for **DEVELOPMENT**: git + ssh key):

```sh
git clone git@github.com:bybatkhuu/module.python-utils.git && \
    cd module.python-utils
```

**OPTION C.** Download source code:

1. Download archived **zip** file from [**releases**](https://github.com/bybatkhuu/module.python-utils/releases).
2. Extract it into the projects directory.

### 3. 📦 Install the package

[NOTE] Choose one of the following methods to install the package **[A ~ F]**:

**OPTION A.** [**RECOMMENDED**] Install from **PyPi**:

```sh
pip install -U potato-util
```

**OPTION B.** Install latest version directly from **GitHub** repository:

```sh
pip install git+https://github.com/bybatkhuu/module.python-utils.git
```

**OPTION C.** Install from the downloaded **source code**:

```sh
# Install directly from the source code:
pip install .

# Or install with editable mode:
pip install -e .
```

**OPTION D.** Install for **DEVELOPMENT** environment:

```sh
pip install -e .[dev]
```

**OPTION E.** Install from **pre-built release** files:

1. Download **`.whl`** or **`.tar.gz`** file from [**releases**](https://github.com/bybatkhuu/module.python-utils/releases)
2. Install with pip:

```sh
# Install from .whl file:
pip install ./potato_util-[VERSION]-py3-none-any.whl

# Or install from .tar.gz file:
pip install ./potato_util-[VERSION].tar.gz
```

**OPTION F.** Copy the **module** into the project directory (for **testing**):

```sh
# Install python dependencies:
pip install -r ./requirements.txt

# Copy the module source code into the project:
cp -r ./src/potato_util [PROJECT_DIR]
# For example:
cp -r ./src/potato_util /some/path/project/
```

## 🚸 Usage/Examples

### Simple

[**`examples/simple/main.py`**](./examples/simple/main.py):

```python
```

👍

---

### 🌎 Environment Variables

[**`.env.example`**](./.env.example):

```sh
# ENV=LOCAL
# DEBUG=false
# TZ=UTC
```

---

## 🧪 Running Tests

To run tests, run the following command:

```sh
# Install python test dependencies:
pip install .[test]

# Run tests:
python -m pytest -sv -o log_cli=true
# Or use the test script:
./scripts/test.sh -l -v -c
```

## 🏗️ Build Package

To build the python package, run the following command:

```sh
# Install python build dependencies:
pip install -r ./requirements/requirements.build.txt

# Build python package:
python -m build
# Or use the build script:
./scripts/build.sh
```

## 📝 Generate Docs

To build the documentation, run the following command:

```sh
# Install python documentation dependencies:
pip install -r ./requirements/requirements.docs.txt

# Serve documentation locally (for development):
mkdocs serve -a 0.0.0.0:8000
# Or use the docs script:
./scripts/docs.sh

# Or build documentation:
mkdocs build
# Or use the docs script:
./scripts/docs.sh -b
```

## 📚 Documentation

- [Docs](./docs)

---

## 📑 References

- <https://packaging.python.org/en/latest/tutorials/packaging-projects>
- <https://python-packaging.readthedocs.io/en/latest>
