Skip to main content

AppRC: Application Runtime Config

CI License Python PyPI

uv Ruff Pyright pytest

AppRC provides typed application settings, optional user preferences, and independent application paths. An application opts in to configuration, application data, cache, and state separately; a cache-only application does not also acquire configuration files or a workspace registry.

Main dependencies:

  • typed-settings: Convert and validate typed application settings.
  • python-dotenv: Read setting values from dotenv files.
  • platformdirs: Resolve native per-user application paths.
  • filelock: Serialize persistent configuration and resource operations.

AppRC setting layers, optional workspaces, and application code
Fig. 1 - Graphical Abstract: AppRC resolves typed settings from layered sources, applies optional workspace overrides, and shares one declaration across application code and configuration tools.


Table of Contents

  1. AppRC: Application Runtime Config
  2. Installation
    1. One-Line Install
    2. Install from a Cloned Repository
    3. Uninstall
  3. Usage
    1. Load settings
    2. Choose application paths
    3. Save user settings
    4. Add terminal commands
    5. Add a Gradio settings page
  4. Documentation


Installation


One-Line Install

Python 3.12 or newer is required.

Command Includes
python -m pip install "apprc>=0.32.0,<0.33" Core configuration, Typer commands, prompts, and Textual editor.
python -m pip install "apprc-core>=0.32.0,<0.33" Configuration and noninteractive path/maintenance APIs.
python -m pip install "apprc-gui>=0.32.0,<0.33" Configuration and Gradio settings editor.

apprc-core and apprc use import apprc; apprc-gui provides from apprc_gui import ConfigEditor. Terminal and GUI distributions install the matching apprc-core release.

Caution

Version 0.32 makes a breaking API and on-disk configuration cutover. Existing Storage, storage, apprc_dir, and --storage integrations must be changed to the new contracts described in the upgrade guide. AppRC does not move, rename, scan, delete, or automatically upgrade old user files. Keep any old files as-is and deliberately configure the new paths.

CI runs on Ubuntu: core checks cover Python 3.12, 3.13, and 3.14, and GUI/browser checks cover Python 3.12. Windows and macOS runtime and installer code remain, but those platforms are unverified by this CI policy and have known native test failures.


Install from a Cloned Repository

Follow the development environment instructions for editable installs of the core and optional terminal/GUI distributions. Ordinary pip installations do not require uv.


Uninstall

Use the same Python environment as for installation. To remove all three AppRC distributions:

python -m pip uninstall apprc apprc-gui apprc-core

Remove only the distributions you no longer need. Keep apprc-core if another installed application or library depends on it. Package removal does not purge application configuration, data, cache, state, or workspaces; application-owned resource maintenance is a separate, explicit operation.


Usage


Load settings

Create one AppRC, register config sections, then build typed settings from a ResolvedConfig:

import apprc as rc

MyRC = rc.AppRC(app_id="demo")

@MyRC.config("client", prefix="DEMO_")
class ClientSettings(rc.Config):
    timeout: int = rc.field("DEMO_TIMEOUT", default=30)

resolved = MyRC.resolve(environment={"DEMO_TIMEOUT": "10"})
settings = resolved.build(ClientSettings)
assert settings.timeout == 10

resolve() reads configuration and captures a snapshot; build() converts values and validates required fields. Add dotenv files or packaged defaults when required. Provenance records which source supplied each value. Resolution does not write files or alter os.environ.


Choose application paths

Declare only the managed components the application uses:

import apprc as rc

MyRC = rc.AppRC(
    app_id="demo",
    paths=rc.Paths(cache=True),
    layout=rc.Layout.native(),
)

paths = MyRC.paths()                   # inspect; no filesystem writes
cache_dir = MyRC.ensure_path("cache")  # create privately and record ownership

Paths independently enables config, appdata, cache, and state. Layout.native() uses platform user locations; Layout.single_root(root) places enabled categories beneath one explicit root. AppPaths reports disabled locations as None; ensure_path(kind) initializes only the requested component. See path declarations and the path reference.

Managed installers preserve the selected layout in a durable installation record. Reinstallation reuses that choice; an invocation override does not rewrite it. Single-root groups the enabled application resource directories, not the Python environment or fixed native installation support. Plain pip install -e . remains independent of this optional installation workflow.

Applications that need selectable named working directories declare Workspaces(). A WorkspaceManager manages the registry and archive operations separately from AppPaths; selecting a workspace does not relocate configuration, cache, or state. registry=False permits direct-directory selection without enabling config. Call WorkspaceManager.initialize_workspace(root) or use workspace init PATH to prepare the workspace dotenv; this writes no config or registry file.


Save user settings

user_dotenv=rc.UserDotenv() opts into apprc.user.env inside the enabled config directory. UserDotenv requires paths=rc.Paths(config=True); it never enables config implicitly. Obtain a ConfigManager with MyRC.manage() for settings inspection, setup, and reviewed edits. The saved-preference guide contains a complete example. Saved secrets use private companion files; the secret explanation describes their limits.


Add terminal commands

Use rc.cli.mount_app_cli(app, MyRC) to mount available configuration and maintenance groups together. The returned subgroup mapping lets an application add category-specific commands. paths and doctor are always available; config, workspace, and category groups appear only when their declared capabilities exist. The Typer guide and command reference document the groups.

The root purge command previews or removes explicitly declared AppRC-managed resources. It validates ownership and exact targets, never recursively removes unknown files, and never touches workspace payloads or package caches. Providers are required for application-specific operations. See maintenance for its safety boundary.

The Textual editor and Gradio editor edit config settings; when a workspace registry exists, callers supply the separate WorkspaceManager. Editors do not initialize application state merely by opening.


Add a Gradio settings page

Embed apprc_gui.ConfigEditor(manager) in an application-owned Gradio Blocks. If the application declares registry-backed workspaces, provide workspaces=MyRC.workspaces() as well. The Gradio guide shows the integration.

AppRC's optional apprc.distribution authoring APIs generate native installation, launch, and uninstall entries. Applications own their lifecycle payloads, launch actions, and Windows Setup.exe builds.


Documentation

Using the project

  • Documentation — Start here for component names and learning order.
  • How-to user guides — Complete specific tasks with independent examples.
  • Examples — Choose and run complete application setups, including cache-only.
  • Explanations — Understand components and how they connect.
  • References — Look up exact APIs, files, commands, and behavior.

Contributing and maintaining

Metadata

Release files for apprc-core 0.32.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apprc-core 0.32.0
File Size Uploaded Provenance Actions
apprc_core-0.32.0.tar.gz 602.6 kB Without provenance Details for apprc_core-0.32.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apprc-core 0.32.0
File Interpreter ABI Platform Actions
apprc_core-0.32.0-py3-none-any.whl Python 3 none any Details for apprc_core-0.32.0-py3-none-any.whl

Total release size: 996.8 kB

Release files / apprc_core-0.32.0.tar.gz

Download URL apprc_core-0.32.0.tar.gz
Size 602.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c1f42d0123ca1be39cccbb99e410e885cf8f7b6e3d8fe6b37ef265d561d55e44
BLAKE2b-256 checksum
How to use checksums
97b8cdd5459d56512a0a861865f13df8c3dc0859c968652ca36cab6fe8b7e2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / apprc_core-0.32.0-py3-none-any.whl

Download URL apprc_core-0.32.0-py3-none-any.whl
Size 394.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e80ac77da1dc0b317e9ba25552d2c24e664649d68564d7aefe38ea0538f073b2
BLAKE2b-256 checksum
How to use checksums
bb2f7f9cc4d9daeb51707a0d03d93cde1a04a875d3b053af808e94e586e96653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for apprc-core 0.32.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page