Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/1.bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -r ./requirements/requirements.test.txt
python -m pip install .[test]
- name: Test with pytest
run: ./scripts/test.sh -l

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/2.build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
python -m pip install -U pip
python -m pip install -r ./requirements/requirements.build.txt
- name: Build and publish package
# run: |
# echo -e "[testpypi]\nusername = __token__\npassword = ${{ secrets.TEST_PYPI_API_TOKEN }}" > ~/.pypirc
# ./scripts/build.sh -c -u
# rm -rfv ~/.pypirc
run: |
echo -e "[testpypi]\nusername = __token__\npassword = ${{ secrets.TEST_PYPI_API_TOKEN }}" > ~/.pypirc
./scripts/build.sh -c -u
echo -e "[pypi]\nusername = __token__\npassword = ${{ secrets.PYPI_API_TOKEN }}" > ~/.pypirc
./scripts/build.sh -c -u -p
rm -rfv ~/.pypirc
# run: |
# echo -e "[pypi]\nusername = __token__\npassword = ${{ secrets.PYPI_API_TOKEN }}" > ~/.pypirc
# ./scripts/build.sh -c -u -p
# rm -rfv ~/.pypirc
# - name: Build the package
# run: |
# ./scripts/build.sh -c
- name: Build the package
run: |
./scripts/build.sh -c
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
81 changes: 11 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
[![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_utils' is collection of useful utils package for python.
'potato_utils' is collection of simple useful utils package for python.

## ✨ Features

- Python module/package
- Configuration
- Test
- Build
- Documentation
- Scripts
- Examples
- CI/CD
- Python utilities
- Datetime utilities
- File I/O utilities
- HTTP utilities
- Security utilities
- Sanitation utilities
- Validation utilities

---

Expand Down Expand Up @@ -75,11 +74,7 @@ git clone git@github.com:bybatkhuu/module.python-utils.git && \
**OPTION A.** [**RECOMMENDED**] Install from **PyPi**:

```sh
# Install from staging TestPyPi:
pip install -i https://test.pypi.org/simple -U potato_utils

# Or install from production PyPi:
# pip install -U potato_utils
pip install -U potato_utils
```

**OPTION B.** Install latest version directly from **GitHub** repository:
Expand All @@ -101,7 +96,7 @@ pip install -e .
**OPTION D.** Install for **DEVELOPMENT** environment:

```sh
pip install -r ./requirements/requirements.dev.txt
pip install -e .[dev]
```

**OPTION E.** Install from **pre-built release** files:
Expand Down Expand Up @@ -136,66 +131,12 @@ cp -r ./src/potato_utils /some/path/project/
[**`examples/simple/main.py`**](./examples/simple/main.py):

```python
# Standard libraries
import sys
import logging

# Internal modules
from potato_utils import MyClass


logger = logging.getLogger(__name__)


def main() -> None:
logging.basicConfig(
stream=sys.stdout,
level=logging.INFO,
datefmt="%Y-%m-%d %H:%M:%S %z",
format="[%(asctime)s | %(levelname)s | %(filename)s:%(lineno)d]: %(message)s",
)

# Pre-defined variables (for customizing and testing)
_items = [0.1, 0.2, 0.3, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
_config = {
"min_length": 4,
"max_length": 10,
"min_value": 0.0,
"max_value": 1.0,
"threshold": 0.7,
}

# Main example code
logger.info(f"Items before cleaning: {_items}")
_my_object = MyClass(items=_items, config=_config)
_items = _my_object()
logger.info(f"Items after cleaning: {_items}")

logger.info("Done!\n")
return


if __name__ == "__main__":
main()
```

👍

---

## ⚙️ Configuration

[**`templates/configs/config.yml`**](./templates/configs/config.yml):

```yaml
potato_utils:
min_length: 2
max_length: 100
min_value: 0.0
max_value: 1.0
threshold: 0.5
```

### 🌎 Environment Variables

[**`.env.example`**](./.env.example):
Expand All @@ -214,7 +155,7 @@ To run tests, run the following command:

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

# Run tests:
python -m pytest -sv -o log_cli=true
Expand Down
1 change: 0 additions & 1 deletion docs/.nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ nav:
- Development: dev/
- Research: research/
# - "*"
- Blog: blog/
- Release Notes: release-notes.md
- About: about/
17 changes: 8 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ hide:

# Introduction

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

## ✨ Features

- Python module/package
- Configuration
- Test
- Build
- Documentation
- Scripts
- Examples
- CI/CD
- Python utilities
- Datetime utilities
- File I/O utilities
- HTTP utilities
- Security utilities
- Sanitation utilities
- Validation utilities
3 changes: 1 addition & 2 deletions docs/api-docs/.nav.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
nav:
- MyClass: MyClass.md
# - "*"
- "*"
7 changes: 0 additions & 7 deletions docs/api-docs/MyClass.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/api-docs/dt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Datetime Utilities
---

# Datetime Utilities

::: src.potato_utils.dt
7 changes: 7 additions & 0 deletions docs/api-docs/http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: HTTP Utilities
---

# HTTP Utilities

::: src.potato_utils.http
7 changes: 7 additions & 0 deletions docs/api-docs/io.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: IO Utilities
---

# IO Utilities

::: src.potato_utils.io
7 changes: 7 additions & 0 deletions docs/api-docs/sanitizer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Sanitizer Utilities
---

# Sanitizer Utilities

::: src.potato_utils.sanitizer
7 changes: 7 additions & 0 deletions docs/api-docs/secure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Secure Utilities
---

# Secure Utilities

::: src.potato_utils.secure
7 changes: 7 additions & 0 deletions docs/api-docs/validator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Validator Utilities
---

# Validator Utilities

::: src.potato_utils.validator
Binary file modified docs/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions docs/blog/.authors.yml

This file was deleted.

2 changes: 0 additions & 2 deletions docs/blog/.meta.yml

This file was deleted.

7 changes: 0 additions & 7 deletions docs/blog/index.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/blog/posts/post-1.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/dev/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ title: Sitemap
- [Installation](../getting-started/installation.md)
- [Configuration](../getting-started/configuration.md)
- [Examples](../getting-started/examples.md)
- [Error Codes](../getting-started/error-codes.md)
- API Documentation
- [MyClass](../api-docs/MyClass.md)
- Development
- [Test](../dev/test.md)
- [Build](../dev/build.md)
Expand Down Expand Up @@ -43,7 +41,6 @@ title: Sitemap
- [Benchmarks](../research/benchmarks.md)
- [References](../research/references.md)
- [Release Notes](../release-notes.md)
- [Blog](../blog/index.md)
- About
- [FAQ](../about/faq.md)
- [Authors](../about/authors.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To run tests, run the following command:

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

# Run tests:
python -m pytest -sv -o log_cli=true
Expand Down
1 change: 0 additions & 1 deletion docs/getting-started/.nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ nav:
- Installation: installation.md
- Configuration: configuration.md
- Examples: examples.md
- Error Codes: error-codes.md
# - "*"
8 changes: 0 additions & 8 deletions docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
title: Configuration
---

# ⚙️ Configuration

[**`templates/configs/config.yml`**](https://github.com/bybatkhuu/module.python-utils/blob/main/templates/configs/config.yml):

```yaml
--8<-- "./templates/configs/config.yml"
```

## 🌎 Environment Variables

[**`.env.example`**](https://github.com/bybatkhuu/module.python-utils/blob/main/.env.example):
Expand Down
47 changes: 0 additions & 47 deletions docs/getting-started/error-codes.md

This file was deleted.

Loading