# Utility for Research (URes)
[](https://github.com/semantic-release/semantic-release)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/psf/black)
[](https://opensource.org/licenses/MIT)
[](https://github.com/stone-home/Python-URes/actions/workflows/linter.yaml)
[](https://github.com/stone-home/Python-URes/actions/workflows/secret-check.yaml)
[](https://github.com/stone-home/Python-URes/actions/workflows/test.yaml)
---
## Overview
URes (Utility for Research) is a versatile Python library that simplifies common research and development tasks. It offers a wide range of modules to handle everything from Docker container management to advanced data visualization and file operations.
## Key Features
- **Docker Management**: Build, run, and manage Docker images and containers with an intuitive Python interface.
- **Markdown and Zettelkasten**: Create, manipulate, and organize Markdown documents, with support for the Zettelkasten note-taking method.
- **Data Structures**: Implement and use advanced data structures like Trees and Bi-Directional Links for complex data organization.
- **File and Network Utilities**: Simplify file system operations and network-related tasks with a collection of helper functions.
- **Time and Date Converters**: Easily convert between different time and date formats, including ISO 8601 and Unix timestamps.
- **String Manipulation**: A set of functions for common string operations, such as capitalization and unique ID generation.
- **Advanced Plotting**: A comprehensive, multi-backend visualization library for scientific research, data analysis, and machine learning.
## Installation
```bash
pip install ures
```
## Modules
### Docker
The `ures.docker` module provides a high-level interface for managing Docker images and containers.
**Key Features**:
- Programmatically build Docker images from a `BuildConfig` object.
- Run containers with detailed runtime configurations using `RuntimeConfig`.
- Orchestrate the building of multiple images with dependencies using `ImageOrchestrator`.
**Example**:
```python
from ures.docker import Image, BuildConfig, Containers
# Define build configuration
build_config = BuildConfig(
base_image="python:3.10-slim",
python_dependencies=["flask", "gunicorn"],
copies=[{"src": "./app", "dest": "/app"}],
entrypoint=["gunicorn", "-b", "0.0.0.0:80", "app:app"]
)
# Build the image
image = Image("my-web-app")
image.build_image(build_config, dest=".")
# Run the container
containers = Containers(image)
container = containers.create()
containers.run()
```
### Markdown
The `ures.markdown` module offers tools for working with Markdown files, including those with YAML front matter. The `Zettelkasten` class extends this functionality for note-taking.
**Key Features**:
- Load, create, and manipulate Markdown files with `MarkdownDocument`.
- Manage YAML front matter with support for nested keys.
- Implement the Zettelkasten method with the `Zettelkasten` class, which includes mandatory metadata fields like `title`, `type`, and `tags`.
**Example**:
```python
from ures.markdown import Zettelkasten
# Create a new Zettelkasten note
note = Zettelkasten(
title="My Research Note",
n_type="permanent",
tags=["research", "python"],
aliases=["research-note"]
)
# Add content
note.add_content("This is a sample research note.")
# Save to file
note.save("my_note.md")
```
### Data Structures
The `ures.data_structure` module provides implementations of advanced data structures.
- **TreeNode**: A tree data structure with methods for adding, removing, and traversing nodes.
- **BiDirectional**: A bi-directional linked list that allows for easy traversal in both forward and backward directions.
### File and Network Utilities
- **`ures.files`**: A collection of functions for file system operations, such as recursively getting file paths, filtering files, and managing temporary directories.
- **`ures.network`**: Helper functions for network-related tasks, including IP address validation and generation.
### Time and Date Converters
The `ures.timedate` module provides functions for converting between different time and date formats.
- `datetime_converter()`: Converts a `datetime` object to a formatted string (ISO 8601 or custom).
- `timestamp_converter()`: Converts a Unix timestamp to a formatted string.
- `time_now()`: Returns the current time as a formatted string.
### String Manipulation
The `ures.string` module offers a variety of string utility functions.
- `zettelkasten_id()`: Generates a unique ID suitable for Zettelkasten notes.
- `unique_id()`: Creates a standard unique identifier.
- `format_memory()`: Formats a memory size into a human-readable string.
- `capitalize_string()`: Capitalizes each word in a string.
## Development
To contribute to URes, please follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/stone-home/Python-URes.git
```
2. Install the dependencies:
```bash
cd Python-URes
poetry install
```
3. Run the tests:
```bash
poetry run pytest
```
## License
This project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/stone-home/Python-URes",
"name": "ures",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "utilization, Research Tool, Python",
"author": "stone",
"author_email": "github@stone-bo.com",
"download_url": "https://files.pythonhosted.org/packages/02/0c/81ab23b42fedb541c7a95146c1e7b3ef7211af5462561911991deae11396/ures-2.0.1.tar.gz",
"platform": null,
"description": "# Utility for Research (URes)\n\n[](https://github.com/semantic-release/semantic-release)\n[](https://github.com/pre-commit/pre-commit)\n[](https://github.com/psf/black)\n[](https://opensource.org/licenses/MIT)\n[](https://github.com/stone-home/Python-URes/actions/workflows/linter.yaml)\n[](https://github.com/stone-home/Python-URes/actions/workflows/secret-check.yaml)\n[](https://github.com/stone-home/Python-URes/actions/workflows/test.yaml)\n\n\n---\n## Overview\n\nURes (Utility for Research) is a versatile Python library that simplifies common research and development tasks. It offers a wide range of modules to handle everything from Docker container management to advanced data visualization and file operations.\n\n## Key Features\n\n - **Docker Management**: Build, run, and manage Docker images and containers with an intuitive Python interface.\n - **Markdown and Zettelkasten**: Create, manipulate, and organize Markdown documents, with support for the Zettelkasten note-taking method.\n - **Data Structures**: Implement and use advanced data structures like Trees and Bi-Directional Links for complex data organization.\n - **File and Network Utilities**: Simplify file system operations and network-related tasks with a collection of helper functions.\n - **Time and Date Converters**: Easily convert between different time and date formats, including ISO 8601 and Unix timestamps.\n - **String Manipulation**: A set of functions for common string operations, such as capitalization and unique ID generation.\n - **Advanced Plotting**: A comprehensive, multi-backend visualization library for scientific research, data analysis, and machine learning.\n\n\n## Installation\n\n```bash\npip install ures\n```\n\n## Modules\n\n### Docker\n\nThe `ures.docker` module provides a high-level interface for managing Docker images and containers.\n\n**Key Features**:\n\n - Programmatically build Docker images from a `BuildConfig` object.\n - Run containers with detailed runtime configurations using `RuntimeConfig`.\n - Orchestrate the building of multiple images with dependencies using `ImageOrchestrator`.\n\n**Example**:\n\n```python\nfrom ures.docker import Image, BuildConfig, Containers\n\n# Define build configuration\nbuild_config = BuildConfig(\n base_image=\"python:3.10-slim\",\n python_dependencies=[\"flask\", \"gunicorn\"],\n copies=[{\"src\": \"./app\", \"dest\": \"/app\"}],\n entrypoint=[\"gunicorn\", \"-b\", \"0.0.0.0:80\", \"app:app\"]\n)\n\n# Build the image\nimage = Image(\"my-web-app\")\nimage.build_image(build_config, dest=\".\")\n\n# Run the container\ncontainers = Containers(image)\ncontainer = containers.create()\ncontainers.run()\n```\n\n### Markdown\n\nThe `ures.markdown` module offers tools for working with Markdown files, including those with YAML front matter. The `Zettelkasten` class extends this functionality for note-taking.\n\n**Key Features**:\n\n - Load, create, and manipulate Markdown files with `MarkdownDocument`.\n - Manage YAML front matter with support for nested keys.\n - Implement the Zettelkasten method with the `Zettelkasten` class, which includes mandatory metadata fields like `title`, `type`, and `tags`.\n\n**Example**:\n\n```python\nfrom ures.markdown import Zettelkasten\n\n# Create a new Zettelkasten note\nnote = Zettelkasten(\n title=\"My Research Note\",\n n_type=\"permanent\",\n tags=[\"research\", \"python\"],\n aliases=[\"research-note\"]\n)\n\n# Add content\nnote.add_content(\"This is a sample research note.\")\n\n# Save to file\nnote.save(\"my_note.md\")\n```\n\n### Data Structures\n\nThe `ures.data_structure` module provides implementations of advanced data structures.\n\n - **TreeNode**: A tree data structure with methods for adding, removing, and traversing nodes.\n - **BiDirectional**: A bi-directional linked list that allows for easy traversal in both forward and backward directions.\n\n### File and Network Utilities\n\n - **`ures.files`**: A collection of functions for file system operations, such as recursively getting file paths, filtering files, and managing temporary directories.\n - **`ures.network`**: Helper functions for network-related tasks, including IP address validation and generation.\n\n### Time and Date Converters\n\nThe `ures.timedate` module provides functions for converting between different time and date formats.\n\n - `datetime_converter()`: Converts a `datetime` object to a formatted string (ISO 8601 or custom).\n - `timestamp_converter()`: Converts a Unix timestamp to a formatted string.\n - `time_now()`: Returns the current time as a formatted string.\n\n### String Manipulation\n\nThe `ures.string` module offers a variety of string utility functions.\n\n - `zettelkasten_id()`: Generates a unique ID suitable for Zettelkasten notes.\n - `unique_id()`: Creates a standard unique identifier.\n - `format_memory()`: Formats a memory size into a human-readable string.\n - `capitalize_string()`: Capitalizes each word in a string.\n\n## Development\n\nTo contribute to URes, please follow these steps:\n\n1. Clone the repository:\n ```bash\n git clone https://github.com/stone-home/Python-URes.git\n ```\n2. Install the dependencies:\n ```bash\n cd Python-URes\n poetry install\n ```\n3. Run the tests:\n ```bash\n poetry run pytest\n ```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The project is designed to provide standard utilization functions for improving the reusability of frequently used functions.",
"version": "2.0.1",
"project_urls": {
"Homepage": "https://github.com/stone-home/Python-URes",
"Repository": "https://github.com/stone-home/Python-URes"
},
"split_keywords": [
"utilization",
" research tool",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7a3bf966c9d05d74102aaba334a4e282abf01839f5c1a4d43decfc5e194ac1bd",
"md5": "3806d7ee7ca164f6df02783d97f0c918",
"sha256": "c035201bf1a95eee407141aa8ddd57db945344b2d16e2bace74e778ef5b1e4e8"
},
"downloads": -1,
"filename": "ures-2.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3806d7ee7ca164f6df02783d97f0c918",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 112696,
"upload_time": "2025-08-24T19:17:19",
"upload_time_iso_8601": "2025-08-24T19:17:19.814209Z",
"url": "https://files.pythonhosted.org/packages/7a/3b/f966c9d05d74102aaba334a4e282abf01839f5c1a4d43decfc5e194ac1bd/ures-2.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "020c81ab23b42fedb541c7a95146c1e7b3ef7211af5462561911991deae11396",
"md5": "9d4c4a24ab7753728bf707d2dd50ba7e",
"sha256": "bc1d54b6f8eb803a462d8ab1ab75bd75d92782459bc072a3b33cafeee6424e81"
},
"downloads": -1,
"filename": "ures-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "9d4c4a24ab7753728bf707d2dd50ba7e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 101480,
"upload_time": "2025-08-24T19:17:21",
"upload_time_iso_8601": "2025-08-24T19:17:21.138399Z",
"url": "https://files.pythonhosted.org/packages/02/0c/81ab23b42fedb541c7a95146c1e7b3ef7211af5462561911991deae11396/ures-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-24 19:17:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stone-home",
"github_project": "Python-URes",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ures"
}