Python package designed to help you manage and interact with text-based files in a robust and extensible way.
Project description
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.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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file config_inspector-0.1.6.tar.gz.
File metadata
- Download URL: config_inspector-0.1.6.tar.gz
- Upload date:
- Size: 81.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
671ae50545b4af2aaf9b5ec21869a89ecdbda6613e0689b49cb17a0ace748619
|
|
| MD5 |
4370f88abe40000718f0976415623419
|
|
| BLAKE2b-256 |
fdba61157c2ac1cf97584b01a43fb7e2ab08c6f6f353c702a9079f846ade3b02
|
File details
Details for the file config_inspector-0.1.6-py3-none-any.whl.
File metadata
- Download URL: config_inspector-0.1.6-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f66075cead53251714ffd4e0d5fce771302c9be9b504e94fb9874c1b30ff2dc
|
|
| MD5 |
9c89f25ea1c872e28bbc25b1df77de98
|
|
| BLAKE2b-256 |
91abb14e8f6cfe6d3887d9d147f9fe729ff9bbd159e8a42b2a3998025bcee223
|