Skip to content

Instantly share code, notes, and snippets.

View AdrienHorgnies's full-sized avatar

Adrien Horgnies AdrienHorgnies

View GitHub Profile
@AdrienHorgnies
AdrienHorgnies / relink.py
Created March 26, 2019 13:42
Script to update symbolic links after republication (no longer used, here for posteriority)
@AdrienHorgnies
AdrienHorgnies / magnets.py
Created March 8, 2019 01:57
find magnets and add them to transmission
import argparse
from selenium import webdriver
import time
from subprocess import run
def get_magnets(url):
browser = webdriver.Chrome()
browser.get(url)
@AdrienHorgnies
AdrienHorgnies / README.md
Last active April 12, 2019 23:40
a wrapper around argparse to handle configuration file

confargparse

Extends argparse.ArgumentParser to make it able to take in values from a configuration file.

Beyond the added functionality it doesn't not modify the behaviour of argparse.ArgumentParser and can thus be used as a drop in replacement.

Why

You may want to provide values either to the CLI or by configuration file. And you don't want to check yourself if each value not provided to the CLI is present in the configuration file. And you also don't want the CLI to shout an error because it hasn't been provided an option when it is present in the configuration file.

How