Python template for Advent of Code event

Overview

Advent of Code Python Starter

A tamplate for Advent of Code write in Python.

Usage

The project use poetry for project manager. Clone this repository and run poetry install for install dependencies:

$ git clone https://github.com/ljgago/advent-of-code-python-starter aoc-python
$ cd aoc-python

# install dependencies
$ poetry install

# run tests from day01
$ poetry run pytest tests/test_day01.py

# run the day01
# poetry run python -m aoc.day01

Generate

You can generate all necesary files for use in the event with a simple command:

$ poetry run python -m aoc.gen day01

This command generate these files:

* creating /aoc/day01/resources/input.txt
* creating /aoc/day01/__main__.py
* creating /aoc/day01/part1.py
* creating /aoc/day01/part2.py
* creating /aoc/day01/README.md
* creating /tests/test_day01.py
  • /aoc/day01/resources/input.txt: you can insert here the input data.
  • /aoc/day01/__main__.py: is the main module.
  • /aoc/day01/part1.py: solution for part 1.
  • /aoc/day01/part2.py: solution for part 2.
  • /aoc/day01/README.md: you can write the challenge statement.
  • /tests/test_day01.py: is the module where you write the tests.

Config

You can configure the automatic input download from the Advent of Code session token.

For dowload the inputs from web, you needs to set the environment var AOC_SESSION. You can to get the session token from the cookie web browser.

Also can you set the AOC_YEAR to select a certain year. (It is not mandatory use the AOC_YEAR, aoc.gen can get the year automatically)

You can set an .env file with these variables.

Note: You can avoid the generation of the folder __pycache__ set this environment variable export PYTHONDONTWRITEBYTECODE=1 o pass the -B flag after python command.

Folder structure:

├── aoc
│   └── day01
│       ├── __main__.py
│       ├── part1.py
│       ├── part2.py
│       ├── README.md
│       └── resources
│           └── input.txt
└── tests
    ├── conftest.py
    └── test_day01.py

Happy coding!

MIT License

Owner
Leonardo Gago
Electronic Engineer && Software Development
Leonardo Gago
A VirtualBox manager with interactive mode

A VirtualBox manager with interactive mode

Luis Gerardo 1 Nov 21, 2021
Automate your Microsoft Learn Student Ambassadors event certificate with Python

Microsoft Learn Student Ambassador Certificate Automation This repo simply use a template certificate docx file and generates certificates both docx a

Muhammed Oğuz 24 Aug 24, 2022
A Python simple Dice Simulator just for fun

Dice Simulator 🎲 A Simple Python Dice Simulator 🧩 🎮 💭 Description: That program make your RPG session more easy and simple. Roll the dice never be

Lauro Brant 17 May 14, 2022
A python script for practicing Toki Pona.

toki.py A python script for practicing Toki Pona. Modified from a hirigana script by ~vilmibm. Example of the script running: $ ./toki.py This script

Dustin 2 Dec 09, 2021
Usando Multi Player Perceptron e Regressão Logistica para classificação de SPAM

Relatório dos procedimentos executados e resultados obtidos. Objetivos Treinar um modelo para classificação de SPAM usando o dataset train_data. Class

André Mediote 1 Feb 02, 2022
A Non profit app built on top of Frappe framework & ERPNext

Non Profit A Non profit app built on top of Frappe framework & ERPNext. People who change the world need the tools to do it! The Non Profit Modules of

Frappe 16 Nov 17, 2022
Repository for my Monika Assistant project

Monika_Assistant Repository for my Monika Assistant project Major changes: Added face tracker Added manual daily log to see how long it takes me to fi

3 Jan 10, 2022
Design-by-contract in Python3 with informative violation messages and inheritance

icontract icontract provides design-by-contract to Python3 with informative violation messages and inheritance. It also gives a base for a flourishing

275 Jan 02, 2023
Run unpatched binaries on Nix/NixOS

Run unpatched binaries on Nix/NixOS

Thiago Kenji Okada 160 Jan 08, 2023
Projeto job insights - Projeto avaliativo da Trybe do Bloco 32: Introdução à Python

Termos e acordos Ao iniciar este projeto, você concorda com as diretrizes do Código de Ética e Conduta e do Manual da Pessoa Estudante da Trybe. Boas

Lucas Muffato 1 Dec 09, 2021
Submission from Team OMR for the TRI-NIT Hackathon

Submission from Team OMR for the TRI-NIT Hackathon

0 Feb 01, 2022
Union oichecklists For Python

OI Checklist Union Auto-Union user's OI Checklists. Just put your checklist's ID in and it works. How to use it? Put all your OI Checklist IDs (that i

FHVirus 4 Mar 30, 2022
A country information finder module

A country information finder module

Fayas Noushad 3 Nov 28, 2021
Ramadhan countdown - Simple daily reminder about upcoming Ramadhan

Ramadhan Countdown Bot Simple bot for displaying daily reminder about Islamic pr

Abdurrahman Shofy Adianto 1 Feb 06, 2022
With Christmas and New Year ahead, it is time for some festive coding. Here is a Christmas Card for you all!

Christmas Card With Christmas and New Year ahead, it is time for some festive coding! Here is a Christmas Card for you all! NOTE: I have not made this

CodeMaster7000 1 Dec 25, 2021
Projeto de Jogo de dados em Python 3 onde é definido o lado a ser apostado e número de jogadas, pontuando os acertos e exibindo se ganhou ou perdeu.

Jogo de DadoX Projeto de script que simula um Jogo de dados em Python 3 onde é definido o lado a ser apostado (1, 2, 3, 4, 5 e 6) ou se vai ser um núm

Estênio Mariano 1 Jul 10, 2021
Python implementation of the Lox language from Robert Nystrom's Crafting Interpreters

pylox Python implementation of the Lox language from Robert Nystrom's Crafting Interpreters. https://craftinginterpreters.com. This only implements th

David Beazley 37 Dec 28, 2022
CDM Device Checker for python

CDM Device Checker for python

zackmark29 79 Dec 14, 2022
Automates the fixing of problems reported by yamllint by parsing its output

yamlfixer yamlfixer automates the fixing of problems reported by yamllint by parsing its output. Usage This software automatically fixes some errors a

OPT Nouvelle Caledonie 26 Dec 26, 2022
Fully coded Apps by Codex.

OpenAI-Codex-Code-Generation Fully coded Apps by Codex. How I use Codex in VSCode to generate multiple completions with autosorting by highest "mean p

nanowell 47 Jan 01, 2023