Skip to main content

Script your way to rescue Christmas as part of the ElfScript Brigade team.

Project description

ESB - ElfScript Brigade

⚠️ This project is under development!

Script your way to rescue Christmas as part of the ElfScript Brigade team.

This tool transforms Advent of Code into a CLI adventure

ElfScript Brigade Logo

PyPI - Version PyPI - Python Version License: GPL v3 GitHub Actions Workflow Status Codecov CodeFactor Grade


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 to save Christmas for the Advent Of Code yearly events (Thank you Eric 😉!).

This tool allows us elves to:

  1. Fetch puzzle statement and puzzle data
  2. Create language agnostic boilerplate code*Check supported languages
  3. Test run and submit solutions
  4. Shiny dashboards
  5. Follows the rules of automation

Table of Contents

Installation

pip install esb

Usage

TLDR;

mkdir my_aoc_repo && cd my_aoc_repo

# Initializes ESB repo
esb new

# Create boilerplate code and fetches input data
esb start --lang rust --year 2023 --day 13

# Run code and submit answer
esb run --lang rust --year 2023 --day 13 --submit

# Collect stars!

Initializing the repository

Create a git repository and initialize an esb repository too.

mkdir my_aoc_repo
cd my_aoc_repo
git init
esb new
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.

@TODO: Show how to get the cookie

export AOC_SESSION_COOKIE="<my_current_cookie>"
# Or
echo "<my_current_cookie>" > .env

Fetching problems

Downloads puzzle statement, data and correct answers (when applicable).

esb fetch --year 2016 --day 9

# Hint: Use brace expansion for fetching multiple days or years
esb fetch --year 2023 --day {1..25}

Creating boilerplate code

Run start command to create code for the given language. It also fetches data if necessary

esb start --lang rust --year 2023 --day 13

Running tests

Runs tests or selected tests

# Run all
esb test --all

# Run all from specific language
esb test --year 2016 --day 9 --lang rust --all

# Run single test
esb test --year 2016 --day 9 --lang rust --all

Running for real

Runs the code for the given input. Also can submit solutions.

esb run --year 2016 --day 9 --lang rust

esb run --year 2016 --day 9 --lang rust --submit

Check your progress in the command line

esb status

The dashboards

The dashboards are created automatically when events happen. It's possible to generate again by running:

esb dashboard

Currently supported languages

Currently there are built in 3 supported languages. They set up the basic code for a given day that allows esb to run and test solutions. Check the documentation for each language and how to create your own boilerplate.

Any program that supports the FIREPLACEv1 prococol can use esb tooling.

Dashboards

  • Dash A
  • Dash B

FAQ

  • This tool is so stupid! I can hack my stats anytime I want!

    As Acting Brigade Chief, I have no powers nor will to enforce any regulatory actions against cheating. I leave this job to Santa's higher council and, of course, the guilt of leaving kids without their gifts.

  • Can I use this tool to bash the servers

    No!.

  • But, why python 3.11? What about my Debian friends?

    Because the developer wanted to some of the newest features

Rules of Automation

ElfScript Brigade does follow the automation guidelines on the /r/adventofcode community wiki Specifically:

Once inputs are downloaded, they are cached locally in the data directory. If you suspect your input is corrupted, you can manually request a fresh copy using esb fetch ... --force The User-Agent header for the HTTP requests is set to me since I maintain this tool :)

License

ESB - Script your way to rescue Christmas as part of the ElfScript Brigade team. Copyright (C) 2024 Luiz Eduardo Amaral luizamaral306@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Project details


Download files

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

Source Distribution

esb-0.1.2.tar.gz (49.0 kB view details)

Uploaded Source

Built Distribution

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

esb-0.1.2-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file esb-0.1.2.tar.gz.

File metadata

  • Download URL: esb-0.1.2.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for esb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 18cea5ce4e7b8f5f030d6a9fe268c9253a2daf1b08d30474c19708bf5f2e7a23
MD5 f8a80df8196913404baa3496fd51e1c2
BLAKE2b-256 d889bdc68de82558c3a66326c88e9b5a0e71532216060504f340a775e6f04dae

See more details on using hashes here.

File details

Details for the file esb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: esb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for esb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22c0aee1a1fb5ef8b0acede459ae0e23fc51ad6f54be7d4e6041c33f42c18075
MD5 6682ea3e40ff8b69e1627dc5a0ef02f3
BLAKE2b-256 55de2f7607187655972c6c98ebded0d907bf43e0f38a544f17abf19f40b4cc2b

See more details on using hashes here.

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