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
Python tools for working with Orbit Ephemeris Messages (OEMs).

Python Orbit Ephemeris Message tools Python tools for working with Orbit Ephemeris Messages (OEMs). Development Status Installation The oem package is

Brad Sease 4 Apr 06, 2022
A simple service that allows you to run commands on the server using text

Server Text A simple flask service that allows you to run commands on the server/computer over sms. Think of it as a shell where you run commands over

MT Devs 49 Nov 09, 2021
Basic code and description for GoBigger challenge 2021.

GoBigger Challenge 2021 en / 中文 Challenge Description 2021.11.13 We are holding a competition —— Go-Bigger: Multi-Agent Decision Intelligence Challeng

OpenDILab 183 Dec 29, 2022
Amazon SageMaker Delta Sharing Examples

This repository contains examples and related resources showing you how to preprocess, train, and serve your models using Amazon SageMaker with data fetched from Delta Lake.

Eitan Sela 5 May 02, 2022
PKU team for 2021 project 'Guangchangwu detection'.

PKU team for 2021 project 'Guangchangwu detection'.

Helin Wang 3 Feb 21, 2022
GMHI: Gut Microbiome Health Index

GMHI: Gut Microbiome Health Index Description Gut Microbiome Health Index (GMHI)

Daniel Chang 2 Jun 30, 2022
Structured, dependable legos for starknet development.

Structured, dependable legos for starknet development.

Alucard 127 Nov 23, 2022
Tools for collecting social media data around focal events

Social Media Focal Events The focalevents codebase provides tools for organizing data collected around focal events on social media. It is often diffi

Ryan Gallagher 80 Nov 28, 2022
Un script en python qui permet d'automatique bumpée (disboard.org) tout les 2h

auto-bumper Un script en python qui permet d'automatique bumpée (disboard.org) tout les 2h Pour la première utilisation, 1.Lancer Install.bat 2.(faire

!! 1 Jan 09, 2022
Stack-overflow-import - Import arbitrary code from Stack Overflow as Python modules.

StackOverflow Importer Do you ever feel like all you’re doing is copy/pasting from Stack Overflow? Let’s take it one step further. from stackoverflow

Filip Haglund 3.7k Jan 08, 2023
Library for Memory Trace Statistics in Python

Memory Search Library for Memory Trace Statistics in Python The library uses tracemalloc as a core module, which is why it is only available for Pytho

Memory Search 1 Dec 20, 2021
Repo to store back end infrastructure for Message in a Bottle

Message in a Bottle Backend API RESTful API for Message in a Bottle frontend application consumption. About The Project • Tools Used • Local Set Up •

4 Dec 05, 2021
Tutorials for on-ramping to StarkNet

Full-Stack StarkNet Repo containing the code for a short tutorial series I wrote while diving into StarkNet and learning Cairo. Aims to onramp existin

Sam Barnes 71 Dec 07, 2022
Tool that adds githuh profile views to ur acc

Tool that adds githuh profile views to ur acc

Lamp 2 Nov 28, 2021
Sentiment Based Product Recommendation System

Sentiment Based Product Recommendation System The e-commerce business is quite p

Sumit Sahay 2 Jan 15, 2022
Cool little Python scripts & projects I've made.

Little Python Projects A repository for neat little Python scripts I've made! How to run a script: *NOTE: You'll need to install Python v3 or higher.

dood 1 Jan 19, 2022
Dev-meme - A repository that contains memes just for people like us

A repository that contains memes just for people like us. Coders are constantly

Padmashree Jha 4 Oct 31, 2022
JurjenLang, an interpreted programming language

JurjenLang An interpreted programming language Getting started Follow these three steps on your computer to get started git clone https://github.com/J

JVerbruggen 5 May 03, 2022
Gmvault: Backup and restore your gmail account

Gmvault: Backup and restore your gmail account Gmvault is a tool for backing up your gmail account and never lose email correspondence. Gmvault is ope

Guillaume Aubert 3.5k Jan 01, 2023
Plugin to generate BOM + CPL files for JLCPCB

KiCAD JLCPCB tools Plugin to generate all files necessary for JLCPCB board fabrication and assembly Gerber files Excellon files BOM file CPL file Furt

bouni 566 Dec 29, 2022