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 Rust-free Python developer entries and standalone lifecycle support. In a generated application checkout, use uv run --script app-install.py and uv run --script app-launch.py; installation preserves the actual editable checkout, including dirty source. Native release executables are a separate, explicit authoring build, not a prerequisite for normal generation. Recipients use uv for the application environment; PyApp manages only the native frontend's Python bootstrap. Applications still own lifecycle 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 0.34.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 0.34.0
File Size Uploaded Provenance Actions
apprc-0.34.0.tar.gz 7.8 kB Without provenance Details for apprc-0.34.0.tar.gz

Built distribution (wheel)

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

Total release size: 14.9 kB

Release files / apprc-0.34.0.tar.gz

Download URL apprc-0.34.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1be97fb6a055aea6acc8dcd163889c7a654f525994291c099cd48d0eb8566738
BLAKE2b-256 checksum
How to use checksums
5c195e9f13017a9c5b736c16ce014cccddc1e693b40a0914404d874be25fa8e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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-0.34.0-py3-none-any.whl

Download URL apprc-0.34.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80a300def5d368f71472efcf55f654c7cb990bd3318324fc40bfd8c5baf83909
BLAKE2b-256 checksum
How to use checksums
523b449d82c4644d41a94f4821b2b7722cf573441cbe465f05230b0085a8a869
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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 0.34.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.

Release history Release notifications | RSS feed

This release

0.34.0 This release

2 release files No provenance

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