Skip to main content

Filesystem watcher and indexing utilities for aware-cli aware_sdk workflows.

Project description

aware-file-system

aware-file-system is the change-detection layer behind aware-cli and the upcoming aware-sdk. It watches repository folders, persists lightweight indexes, and emits structured events so agents and automation can safely treat the filesystem as a source of truth.

Highlights

  • Recursive watcher – polls directories, classifies create/update/delete events, and normalises them into JSON-ready payloads.
  • Index snapshots – builds MsgPack-backed caches to accelerate large tree scans and cold starts.
  • Pluggable handlers – send events to aware-cli’s summary state, your own async consumers, or a queue service by registering callbacks.
  • Pure Python – easy to embed inside CI, long-running daemons, or custom tools.

Installation

pip install aware-file-system

Requires Python 3.12 or newer.

Quick start

import asyncio
from aware_file_system.config import Config, FileSystemConfig
from aware_file_system.models import ChangeType
from aware_file_system.watcher.file_system_watcher import FileSystemWatcher

async def main() -> None:
    config = Config(file_system=FileSystemConfig(root_path="docs/projects"))
    watcher = FileSystemWatcher(config, poll_interval=2.0)

    def handle(event) -> None:
        if event.change_type is ChangeType.MODIFIED:
            print(f"{event.path} updated ({event.checksum.sha256[:8]})")

    watcher.add_event_handler(handle)

    await watcher.start()
    try:
        await asyncio.sleep(10)
    finally:
        await watcher.stop()

asyncio.run(main())

Integrating with aware-cli

aware-cli summary \
  --project aware-sdk \
  --task cli-release-bundles \
  --watch-root docs/projects

The CLI wires aware-file-system under the hood to stream change events into its summary state. You can reuse the same configuration helpers (environment variables, YAML config) to point at other workspaces or embed the watcher inside your tooling.

Configuration reference

  • AWARE_FILE_SYSTEM_ROOT – override the root directory that should be scanned.
  • AWARE_FILE_SYSTEM_POLL_INTERVAL – polling cadence in seconds (default: 2.0).
  • AWARE_FILE_SYSTEM_CACHE_DIR – location for MsgPack indexes (default: .aware/fs).
  • aware_file_system.config.Config – Python API with sensible defaults and room for custom callbacks.

Testing

Run the suite from the repository root:

uv run --project libs/file_system pytest

Roadmap

  • Optional native backends (inotify/FSEvents) for lower latency on supported platforms.
  • Batched event delivery for agent-friendly payloads.
  • Additional helpers to serialise change events into the Aware receipt format.

Changelog

See CHANGELOG.md.

License

Distributed under the MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

aware_file_system-0.1.0-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file aware_file_system-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aware_file_system-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f12a2b48b1012f9d8799df093dbf4a6ddb272147f66887e0cc96aa75240ac6c
MD5 0fa694bc064d60b7576e03116bfe1197
BLAKE2b-256 896541defbbb9add62ced067632fb7e19aec8ee6966a79e9f85f152d5eb4a091

See more details on using hashes here.

Provenance

The following attestation bundles were made for aware_file_system-0.1.0-py3-none-any.whl:

Publisher: publish-aware-file-system.yml on aware-network/aware

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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