Metadata-Version: 2.4
Name: archon-keymaster
Version: 0.7.0
Summary: Reusable Python Keymaster core library for Archon
Author-email: David McFadzean <davidmc@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/archetech/archon/
Project-URL: Repository, https://github.com/archetech/archon/
Project-URL: Issues, https://github.com/archetech/archon/issues
Project-URL: Documentation, https://github.com/archetech/archon/tree/main/python/keymaster
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx==0.28.1
Requires-Dist: mnemonic==0.21
Requires-Dist: bip-utils==2.9.3
Requires-Dist: bolt11==2.2.0
Requires-Dist: coincurve==21.0.0
Requires-Dist: cryptography==50.0.0
Requires-Dist: python-dotenv==1.2.3
Requires-Dist: redis==5.2.1
Requires-Dist: rfc8785==0.1.4
Dynamic: license-file

# Python Keymaster Library

Reusable Python implementation of the Archon Keymaster business logic.

This package is intended to hold the core wallet, DID, crypto, and asset
behaviors independent of any specific HTTP service runtime. It also exposes
the Python `keymaster` CLI, which mirrors the TypeScript Keymaster CLI command
surface while using this library in-process against a Gatekeeper HTTP endpoint
and local wallet file.

## Install

```bash
pip install archon-keymaster
```

For local development from a repo checkout:

```bash
pip install -e python/keymaster
```

## CLI usage

Configuration comes from the environment, or from a `.env` in the directory you
run from, as with the JS CLI. A variable already exported wins over the file.

```bash
cat > .env <<'ENV'
ARCHON_PASSPHRASE=your-passphrase
ARCHON_GATEKEEPER_URL=http://localhost:4224
ARCHON_WALLET_PATH=./wallet.json
ENV

keymaster --help
keymaster create-wallet
keymaster create-id alice
keymaster list-ids
```

## CLI environment variables

| Variable | Default | Description |
|---|---|---|
| `ARCHON_NODE_URL` / `ARCHON_GATEKEEPER_URL` | `http://localhost:4224` | Gatekeeper HTTP endpoint |
| `ARCHON_WALLET_PATH` | `~/.archon/wallet.json` (`wallet.db` for sqlite), or `./wallet.json` if one is already there | Path to wallet file. The default follows you between directories |
| `ARCHON_WALLET_TYPE` | `json` | Wallet backend: `json` or `sqlite`. The same file the TypeScript CLI opens |
| `ARCHON_PASSPHRASE` | *(asked for)* | Wallet passphrase. For automation; the environment is a poor place for a secret |
| `ARCHON_PASSPHRASE_FILE` | `~/.archon/passphrase` | File holding the passphrase. Read if it exists, so answering the CLI's offer to save ends the asking |
| `ARCHON_DEFAULT_REGISTRY` | `hyperswarm` | Default registry for new DIDs |
