Skip to content

Instantly share code, notes, and snippets.

Avatar

Leon afro-coder

View GitHub Profile
View gist:10d64459043e74770c36f98b690ceb5c
import gzip
import json
import re
import os
import datetime
import pprint
import argparse
from collections import OrderedDict
class _RegEx:
@afro-coder
afro-coder / clitools.py
Created Jun 9, 2018
Click using flask application factory (With different configurations)
View clitools.py
"""
I'm really new to python and flask so this maybe terribly wrong but it works at least for me
usage:
python clitools.py --config {{your config}} command
It also prompts just in case you forget.
The ctx object from the click documentation along with the '@click.pass_context helps to push the app variable through
all the functions.