Skip to main content

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_FILE
  • MIRA_SIGNING_KEY / MIRA_SIGNING_KEY_FILE
  • MIRA_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mirasdks-0.8.2.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mirasdks-0.8.2-py3-none-any.whl (60.4 kB view details)

Uploaded Python 3

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

Hashes for mirasdks-0.8.2.tar.gz
Algorithm Hash digest
SHA256 7432e609a3dc061fc0ec1e8156faa46fdfc7d1443e4dd2703c3ea4d78286cdeb
MD5 fabc3bf909bb09372eb5acf1d76320b4
BLAKE2b-256 cea621a834d846e282246f2df7f608fe131fc500b4cf7e9fa894c5ece29a1987

See more details on using hashes here.

Provenance

The following attestation bundles were made for mirasdks-0.8.2.tar.gz:

Publisher: release.yml on wardenre/MiraSDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mirasdks-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 095076c2ef03be7eb38792e1c946f423af7435d5f34d76f6ee409a127fce12e7
MD5 435bdd1413fde3ab8fb539dbaf0127a5
BLAKE2b-256 bb77d233d6baad13bf2737f79043edc8bfe36de935dd617cb513e85bb111a9eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mirasdks-0.8.2-py3-none-any.whl:

Publisher: release.yml on wardenre/MiraSDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page