App Data
Application data directory management and user profile storage with Pydantic models and filesystem-based persistence.
Overview
vcti-app-data provides two components for managing application state on disk.
AppDataDirectory is a context manager that creates and scopes operations to
an application data directory. ProfileManager handles CRUD operations for
named user profiles, each stored as a JSON file in its own directory, with
active profile tracking and a default profile that cannot be deleted.
Installation
pip install vcti-app-data>=1.0.0
Quick Start
Application data directory
from vcti.app_data import AppDataDirectory
with AppDataDirectory("~/.config/my_app").context() as ctx:
# Working directory is now ~/.config/my_app (created if needed)
(ctx.path / "config.json").write_text('{"theme": "dark"}')
# Original working directory restored on exit
Profile management
from vcti.app_data import ProfileManager
mgr = ProfileManager("~/.config/my_app/profiles")
# Default profile created automatically
mgr.create_profile("dev", name="Development", tags=["dev"])
mgr.create_profile("prod", name="Production", attributes={"region": "us-east"})
mgr.set_active_profile("dev")
print(mgr.get_active_profile()) # "dev"
for profile in mgr.list_profiles():
print(f"{profile.id}: {profile.info.name}")
mgr.delete_profile("prod")
# Deleting the active profile resets to default
Core API
AppDataDirectory
| Method | Description |
|---|---|
context() |
Context manager — creates dir, changes CWD, restores on exit |
path |
The directory path |
ProfileManager
| Method | Description |
|---|---|
create_profile(profile_id, name, ...) |
Create a new profile |
get_profile(profile_id) |
Get profile by ID |
update_profile_info(profile_id, **kwargs) |
Update profile fields |
delete_profile(profile_id) |
Delete profile (not default) |
list_profiles() |
List all profiles (sorted by ID) |
set_active_profile(profile_id) |
Set the active profile |
get_active_profile() |
Get active profile ID |
profile_exists(profile_id) |
Check if profile exists |
Pydantic Models
| Model | Purpose |
|---|---|
ProfileInfo |
name, description, avatar, tags, attributes |
Profile |
id + ProfileInfo |
ProfileList |
Collection of profiles (RootModel) |
Dependencies
- pydantic (>=2.0) — data validation and JSON serialization
Metadata
Release files for vcti-app-data 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vcti_app_data-1.0.0.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vcti_app_data-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.3 kB
Release files / vcti_app_data-1.0.0.tar.gz
| Download URL | vcti_app_data-1.0.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91d59dfc75e27dccc0239a7a319dac83d7a95eecf21d291e5852f931b35bb4b9
|
|
BLAKE2b-256 checksum How to use checksums |
5c188805406188ea79fc912ff63b2af73314b79f1916718ea9d9e3a4a895d980
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.
Transparency logRelease files / vcti_app_data-1.0.0-py3-none-any.whl
| Download URL | vcti_app_data-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97c0fe25cabd622980ec9838e1399d5a9245d1a767ddcf0e91e6c8aeeccf782f
|
|
BLAKE2b-256 checksum How to use checksums |
714e21b0f5b10e10848d14503a482e436c0b101f211461fc0b8963cc1e52b24a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.
Transparency log