Skip to main content

A minimal shared registry for locating resources on a local machine

Project description

machine-root

The Problem

Programs, scripts, and AIs that run on a machine often need to locate resources - a project folder, a service registry, a configuration file. The usual solutions are fragile: hard-coded paths break when things move, environment variables require manual setup, and configuration systems are overkill for something this simple.

The System

Machine Root is a minimal, shared registry for a local machine. It is a single JSON file - machine-root.json - that maps string keys to locations (typically filesystem paths):

{
  "zoo.projects": "C:/lion/zoo/projects",
  "filetalk.registry": "C:/lion/filetalk/service-registry.json",
  "librarian.main": "C:/lion/librarian/registry.json"
}

Any program that knows the convention can read from the same registry. Keys are stable names; values are locations that can change. No metadata, no nesting, no configuration framework required.

Resolution Order

When looking for machine-root.json, the system checks these locations in order and uses the first one found:

  1. The path in the MACHINE_ROOT environment variable (if set and the file exists)
  2. ./machine-root.json (current working directory)
  3. ~/machine-root.json (user home directory)
  4. Machine-level: C:/machine-root.json (Windows) or /etc/machine-root.json (Linux)

If none are found, operations fail clearly.


The Package

machine-root is a Python package that implements the Machine Root system. It provides a minimal API and a command-line tool for reading and writing the registry.

Install

pip install machine-root

Python API

import machineroot

machineroot.locate()           # path to the active machine-root.json
machineroot.keys()             # list all keys
machineroot.get("zoo.projects")           # get a value
machineroot.set("zoo.projects", "C:/lion/zoo/projects")  # set a value
machineroot.delete("zoo.projects")        # delete a key

Errors:

  • MachineRootNotFoundError - no machine-root.json could be found
  • MachineRootKeyError - the requested key does not exist

CLI

machine-root create
machine-root set zoo.projects C:/lion/zoo/projects
machine-root get zoo.projects
machine-root delete zoo.projects
machine-root keys
machine-root locate
machine-root help

The registry file must be created explicitly with machine-root create, which places it in the user's home directory. All other commands fail if the file does not exist.


License

CC0-1.0 - public domain.

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

machine_root-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

machine_root-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file machine_root-0.1.0.tar.gz.

File metadata

  • Download URL: machine_root-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for machine_root-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ba80f6ba6e1cce3a070e0923af5da26d4e96c7b9ced75c5d56edaae551f5fcd
MD5 4629a99b7325b3237643d2df39aac5f0
BLAKE2b-256 f5855346a979e8677f4cba842aa6a497b9950f492978f9d86b3872186e31add1

See more details on using hashes here.

File details

Details for the file machine_root-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: machine_root-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for machine_root-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f39808b57b4595d6ce2bd42ea5dabc6ebfbee537fbe8486ce9b3988f4577a96f
MD5 c6491343f28f19127db7758c20ed4581
BLAKE2b-256 dfba96b9f89a3c2916b9c05b40edbb2d18ca81dbb9937db9aaf17817d46292a4

See more details on using hashes here.

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