Mira SDK to build, distribute, and run .mira packages
Project description
Mira
Mira is a Python SDK and CLI for building, distributing, and loading packages in a custom .mira format. A .mira file contains compiled bytecode, dependencies, native extensions, and a manifest. Archives can be encrypted and signed.
Requirements
- Python 3.10+
Optional extras
.[crypto]for AES-256-GCM encryption and Ed25519 signing
Install
From PyPI:
python -m pip install MiraSDK
With crypto extras:
python -m pip install "MiraSDK[crypto]"
For development:
python -m pip install -e .[dev]
With crypto extras (dev):
python -m pip install -e .[crypto]
Quick Start (CLI)
mira build ./my_project -o dist
mira run dist/my_project-1.0.0-*.mira
mira inspect dist/my_project-1.0.0-*.mira
mira view dist/my_project-1.0.0-*.mira
mira install dist/my_project-1.0.0-*.mira
mira list
mira info my_project
mira uninstall my_project
Builder API
from mira import MiraBuilder
builder = MiraBuilder("./my_project")
archive_path = builder.build()
print(archive_path)
Runtime API
Load a package and import its modules. The include folder in the manifest becomes the root import name.
from mira import MiraRuntime
runtime = MiraRuntime()
runtime.load("dist/my_project-1.0.0-*.mira")
import MY_PACKAGE
from MY_PACKAGE.module import MyClass
Load from local repository:
runtime.load_from_repo("my_project")
Library API
from mira import MiraLibrary
lib = MiraLibrary()
lib.install("dist/my_project-1.0.0-*.mira")
print(lib.list())
print(lib.info("my_project"))
lib.uninstall("my_project")
Encryption
Enable encryption via config or CLI. Encrypted .mira files are not readable by standard ZIP tools.
[tool.mira]
encrypt = true
cipher = "aes-256-gcm"
mira build ./my_project -o dist --key "my-secret" --cipher aes-256-gcm
mira inspect dist/my_project-1.0.0-*.mira --key "my-secret"
Signing and Verification
Generate keys:
mira keygen --out-private mira_private.pem --out-public mira_public.pem
Sign during build:
mira build ./my_project -o dist --sign-keyfile mira_private.pem --embed-public-key
Verify:
mira verify dist/my_project-1.0.0-*.mira --verify-keyfile mira_public.pem
Key Management
Mira supports keys via flags, key files, environment variables, or interactive prompts.
Environment variables:
MIRA_KEY/MIRA_KEY_FILEMIRA_SIGNING_KEY/MIRA_SIGNING_KEY_FILEMIRA_VERIFY_KEY/MIRA_VERIFY_KEY_FILE
Viewer
mira view dist/my_project-1.0.0-*.mira --key "my-secret"
Examples
mira build ./examples/wer_project -o dist
python ./examples/wer_project/run_example.py
Tests
python -m pytest -q
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 mirasdks-0.8.2.tar.gz.
File metadata
- Download URL: mirasdks-0.8.2.tar.gz
- Upload date:
- Size: 64.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7432e609a3dc061fc0ec1e8156faa46fdfc7d1443e4dd2703c3ea4d78286cdeb
|
|
| MD5 |
fabc3bf909bb09372eb5acf1d76320b4
|
|
| BLAKE2b-256 |
cea621a834d846e282246f2df7f608fe131fc500b4cf7e9fa894c5ece29a1987
|
Provenance
The following attestation bundles were made for mirasdks-0.8.2.tar.gz:
Publisher:
release.yml on wardenre/MiraSDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mirasdks-0.8.2.tar.gz -
Subject digest:
7432e609a3dc061fc0ec1e8156faa46fdfc7d1443e4dd2703c3ea4d78286cdeb - Sigstore transparency entry: 1107732788
- Sigstore integration time:
-
Permalink:
wardenre/MiraSDK@51f0bba3337318efba33e99d67769e9591d61583 -
Branch / Tag:
refs/tags/v0.8.2 - Owner: https://github.com/wardenre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@51f0bba3337318efba33e99d67769e9591d61583 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mirasdks-0.8.2-py3-none-any.whl.
File metadata
- Download URL: mirasdks-0.8.2-py3-none-any.whl
- Upload date:
- Size: 60.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
095076c2ef03be7eb38792e1c946f423af7435d5f34d76f6ee409a127fce12e7
|
|
| MD5 |
435bdd1413fde3ab8fb539dbaf0127a5
|
|
| BLAKE2b-256 |
bb77d233d6baad13bf2737f79043edc8bfe36de935dd617cb513e85bb111a9eb
|
Provenance
The following attestation bundles were made for mirasdks-0.8.2-py3-none-any.whl:
Publisher:
release.yml on wardenre/MiraSDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mirasdks-0.8.2-py3-none-any.whl -
Subject digest:
095076c2ef03be7eb38792e1c946f423af7435d5f34d76f6ee409a127fce12e7 - Sigstore transparency entry: 1107732789
- Sigstore integration time:
-
Permalink:
wardenre/MiraSDK@51f0bba3337318efba33e99d67769e9591d61583 -
Branch / Tag:
refs/tags/v0.8.2 - Owner: https://github.com/wardenre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@51f0bba3337318efba33e99d67769e9591d61583 -
Trigger Event:
release
-
Statement type: