Skip to main content

nomnom

CI PyPI Version Python Versions

nomnom is an extensible file watcher for local automation. The core detects file changes and fires events. Plugins do the actual work: moving files, enriching them, or kicking off downstream workflows.

Install

With uv:

uv tool install nomnom-py

With pip:

pip install nomnom-py

Quick Start

Initialize

Generates a default config.toml in your project root. If you use the built-in rules plugin, keep rules.toml in that same directory so nomnom can read both files together.

nomnom setup

Watch

Starts watching your directories based on the configuration.

nomnom watch

Use nomnom watch --once <group> to process a single watch group one time, or nomnom watch --dry to inspect behavior without applying file effects.

Example Configuration

nomnom reads config.toml from the current project by default, or a custom path passed with --config. When the built-in rules plugin is enabled, nomnom also reads rules.toml from that same directory.

[[watch]]
name = "inbox"
paths = ["./fixtures/inbox"]
include = ["*.pdf", "*.txt"]

[[watch]]
name = "archive"
paths = ["./fixtures/archive"]

[[plugins]]
name = "rules"
priority = 10
enabled = true

For a fuller starter file, see config.example.toml.

Plugins

The Built-in Rules Plugin

A rules plugin for declarative file automation driven by rules.toml. It ships with the main nomnom-py install and is configured as rules. Keep config.toml and rules.toml side by side. If you run nomnom --config /path/to/config.toml, the built-in plugin will read /path/to/rules.toml automatically. See RULES.md for the rule format and supported actions, and rules.example.toml for a starter example.

Installing Community Plugins

Plugins can be installed from PyPI or directly from a Git repository:

nomnom plugin add <package-name-or-git-url>

Example:

nomnom plugin add git+https://github.com/<owner>/nomnom-plugin-example

Creating a Plugin

Scaffold a local plugin package inside plugins/:

nomnom plugin create <name>

The generated package includes a pyproject.toml entry point and a stub plugin module. Local plugins are automatically discoverable, no need to configure them.

If you'd like to publish your plugin, move it to its own repo and publish it to GitHub or PyPI. There is no system for discovering plugins yet but shoot me an email if interested.

Plugin API

Plugins implement two methods:

def matches(self, event: FileEvent) -> bool: ...
def handle(self, event: FileEvent) -> list[Effect]: ...

FileEvent

Field Type Description
event_type EventType EventType.CREATED, MODIFIED, or DELETED
path Path Absolute path to the changed file
watch_group str Name of the watch group that triggered this event
created_at datetime UTC timestamp when the event was created

Effects

handle() returns a list of zero or more Effect values. The dispatcher executes them in order.

Effect Fields Description
MoveFile source: Path, destination: Path, overwrite: bool = True Moves a file. Creates parent directories as needed. Skipped if source is missing; skipped (or overwrites) if destination exists based on overwrite.
DeleteFile path: Path Deletes a file. Skipped if the file does not exist.
CreateFile path: Path, content: bytes Creates a file with the given content, creating parent directories as needed.
EditFile path: Path, action: EditAction, content: bytes Prepends or appends content to an existing file. action is EditAction.PREPEND or EditAction.APPEND.
EmitEvent event: FileEvent Injects a new FileEvent back into the dispatcher. Useful for chaining logic across plugins. Depth is capped at 10 to prevent infinite loops.

Development

uv sync --dev
uv run pytest
uv run ruff check
uv run mypy nomnom

Contributor guidance lives in CONTRIBUTING.md.

Dependencies

nomnom is built with these open-source libraries:

Dev dependencies:

CLI Reference

Core Commands:
  nomnom watch [WATCH_GROUP] [OPTS]  Start watching (Opts: -c/--config, -V/--verbose, --dry-run, --once)
  nomnom setup [OPTS]           Create or update the config file
  nomnom --version / -v         Print installed version

Plugin Management:
  nomnom plugin add PACKAGE     Install and register a plugin
  nomnom plugin remove PACKAGE  Remove a plugin
  nomnom plugin enable NAME     Enable a plugin in config
  nomnom plugin disable NAME    Disable a plugin in config
  nomnom plugin list            List active plugins
  nomnom plugin setup           Run setup for specific/all plugins
  nomnom plugin create NAME     Scaffold a new local plugin

Download files

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

Source Distribution

nomnom_py-1.1.1.tar.gz (78.1 kB view details)

Uploaded Source

Built Distribution

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

nomnom_py-1.1.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file nomnom_py-1.1.1.tar.gz.

File metadata

  • Download URL: nomnom_py-1.1.1.tar.gz
  • Upload date:
  • Size: 78.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nomnom_py-1.1.1.tar.gz
Algorithm Hash digest
SHA256 9ea16d9ce24ddfbdf00efd0c35c91ed2b967360516b6f090b6113e40b89e00a8
MD5 4dd840bbced4bd918dfacd07ddaff744
BLAKE2b-256 30c6a666371fed057a926d88b8ae918d5090f2d8cd4ec161fd7c72715edc974f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nomnom_py-1.1.1.tar.gz:

Publisher: publish.yml on MohammadKanaan/nomnom-py

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

File details

Details for the file nomnom_py-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: nomnom_py-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nomnom_py-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c1264886d5e72a3c4717d7edba7de13b92f51d83e8f560d525dae58a3dc98e8
MD5 caa5b32d4066780100c90a6965bad9a3
BLAKE2b-256 a2713154a14e231be695fdc2d49150418556506ad78d4888cd5b5d73189dca70

See more details on using hashes here.

Provenance

The following attestation bundles were made for nomnom_py-1.1.1-py3-none-any.whl:

Publisher: publish.yml on MohammadKanaan/nomnom-py

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

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page