---
name: elf
description: >
  Advent of Code helper for Python: fetch and cache inputs, submit answers, and pull private leaderboards. Use when writing Python code that uses the elf package.
license: MIT
compatibility: Requires Python >=3.11.
---

# elf

Advent of Code helper for Python: fetch and cache inputs, submit answers, and pull private leaderboards.

## Installation

```bash
pip install elf
```

## API overview

### Puzzle inputs and answers

- `get_puzzle_input`: Retrieve the raw puzzle input for a specific Advent of Code puzzle
- `submit_puzzle_answer`: Submit an answer for a specific puzzle part
- `SubmissionResult`: Outcome of an answer attempt or a local submission guardrail

### Progress and leaderboards

- `get_user_status`: Retrieve the user's Advent of Code progress for the specified year
- `get_private_leaderboard`: Retrieve a private leaderboard for a given year
- `DayStatus`: Calendar entry for one puzzle day
- `YearStatus`: Advent of Code calendar and account summary for an event page
- `Leaderboard`: Private leaderboard and its members for one Advent of Code event
- `OutputFormat`: Output formats for status and leaderboard queries

### Puzzle helpers

- `helpers.parse_input`
- `helpers.read_input`
- `helpers.timer`

### Submission and leaderboard models

- `models.SubmissionStatus`
- `models.Member`
- `models.StarCompletion`

### Exceptions

- `exceptions.ElfError`
- `exceptions.MissingSessionTokenError`
- `exceptions.PuzzleLockedError`
- `exceptions.InputFetchError`
- `exceptions.SubmissionError`
- `exceptions.LeaderboardFetchError`
- `exceptions.StatusFetchError`

## Resources

- [Full documentation](https://typeerror.com/elf/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
- [Source code](https://github.com/typeerror/elf)
