Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

🎄 Fraocme

Tests Lint Format codecov

Your cozy companion for solving Advent of Code puzzles in Python ☕✨

Fraocme is a lightweight framework that makes tackling those December coding challenges a breeze. Think clean project structure, helpful debugging tools, and automated timing—all wrapped up like a present under the tree.

What's Inside:

  • 🎁 Simple project scaffolding
  • 🐛 Smart debug utilities
  • ⏱️ Performance tracking & stats
  • 🎨 Pretty output formatting

🎅 Installation

pip install -e .

🚀 Quick Start

Get unwrapping your first puzzle in seconds:

  1. Create a new day solution:

    fraocme create 1
    
  2. Edit days/day_01/solution.py and implement your parse, part1, and part2 methods.

  3. Add your puzzle input to days/day_01/input.txt.

  4. Run it:

    fraocme run 1
    

That's it! 🎉

📝 Example Solution

Here's what a typical solution looks like:

from fraocme import Solver
from fraocme.common.parser import char_lines

class Day1(Solver):
    def parse(self, raw: str) -> list[list[int]]:
        # Parse each line into individual digits
        return char_lines(raw)

    def part1(self, data: list[list[int]]) -> int:
        # Use debug helpers during development
        self.debug("Processing", len(data), "lines")
        return sum(max(line) for line in data)

    def part2(self, data: list[list[int]]) -> int:
        return sum(sum(line) for line in data)

Pro Tips:

  • 🐛 Pass callables to self.debug(lambda: expensive_function()) to avoid computing debug output when not needed
  • 📋 The base Solver automatically handles input copying, so parts don't interfere with each other

🎮 Command Line Interface

Creating Solutions

fraocme create <day>           # Creates days/day_XX/ with solution.py and input.txt
                               # Day must be between 1 and 25 (for those calendar dates!)

Running Solutions

fraocme run <day>              # Run a specific day
fraocme run 1 -p 1             # Run only part 1
fraocme run 1 --debug          # Run with debug output enabled
fraocme run 1 --no-traceback   # Hide tracebacks on errors (cleaner output)
fraocme run --all              # Run all days (marathon mode! 🏃)

Viewing Statistics

fraocme stats                  # Show all stats
fraocme stats 1                # Show stats for day 1

🎁 Parsers & Utilities

Common parsing patterns are built right in:

from fraocme.common.parser import (
    lines,      # Split into lines
    ints,       # Parse integers (one per line)
    digits,     # Parse digits into lists [[1,2,3], [4,5,6]]
    sections,   # Split by blank lines

🐛 Debugging

Enable debug output with the --debug flag:

self.debug("Current value:", x)
self.debug(lambda: expensive_visualization(grid))  # Only computed when --debug is used

Available Debug Helpers:

from fraocme.common.printer import (
    print_dict_row,      # Pretty-print dictionaries
    print_ranges,        # Show range summaries

🧪 Testing

python -m unittest discover -v tests/
# or with uv:
uv run test

See tests/README.md for more details on test organization.

🎄 Happy Coding!

May your solutions be elegant, your bugs be few, and your stars be plentiful! ⭐⭐


Built with ❤️ for Advent of Code enthusiasts There is also a Grid class and helpers for points/directions used in grid-style puzzles.

Debugging

Call self.debug(...) inside your Solver methods. If you need to avoid evaluating expressions unless debug is enabled, pass a callable:

self.debug(lambda: expensive_debug_print(data))

Stats & Timing

Run times are collected by the framework and can be saved to stats.json. Some helper decorators (e.g. @timed, @benchmark) are available under fraocme.profiling.

Code Quality

The project uses Ruff for linting and formatting.

# Check for linting issues
uv run ruff check .

# Format code
uv run ruff format .

# Fix fixable issues
uv run ruff check --fix .

Tests

See tests/README.md for test organization and running tests.


Metadata

Release files for fraocme 1.0.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fraocme 1.0.0b1
File Size Uploaded
fraocme-1.0.0b1.tar.gz 66.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fraocme 1.0.0b1
File Interpreter ABI Platform
fraocme-1.0.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 123.9 kB

Release files / fraocme-1.0.0b1.tar.gz

Download URL fraocme-1.0.0b1.tar.gz
Size 66.3 kB
Tags Source
SHA-256 checksum
How to use checksums
87ed4336c7e09dfc9098ed6f6e62b72b5fce32594148d9b1ba04cb416d13f684
BLAKE2b-256 checksum
How to use checksums
0fddd0d523c5e970691498d6a11097a5d5ecc765426de7613255a83008868754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fraocme-1.0.0b1-py3-none-any.whl

Download URL fraocme-1.0.0b1-py3-none-any.whl
Size 57.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed8d3d2f9afe0ae2ffe3dc6d763ec640566556bb9bacbdcfa425849e176d4bbf
BLAKE2b-256 checksum
How to use checksums
26a8a0acadb655e11bad7917acc32b4f4db509a300dcb639db8bae4f9663714f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.0b1 This release

2 release 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