matrx-utils
Foundation utilities for the Matrx ecosystem — cloud file handling (AWS S3 and local/server filesystems), a pluggable settings + request-context layer, and a set of developer helpers (fancy printing, data transforms, field-processing, code analysis).
matrx-utils is the bottom of the Matrx dependency graph. It has no sibling dependencies. Everything else (matrx-connect, matrx-orm, matrx-graph, matrx-scraper, matrx-ai) depends on it, directly or transitively.
Install
pip install matrx-utils
Python 3.13+ required.
What's in the box
| Module | What it does |
|---|---|
matrx_utils.conf |
configure_settings(obj) + a lazy settings proxy that falls back to env vars |
matrx_utils.ctx |
UserContext protocol, SimpleUserContext, configure_context(getter), get_active_context() |
matrx_utils.fancy_prints |
vcprint, vclist, print_link, MatrixPrintLog, to_matrx_json |
matrx_utils.data_handling |
DataTransformer, URL and value validators |
matrx_files |
FileManager, FileHandler, BatchHandler, open_any_file |
matrx_files.cloud_sync |
S3Backend, ServerBackend, CloudSyncConfig, SyncEngine + permissions and versioning |
matrx_utils.field_processing |
camel_to_snake, process_field_definitions, generate_complete_code |
matrx_utils.code_context, matrx_utils.package_analysis, matrx_utils.react_analysis |
Developer utilities for scanning codebases |
Usage — standalone
Out of the box, matrx-utils reads its configuration from environment variables via a lazy settings proxy, and returns a minimal SimpleUserContext when no request context is available:
from matrx_utils import vcprint, settings
from matrx_files.cloud_sync import S3Backend
vcprint("hello")
vcprint(settings.SUPABASE_URL) # read from env
backend = S3Backend() # credentials resolved from settings
backend.write("reports/today.json", b"{}")
Usage — inside a host application
A parent app (like aidream) can inject its own settings object and request-context resolver so every downstream helper picks up the right user/project/emitter automatically:
from matrx_utils import configure_settings, configure_context
from matrx_connect import try_get_app_context # optional, only if you use matrx-connect
from myapp.settings import settings
configure_settings(settings)
configure_context(try_get_app_context)
After configure_context(...), any code that calls get_active_context() inside a request will get the caller's UserContext without that code having to accept it as a parameter. This is the "capability-within, injection-without" pattern that the other Matrx packages follow.
Standalone-friendliness
This package is designed to work with zero Matrx siblings present. It references matrx-connect in exactly one place — the PDF handler — and that import is lazy with a dict fallback, so pip install matrx-utils followed by import matrx_utils works in any Python project.
Contributing
See CLAUDE.md for package-specific rules (import rules, configuration pattern, known issues). This package lives in the aidream monorepo at github.com/AI-Matrix-Engine/aidream-current.
License
MIT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matrx_utils-2.0.4.tar.gz.
File metadata
- Download URL: matrx_utils-2.0.4.tar.gz
- Upload date:
- Size: 257.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b9bd495d934940c4ae00d572b90cdc7c867132a677ea2d3ba820ad88614ee1
|
|
| MD5 |
97012cc09ed86029d5136f605ff0d5f6
|
|
| BLAKE2b-256 |
07daf4f545302cad93559aec70c39d0df746a6aa5547384578fb13b9468097e3
|
Provenance
The following attestation bundles were made for matrx_utils-2.0.4.tar.gz:
Publisher:
publish-package.yml on AI-Matrix-Engine/aidream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matrx_utils-2.0.4.tar.gz -
Subject digest:
d9b9bd495d934940c4ae00d572b90cdc7c867132a677ea2d3ba820ad88614ee1 - Sigstore transparency entry: 2209464370
- Sigstore integration time:
-
Permalink:
AI-Matrix-Engine/aidream@edba3e8e561a63995306232370acc67c02cc8e32 -
Branch / Tag:
refs/tags/matrx-utils/v2.0.4 - Owner: https://github.com/AI-Matrix-Engine
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@edba3e8e561a63995306232370acc67c02cc8e32 -
Trigger Event:
push
-
Statement type:
File details
Details for the file matrx_utils-2.0.4-py3-none-any.whl.
File metadata
- Download URL: matrx_utils-2.0.4-py3-none-any.whl
- Upload date:
- Size: 281.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d785e76f64b1e40161b2250ff90c5f5a39024cbe5e08144dbc6315811639bc
|
|
| MD5 |
acb13104d103d06d328b32ff342f9c81
|
|
| BLAKE2b-256 |
e34da82e54a3889e9ebee400dc5382337b3741d4c32d5253bdd88ce3a01a13db
|
Provenance
The following attestation bundles were made for matrx_utils-2.0.4-py3-none-any.whl:
Publisher:
publish-package.yml on AI-Matrix-Engine/aidream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matrx_utils-2.0.4-py3-none-any.whl -
Subject digest:
18d785e76f64b1e40161b2250ff90c5f5a39024cbe5e08144dbc6315811639bc - Sigstore transparency entry: 2209464378
- Sigstore integration time:
-
Permalink:
AI-Matrix-Engine/aidream@edba3e8e561a63995306232370acc67c02cc8e32 -
Branch / Tag:
refs/tags/matrx-utils/v2.0.4 - Owner: https://github.com/AI-Matrix-Engine
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@edba3e8e561a63995306232370acc67c02cc8e32 -
Trigger Event:
push
-
Statement type: