https://github.com/luxedo/esb
ESB - Script your way to rescue Christmas as part of the ElfScript Brigade team.
https://github.com/luxedo/esb
Last synced: 9 months ago
JSON representation
ESB - Script your way to rescue Christmas as part of the ElfScript Brigade team.
- Host: GitHub
- URL: https://github.com/luxedo/esb
- Owner: luxedo
- License: gpl-3.0
- Created: 2024-01-30T02:01:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-06T16:51:05.000Z (over 1 year ago)
- Last Synced: 2024-04-07T03:29:12.137Z (over 1 year ago)
- Language: Python
- Size: 598 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-advent-of-code - esb - - `esb` is a CLI tool to help us elves save Christmas for the yearly [Advent of Code](https://adventofcode.com/) events. (Thank you, [Eric! 😉](https://twitter.com/ericwastl)). This tool fetches puzzle statements and puzzle data, creates language agnostic boilerplate code, test run and submit solutions and builds dashboards. Check out an [example repo](https://github.com/luxedo/advent-of-code) created using `esb`! *(Python, Rust, Elixir, Go)* (Tools and Utilities)
README
# ESB - ElfScript Brigade
> Script your way to rescue Christmas as part of the ElfScript Brigade team.
>
> This tool transforms Advent of Code into a CLI adventure

[](https://pypi.org/project/esb) [](https://pypi.org/project/esb) [](https://www.gnu.org/licenses/gpl-3.0.en.html)   
---
In the bureaucratic workshop of Santa's IT department, where the spirit of Christmas and the magic of coding converge, a special group of coding elves emerged known as the **ElfScript Brigade**. These skilled and whimsical elves were bestowed with the mission of safeguarding the joyous essence of Christmas through the power of scripting and coding.
`esb` is a CLI tool to help us elves save Christmas for the yearly [Advent of Code](https://adventofcode.com/) events. (Thank you, [Eric! 😉](https://twitter.com/ericwastl))
This tool allows us _elves_ to:
1. Fetch puzzle statement and puzzle data
2. Create language agnostic boilerplate code\*[Check supported languages](#currently-supported-languages)
3. Test run and submit solutions
4. Shiny dashboards
5. [Follow the rules of automation](#rules-of-automation)
> Check out an [example repo](https://github.com/luxedo/advent-of-code) created using `esb`!
## Table of Contents
- [Installation](##installation)
- [Usage](##usage)
- [Currently supported languages](#currently-supported-languages)
- [FAQ](#faq)
- [Rules of Automation](#rules-of-automation)
- [License](##license)
## Installation
```shell
pip install esb
```
## Usage
> ### TLDR;
>
> ```shell
> mkdir my_aoc_repo && cd my_aoc_repo
>
> # Initializes ESB repo
> esb init
>
> # Create boilerplate code and fetches input data
> esb start --lang rust --year 2023 --day 13
>
> # Code, code, code...
>
> # Run code and submit answer
> esb run --lang rust --year 2023 --day 13 --part 1 --submit
>
> # Collect stars!
> ```
### Initializing the repository
Create a `git` repository and initialize an `esb` repository too.
```shell
mkdir my_aoc_repo
cd my_aoc_repo
git init
esb init
git commit -m "I now pledge to help, and I will forever help, saving christmas."
```
### Add your credentials
Set your credentials by locating your session cookie or save it in a `.env` file. If the cookie expires, you'll have to redo this step for fetching and submitting data.
```shell
export AOC_SESSION_COOKIE=""
# Or
echo "" > .env
```
How to find your Session Cookie? Check [SESSION_COOKIE.md](doc/SESSION_COOKIE.md).
### Fetching problems
Downloads puzzle statement, data and correct answers (if already solved).
```shell
esb fetch --year 2016 --day 9
# Hint: Use brace expansion for fetching multiple days or years
esb fetch --year 2023 --day {1..25}
```
Also fetches default testing files. Check [TESTING.md](doc/TESTING.md) for more information.
### Creating boilerplate code
Run `start` command to create code for the given language. It also fetches data if necessary
```shell
esb start --lang rust --year 2023 --day 13
```
### Running tests
Runs tests or selected tests with:
```shell
esb test --lang rust --year 2016 --day 9 --part 1
```
To select tests, pass `--filter` and select the test name:
```shell
esb test --lang rust --year 2016 --day 9 --part 1 --filter "test_01"
```
Check [TESTING.md](doc/TESTING.md) for more information.
### Running for real
Runs the code for the given input. Also can submit solutions.
```shell
esb run --lang rust --year 2016 --day 9 --part 1
# Run solution and then submit
esb run --lang rust --year 2016 --day 9 --part 1 --submit
```
> **💡 Hint**: `--lang`, `--year`, `--day` and `--part` arguments are cached.
>
> ```shell
> esb start --lang python --year 2018 --day 4
> esb test # Will test the solution created above
> ```
>
> Check current cached arguments with `esb status` Eg:
>
> ```
> = Working on: python, 2018 day 4 part 1 =
> ```
### Check your progress in the command line
`esb status` shows current collected stars and some additional information.
```shell
esb status
```

### Viewing problem statement and inputs
To read the problem statements run `esb show`. The flags `--show-input` and `--show-test`
might be helpful for viewing the inputs.
```shell
esb show --year 2019 --day 19
```
### The dashboards
`esb` generates two dashboards.
1. A section in `README.md` to place a summary of the solutions;
2. A section in `REPORT.md` with detailed data on solution attempts and timing;
> ⚠️ Both files are editable and can be modified manually, except for the section in
> between the tags `