Skip to main content

Universal config loader with auto-detect, nested keys, merge, and file watcher (JSON/YAML/TOML)

Project description

FilerX

Universal Config Loader for Python (JSON/YAML/TOML) with Nested Keys, Merge, and File Watcher)


Overview

FilerX is a professional Python library designed for developers and DevOps engineers who need a robust, flexible, and easy-to-use configuration management tool. It supports multiple config formats (JSON, YAML, TOML), automatic format detection, nested key access, file merging, and real-time file watching.

Key Features

  • Universal Config Loader: Load JSON, YAML, or TOML files without worrying about file extensions.
  • Nested Keys & Dot Notation: Access or modify deeply nested keys easily (database.connections.0.host).
  • Merge Multiple Files: Combine multiple config files while preserving structure.
  • Auto-Detect & Auto-Fix: Automatically detect file formats and fix minor syntax issues.
  • File Watcher: Monitor files for changes and reload automatically.
  • Extensible: Add support for custom config formats.
  • Python 3.8+ compatible.

Installation

Install FilerX using pip:

pip install filerx

Or clone the repository and install locally:

git clone https://github.com/iTs-GoJo/FilerX.git
cd FilerX
pip install .

Optional extras:

pip install .[dev]
pip install .[watch]
  • dev: For development tools (pytest, black, mypy)
  • watch: Enhances file watcher capabilities with watchdog

Usage

Basic Usage

from filerx import FilerX

# Load a config file (any extension)
config = FilerX("settings.data")

# Access nested key
host = config.get("database.connections.0.host", default="localhost")
print(host)

# Set nested key
config.set("api.tokens.google", "ABC123")

# Merge another config
config.merge("extra_settings.yml")

# Save the updated config
config.save("settings_fixed.data")

Watcher Example

config = FilerX("settings.data", watch=True)
# The config will auto-reload when the file changes

Accessing Nested Arrays

servers = config.get("servers")
first_ip = config.get("servers.0.ip")
config.set("servers.1.ip", "192.168.1.2")

Dynamic Format Extension

from filerx.parser import register_format

# Example: Custom parser for a new config format
register_format("custom", lambda content: my_custom_parser(content))

Keywords

config, loader, json, yaml, toml, nested keys, merge, watcher, settings, file manager, auto-detect, auto-fix, config parser, configuration, devops, python config, config utils, dynamic config, data loader, config merger, json yaml toml, config handler, nested config, file watcher, configuration manager, python library, config editor, config automation, file parser, config toolkit


License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions are welcome! Please submit issues or pull requests via GitHub.

  • Use dev extras for running tests and formatting: pip install .[dev]
  • Ensure all code is formatted with black and type-checked with mypy before submitting.

Contact

For questions or support, contact Ali Jafari at thealiapi@gmail.com.

GitHub: https://github.com/iTs-GoJo/FilerX

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

filerx-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filerx-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file filerx-1.0.0.tar.gz.

File metadata

  • Download URL: filerx-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for filerx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d172b2eace1ce33c63361ddd2ced60e685c91a5dc84e2e496a62b9261f4987ed
MD5 f224dee1e9f39e1716e305ee58e52f97
BLAKE2b-256 bb2e21e03cd6cda58f4398609767f174afaee4bf97d8c7801bae1a1d2b8a8a3f

See more details on using hashes here.

File details

Details for the file filerx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: filerx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for filerx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b6fa01a35c318471dc0bb484e834e3f48e896acc0ea0a1c67f912a67c352d8c
MD5 ff2867399bb6e49c4ce7b4e459f2253b
BLAKE2b-256 defa4cf69863a9aafce14ed7c0e482fb7c77f20537b5f71d9a4a3d73a5dc1f46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page