Config Inspector
Overview
Config Inspector is a Python package for working with text-based config and script files.
It supports:
- file registration + metadata collection
- file content payload generation with size limits
- update strategies for INI, TOML, JSON, and plain text files
Primary public APIs:
FileRegistryFileMetadataServiceFileContentServiceupdater_factory(plus updater classes)
Installation
uv pip install config-inspector
Quick Start
from pathlib import Path
import json
from config_inspector import FileContentService
from config_inspector import FileMetadataService
from config_inspector import FileRegistry
from config_inspector import updater_factory
class SizeFormatter:
def format(self, size_bytes: int) -> str:
return f"{size_bytes} bytes"
class DateTimeFormatter:
def format(self, dt) -> str:
return dt.strftime("%Y-%m-%d %H:%M:%S")
metadata_service = FileMetadataService(
size_formatter=SizeFormatter(),
datetime_formatter=DateTimeFormatter(),
)
registry = FileRegistry(metadata_service)
registry.register(Path("settings.json"), label="app-config")
for meta in registry.get_all_metadata():
print(meta)
content_service = FileContentService(metadata_service, max_size_bytes=50_000)
payload = content_service.get_payload(Path("settings.json"), key="config")
content = json.loads(payload["config"]["content"])
content["feature_flag"] = True
updater_factory(".json").update(Path("settings.json"), content)
Development
List available commands:
just --list
Environment setup:
just env
just pip-install-editable
Testing and Quality Gates
Common local checks:
just check
just ci
Targeted commands:
just pytest
just coverage
just open-coverage
just ruff-check
just api-check
Versioning and Release
Version helpers:
just version-show
just version-bump-patch
just version-bump-minor
just version-bump-major
just version-verify
Tag helpers:
just version-tag-dryrun
just version-tag
just version-tag-push
Build and publish helpers:
just dist
just wheel-smoke
just twine-check
just twine-upload-test
just twine-upload
CI
Bitbucket Pipelines is the CI source of truth for this repository.
Main CI command path is:
just ci
Issues
If you experience issues, open one on Bitbucket:
History
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
0.2.0 (2026-05-28)
- ADDED: Log file clearing support via in-place truncation through the new
LogFileUpdaterAPI. - ADDED: Public API export for
LogFileUpdaterat package andupdatersmodule levels. - ADDED: Tests covering log clearing for existing log files and missing log-file creation behavior.
0.1.6 (2026-04-20)
- CHANGED: Updated build/tooling stack in
pyproject.toml(Hatch/hatchling-based build flow and aligned dev/test toolchain). - CHANGED: Versioning/release workflow now uses
pyproject.tomlas version source of truth. - FIXED: Cross-platform (Windows) regex handling in file-size policy tests by escaping dynamic path content.
0.1.5 (2026-03-13)
- CHANGED: Refactored package internals into DDD-aligned subdomains (
updaters,file_content,registry) while preserving top-level public imports and signatures. - CHANGED: Standardized application ports on
Protocolfor cleaner dependency boundaries. - CHANGED: Removed legacy flat modules (
domain.py,updaters.py,services.py,models.py,registry.py,protocols.py) after test migration. - CHANGED: Modernized developer workflow around
Justfilecommands (check,ci,doctor,outdated) and release helpers. - ADDED: Domain-focused tests under
tests/domains/*and stronger architecture/public API contract checks. - ADDED: Version management and safe git tag recipes in
Justfile(version-bump-*,version-tag,version-tag-push). - ADDED: Bitbucket Pipeline CI configuration as the canonical CI path for this repository.
- CHANGED: Release quality gates now include artifact verification, wheel smoke install, and
twine check. - CHANGED: README updated to match current public API usage and
just-based workflows. - CHANGED: Hardened
.gitignorecoverage for Python packaging, test artifacts, and tooling caches. - CHANGED: Removed unused direct runtime dependency on
requests.
0.1.4 (2025-12-04)
- ADDED: tox and 100% test coverage
- ADDED:
updater_factoryto get the correspinding file updater by looking at the file extension.
0.1.3 (2025-12-01)
- ADDED: When writing a file with
FileContentService.write_text()we set utf-8 errors toreplace.
0.1.2 (2025-11-11)
- ADDED: When reading a file with
FileContentService.get_payloadwe set utf-8 errors toreplace.
0.1.1 (2025-11-05)
- ADDED: Added
.jsand.ps1extensions that simply usePlainTextUpdaterand do not try to validate/format on save.
0.1.0 (2025-10-06)
- First release
Metadata
Release files for config-inspector 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| config_inspector-0.2.0.tar.gz | 86.9 kB | Without provenance | Details for config_inspector-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| config_inspector-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for config_inspector-0.2.0-py3-none-any.whl |
Total release size: 106.7 kB
Release files / config_inspector-0.2.0.tar.gz
| Download URL | config_inspector-0.2.0.tar.gz |
|---|---|
| Size | 86.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fcda39fad234e6d73ee7ac00edb00f0fae6574108fd9463548cda4dde314919
|
|
BLAKE2b-256 checksum How to use checksums |
8012b6728ec9d0881a055c24eb8994b5031d8b87d9367779b40cc55033f04b5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Release files / config_inspector-0.2.0-py3-none-any.whl
| Download URL | config_inspector-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58085dea7a4eaea4a9e2ab525baf6496e1999c6e2e2853737da410c8106576e4
|
|
BLAKE2b-256 checksum How to use checksums |
c06ce12fa3a4b0b897a9070ffa9217812081eefcee953c79a9158bc33cd84676
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Security for config-inspector 0.2.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.