A Python toolkit for managing runtime asset packages
Project description
๐ฆ AssetKit
A Python toolkit for packaging, discovering, and loading structured runtime assets.
๐ Features
- โ
Structured asset packaging with a clean
resources/assets/convention - โ
AssetManager: Pythonic runtime asset access interface - โ CLI scaffolding for creating reusable asset packages and app templates
- โ
Optional asset injection at creation (
--add <files/dirs>) - โ
Optional install-after-generation (
--install) - โ
Auto-discovery of installed asset packages via
entry_points - โ Fully pip-installable asset bundles โ no runtime source directory needed
- โ Works with plain files, binaries, or entire GitHub repositories
๐ฆ Installation
pip install assetkit
During development:
pip install -e .
๐ CLI Usage
Create a new asset package:
assetkit new my_assets
With additional asset files or folders injected at creation time:
assetkit new my_assets --add /path/to/data.csv /path/to/config/
Auto-install the package after creation:
assetkit new my_assets --install
Scaffold an AI/ML application project:
assetkit scaffold mlkit my_app_project
๐ Example Asset Package Structure
my_assets/
โโโ pyproject.toml
โโโ setup.cfg
โโโ MANIFEST.in
โโโ my_assets/
โโโ __init__.py
โโโ resources/
โโโ assets/
โโโ config/
โ โโโ model.yaml
โโโ data/
โ โโโ sample.csv
โโโ github_repo/
โโโ ...
โก Quick Python Usage Example
from assetkit.asset_manager import AssetManager
assets = AssetManager(package_root="my_assets", resource_dir="resources/assets")
print(assets.list()) # List available assets
print(assets["config/model.yaml"].text()) # Read asset file
๐ Discover All Installed Asset Packages
from assetkit.discovery import discover_asset_managers
packages = discover_asset_managers()
for name, assets in packages.items():
print(f"{name}: {assets.list()}")
๐งช Testing an Installed Asset Package
After creating and installing:
cd my_assets
pip install .
Then test in Python:
from assetkit import AssetManager
assets = AssetManager(package_root="my_assets", resource_dir="resources/assets")
print(assets.list())
๐ณ Dockerized Example (Optional)
You can build reproducible asset packages in Docker:
FROM python:3.12-slim
RUN pip install assetkit
WORKDIR /app
RUN assetkit new my_assets
RUN mkdir -p /app/my_assets/my_assets/resources/assets && echo "Hello" > /app/my_assets/my_assets/resources/assets/hello.txt
WORKDIR /app/my_assets
RUN pip install .
CMD ["python", "-c", "from assetkit import AssetManager; assets = AssetManager(package_root='my_assets', resource_dir='resources/assets'); print(assets.list())"]
๐ License
MIT โ See LICENSE
๐ฌ More Info
๐ Coming Soon (Roadmap)
assetkit bundleandassetkit extractCLI tools- YAML and pandas extensions (
assetkit.ext.*) - Language-agnostic manifest support via
assetkit.yaml - Cross-platform asset publishing and usage
Project details
Release history Release notifications | RSS feed
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 assetkit-0.1.14.tar.gz.
File metadata
- Download URL: assetkit-0.1.14.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ca0782e37df80533343f0071233403aa2304c3e8d610c8beec97902f9e438ec
|
|
| MD5 |
2c3ebeb6a0e61d5324b4eeb53664616c
|
|
| BLAKE2b-256 |
1baa58d3b89b3facf1b5fb82996e1e4a5a165cb8bdcdb6fdece4d4bc1913a5fc
|
File details
Details for the file assetkit-0.1.14-py3-none-any.whl.
File metadata
- Download URL: assetkit-0.1.14-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ad5e19a604d350a52accf22c1118a35e8e1a997df2ec31429080653bb2e8066
|
|
| MD5 |
71cec0dfae4c85fbbab3b7de50267002
|
|
| BLAKE2b-256 |
7d6659f397b878c1b64d5844bc0ae2133f39b69bca36d596edf36066ddabe3db
|