matrx-utils 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. matrx_utils-1.0.2/.github/workflows/publish.yml +54 -0
  2. matrx_utils-1.0.2/.gitignore +209 -0
  3. matrx_utils-1.0.2/.python-version +1 -0
  4. matrx_utils-1.0.2/PKG-INFO +131 -0
  5. matrx_utils-1.0.2/README.md +119 -0
  6. matrx_utils-1.0.2/main.py +5 -0
  7. matrx_utils-1.0.2/pyproject.toml +27 -0
  8. matrx_utils-1.0.2/src/matrx_utils/__init__.py +10 -0
  9. matrx_utils-1.0.2/src/matrx_utils/conf.py +211 -0
  10. matrx_utils-1.0.2/src/matrx_utils/data_handling/__init__.py +4 -0
  11. matrx_utils-1.0.2/src/matrx_utils/data_handling/data_transformer.py +895 -0
  12. matrx_utils-1.0.2/src/matrx_utils/data_handling/utils.py +14 -0
  13. matrx_utils-1.0.2/src/matrx_utils/data_handling/validation/__init__.py +0 -0
  14. matrx_utils-1.0.2/src/matrx_utils/data_handling/validation/errors.py +15 -0
  15. matrx_utils-1.0.2/src/matrx_utils/data_handling/validation/validators.py +1076 -0
  16. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/__init__.py +9 -0
  17. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/colors.py +34 -0
  18. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/fancy_prints.py +371 -0
  19. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/matrx_print_logger.py +373 -0
  20. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/redaction.py +48 -0
  21. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/utils/__init__.py +0 -0
  22. matrx_utils-1.0.2/src/matrx_utils/fancy_prints/utils/matrx_json_converter.py +210 -0
  23. matrx_utils-1.0.2/src/matrx_utils/field_processing/__init__.py +5 -0
  24. matrx_utils-1.0.2/src/matrx_utils/field_processing/dataclass_generator.py +295 -0
  25. matrx_utils-1.0.2/src/matrx_utils/field_processing/field_handler.py +172 -0
  26. matrx_utils-1.0.2/src/matrx_utils/file_handling/__init__.py +13 -0
  27. matrx_utils-1.0.2/src/matrx_utils/file_handling/base_handler.py +20 -0
  28. matrx_utils-1.0.2/src/matrx_utils/file_handling/batch_handler.py +89 -0
  29. matrx_utils-1.0.2/src/matrx_utils/file_handling/file_handler.py +252 -0
  30. matrx_utils-1.0.2/src/matrx_utils/file_handling/file_manager.py +167 -0
  31. matrx_utils-1.0.2/src/matrx_utils/file_handling/local_files.py +128 -0
  32. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/__init__.py +0 -0
  33. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/code_handler.py +108 -0
  34. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/html_handler.py +45 -0
  35. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/image_handler.py +166 -0
  36. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/json_handler.py +130 -0
  37. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/markdown_handler.py +130 -0
  38. matrx_utils-1.0.2/src/matrx_utils/file_handling/specific_handlers/text_handler.py +45 -0
  39. matrx_utils-1.0.2/src/matrx_utils/utils/__init__.py +12 -0
  40. matrx_utils-1.0.2/src/matrx_utils/utils/clear_terminal.py +8 -0
  41. matrx_utils-1.0.2/src/matrx_utils/utils/get_dir_structure.py +238 -0
  42. matrx_utils-1.0.2/src/matrx_utils/utils/testing.py +78 -0
  43. matrx_utils-1.0.2/tests/field_generation.py +117 -0
  44. matrx_utils-1.0.2/tests/field_processing.py +66 -0
  45. matrx_utils-1.0.2/tests/get_dir_structure_test.py +56 -0
  46. matrx_utils-1.0.2/tests/load_env_for_test.py +3 -0
  47. matrx_utils-1.0.2/uv.lock +293 -0
@@ -0,0 +1,54 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ id-token: write # Required for trusted publishing
13
+ contents: read
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: '3.12'
23
+
24
+ - name: Install UV
25
+ uses: astral-sh/setup-uv@v4
26
+ with:
27
+ enable-cache: true
28
+
29
+ - name: Extract version from tag
30
+ id: get_version
31
+ run: |
32
+ TAG=${GITHUB_REF#refs/tags/v}
33
+ echo "VERSION=$TAG" >> $GITHUB_OUTPUT
34
+ echo "Publishing version: $TAG"
35
+
36
+ - name: Verify version matches pyproject.toml
37
+ run: |
38
+ TOML_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
39
+ if [ "${{ steps.get_version.outputs.VERSION }}" != "$TOML_VERSION" ]; then
40
+ echo "❌ Error: Git tag version (${{ steps.get_version.outputs.VERSION }}) doesn't match pyproject.toml version ($TOML_VERSION)"
41
+ exit 1
42
+ fi
43
+ echo "✅ Version verified: $TOML_VERSION"
44
+
45
+ - name: Build package
46
+ run: |
47
+ uv build
48
+
49
+ - name: Publish to PyPI
50
+ uses: pypa/gh-action-pypi-publish@release/v1
51
+ with:
52
+ verbose: true
53
+ print-hash: true
54
+
@@ -0,0 +1,209 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Abstra
171
+ # Abstra is an AI-powered process automation framework.
172
+ # Ignore directories containing user credentials, local state, and settings.
173
+ # Learn more at https://abstra.io/docs
174
+ .abstra/
175
+
176
+ # Visual Studio Code
177
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
180
+ # you could uncomment the following to ignore the enitre vscode folder
181
+ # .vscode/
182
+
183
+ # Ruff stuff:
184
+ .ruff_cache/
185
+
186
+ # PyPI configuration file
187
+ .pypirc
188
+
189
+ # Cursor
190
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
191
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192
+ # refer to https://docs.cursor.com/context/ignore-files
193
+ .cursorignore
194
+ .cursorindexingignore
195
+
196
+ .idea/
197
+
198
+
199
+ # Ignore all files in any temp directory and all subdirectories (unlimited depth)
200
+ **/temp/**/*
201
+
202
+ # But allow all directories in any temp folder and all subdirectories (unlimited depth)
203
+ !**/temp/**/
204
+
205
+ .history*
206
+ .history/
207
+ local_data/
208
+ _dev/
209
+ /_dev/
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: matrx-utils
3
+ Version: 1.0.2
4
+ Summary: Basic utilities for matrx
5
+ Author-email: jatin.b.rx3@gmail.com
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: dotenv>=0.9.9
8
+ Requires-Dist: inflect>=7.5.0
9
+ Requires-Dist: pillow>=11.2.1
10
+ Requires-Dist: requests>=2.32.5
11
+ Description-Content-Type: text/markdown
12
+
13
+ # matrx-utils
14
+
15
+ A comprehensive collection of Python utilities designed to complement the AI Matrx platform.
16
+
17
+ ## Overview
18
+
19
+ matrx-utils provides a curated set of utility functions and tools that enhance the AI Matrx ecosystem. This repository serves as a centralized library of commonly used functionality, allowing for easy integration across the main AI Matrx application and related projects.
20
+
21
+ ## Features
22
+
23
+ - **Logging utilities** - Enhanced logging capabilities
24
+ - **Print utilities** - Advanced printing and formatting tools
25
+ - **Code analysis** - Tools for analyzing and processing code
26
+ - **Markdown processing** - Utilities for working with markdown content
27
+ - **Object manipulation** - Helper functions for working with Python objects
28
+ - **Data conversion** - Tools for converting between different data formats
29
+ - **Additional utilities** - Various other Python utility-level tools
30
+
31
+ ## Purpose
32
+
33
+ This library is designed to provide instant access to a powerful set of utilities without requiring additional code setup. All utilities have been customized and configured specifically for the AI Matrx platform ecosystem.
34
+
35
+ ## Installation
36
+
37
+ ### From PyPI (recommended)
38
+
39
+ ```bash
40
+ pip install matrx-utils
41
+ # or with uv
42
+ uv add matrx-utils
43
+ ```
44
+
45
+ ### From GitHub (for development)
46
+
47
+ ```bash
48
+ pip install git+https://github.com/armanisadeghi/matrx-utils.git
49
+ ```
50
+
51
+ ## Quick Start
52
+
53
+ ```python
54
+ import matrx_utils
55
+
56
+ # Example usage will be added as the library develops
57
+ ```
58
+
59
+ ## Contributing
60
+
61
+ This project is part of the AI Matrx ecosystem. Contributions and suggestions are welcome.
62
+
63
+ ## License
64
+
65
+ [License information to be added]
66
+
67
+ ## Related Projects
68
+
69
+ - [AI Matrx](https://github.com/armanisadeghi/ai-matrx) - Main AI Matrx platform repository
70
+
71
+
72
+ ## Publishing a New Version
73
+
74
+ ### Automated PyPI Publishing (Current Process)
75
+
76
+ The package automatically publishes to PyPI when you push a version tag. Here's the workflow:
77
+
78
+ 1. **Make and test your changes locally**
79
+ ```bash
80
+ # Test your changes
81
+ ```
82
+
83
+ 2. **Update the version in pyproject.toml**
84
+ ```toml
85
+ version = "1.0.3" # Increment appropriately
86
+ ```
87
+
88
+ 3. **Commit and push changes**
89
+ ```bash
90
+ git add .
91
+ git commit -m "Add new feature - v1.0.3"
92
+ git push origin main
93
+ ```
94
+
95
+ 4. **Create and push the version tag**
96
+ ```bash
97
+ git tag v1.0.3
98
+ git push origin v1.0.3
99
+ ```
100
+
101
+ 5. **GitHub Actions automatically:**
102
+ - Verifies the tag matches pyproject.toml version
103
+ - Builds the package
104
+ - Publishes to PyPI
105
+
106
+ 6. **Update dependent projects**
107
+
108
+ In projects like AI Dream, simply update the version:
109
+ ```bash
110
+ uv add matrx-utils@1.0.3
111
+ # or manually in pyproject.toml:
112
+ # matrx-utils = "^1.0.3"
113
+ ```
114
+
115
+ ### Version History
116
+
117
+ Check current tags: `git tag`
118
+
119
+ Example output:
120
+ ```
121
+ v1.0.0
122
+ v1.0.1
123
+ v1.0.2
124
+ ```
125
+
126
+ ### Important Notes
127
+
128
+ - **Always update pyproject.toml version before tagging**
129
+ - The GitHub Action will fail if tag version ≠ pyproject.toml version
130
+ - Semantic versioning: MAJOR.MINOR.PATCH (e.g., v1.0.3)
131
+ - Tags trigger automatic PyPI publishing
@@ -0,0 +1,119 @@
1
+ # matrx-utils
2
+
3
+ A comprehensive collection of Python utilities designed to complement the AI Matrx platform.
4
+
5
+ ## Overview
6
+
7
+ matrx-utils provides a curated set of utility functions and tools that enhance the AI Matrx ecosystem. This repository serves as a centralized library of commonly used functionality, allowing for easy integration across the main AI Matrx application and related projects.
8
+
9
+ ## Features
10
+
11
+ - **Logging utilities** - Enhanced logging capabilities
12
+ - **Print utilities** - Advanced printing and formatting tools
13
+ - **Code analysis** - Tools for analyzing and processing code
14
+ - **Markdown processing** - Utilities for working with markdown content
15
+ - **Object manipulation** - Helper functions for working with Python objects
16
+ - **Data conversion** - Tools for converting between different data formats
17
+ - **Additional utilities** - Various other Python utility-level tools
18
+
19
+ ## Purpose
20
+
21
+ This library is designed to provide instant access to a powerful set of utilities without requiring additional code setup. All utilities have been customized and configured specifically for the AI Matrx platform ecosystem.
22
+
23
+ ## Installation
24
+
25
+ ### From PyPI (recommended)
26
+
27
+ ```bash
28
+ pip install matrx-utils
29
+ # or with uv
30
+ uv add matrx-utils
31
+ ```
32
+
33
+ ### From GitHub (for development)
34
+
35
+ ```bash
36
+ pip install git+https://github.com/armanisadeghi/matrx-utils.git
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ ```python
42
+ import matrx_utils
43
+
44
+ # Example usage will be added as the library develops
45
+ ```
46
+
47
+ ## Contributing
48
+
49
+ This project is part of the AI Matrx ecosystem. Contributions and suggestions are welcome.
50
+
51
+ ## License
52
+
53
+ [License information to be added]
54
+
55
+ ## Related Projects
56
+
57
+ - [AI Matrx](https://github.com/armanisadeghi/ai-matrx) - Main AI Matrx platform repository
58
+
59
+
60
+ ## Publishing a New Version
61
+
62
+ ### Automated PyPI Publishing (Current Process)
63
+
64
+ The package automatically publishes to PyPI when you push a version tag. Here's the workflow:
65
+
66
+ 1. **Make and test your changes locally**
67
+ ```bash
68
+ # Test your changes
69
+ ```
70
+
71
+ 2. **Update the version in pyproject.toml**
72
+ ```toml
73
+ version = "1.0.3" # Increment appropriately
74
+ ```
75
+
76
+ 3. **Commit and push changes**
77
+ ```bash
78
+ git add .
79
+ git commit -m "Add new feature - v1.0.3"
80
+ git push origin main
81
+ ```
82
+
83
+ 4. **Create and push the version tag**
84
+ ```bash
85
+ git tag v1.0.3
86
+ git push origin v1.0.3
87
+ ```
88
+
89
+ 5. **GitHub Actions automatically:**
90
+ - Verifies the tag matches pyproject.toml version
91
+ - Builds the package
92
+ - Publishes to PyPI
93
+
94
+ 6. **Update dependent projects**
95
+
96
+ In projects like AI Dream, simply update the version:
97
+ ```bash
98
+ uv add matrx-utils@1.0.3
99
+ # or manually in pyproject.toml:
100
+ # matrx-utils = "^1.0.3"
101
+ ```
102
+
103
+ ### Version History
104
+
105
+ Check current tags: `git tag`
106
+
107
+ Example output:
108
+ ```
109
+ v1.0.0
110
+ v1.0.1
111
+ v1.0.2
112
+ ```
113
+
114
+ ### Important Notes
115
+
116
+ - **Always update pyproject.toml version before tagging**
117
+ - The GitHub Action will fail if tag version ≠ pyproject.toml version
118
+ - Semantic versioning: MAJOR.MINOR.PATCH (e.g., v1.0.3)
119
+ - Tags trigger automatic PyPI publishing
@@ -0,0 +1,5 @@
1
+ from matrx_utils import vcprint, clear_terminal
2
+
3
+ clear_terminal()
4
+
5
+ vcprint("Hello, World!", color="yellow")
@@ -0,0 +1,27 @@
1
+ [project]
2
+ name = "matrx-utils"
3
+ version = "1.0.2"
4
+ description = "Basic utilities for matrx"
5
+ readme = "README.md"
6
+ authors = [
7
+ { email = "jatin.b.rx3@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.10"
10
+ dependencies = [
11
+ "dotenv>=0.9.9",
12
+ "inflect>=7.5.0",
13
+ "pillow>=11.2.1",
14
+ "requests>=2.32.5",
15
+ ]
16
+
17
+ [project.scripts]
18
+ matrx-utils = "matrx_utils:main"
19
+
20
+ [build-system]
21
+ requires = ["hatchling"]
22
+ build-backend = "hatchling.build"
23
+
24
+
25
+ [tool.hatch.build.targets.wheel]
26
+ packages = ["src/matrx_utils"]
27
+
@@ -0,0 +1,10 @@
1
+ from .fancy_prints import vclist, vcprint, pretty_print, print_link, print_truncated, redact_object, redact_string
2
+ from .fancy_prints.matrx_print_logger import MatrixPrintLog
3
+ from .data_handling import DataTransformer
4
+ from .data_handling.validation.validators import URLValidator, validate_url, validate_email
5
+ from .utils import generate_directory_structure, generate_and_save_directory_structure, clear_terminal
6
+ from .file_handling import FileManager, open_any_file
7
+ from .conf import settings, configure_settings, _restricted_task_and_definitions as RESTRICTED_TASK_AND_DEFINITIONS, _restricted_env_vars as RESTRICTED_ENV_VAR_NAMES, _restricted_service_names as RESTRICTED_SERVICE_NAMES, _restricted_fields_names as RESTRICTED_FIELD_NAMES
8
+
9
+ __all__ = ["vclist", "vcprint", "pretty_print", "print_link", "print_truncated", "MatrixPrintLog", "DataTransformer", "URLValidator", "validate_url", "validate_email", "generate_directory_structure", "generate_and_save_directory_structure", "clear_terminal", "FileManager", "configure_settings", "settings"
10
+ ,"RESTRICTED_SERVICE_NAMES", "RESTRICTED_ENV_VAR_NAMES", "RESTRICTED_TASK_AND_DEFINITIONS", "RESTRICTED_FIELD_NAMES", "redact_object", "redact_string", "open_any_file"]