- Generate key
ssh-keygen
...
cp ./key-name* ~/.ssh
- Go to GitHub repo and add key-name.pub
# Creating a virtual env kernel | |
# ----------------------------- | |
$ python -m venv .venv | |
$ source .venv/bin/activate | |
(.venv) $ pip install ipykernel | |
(.venv) $ python -m ipykernel install --user --name=proj-name | |
# Managing the kernel | |
# ----------------------------- | |
$ jupyter kernelspec list |
def init_logging(level='debug'): | |
import logging | |
import os | |
import datetime | |
from pytz import timezone | |
if level == 'debug': | |
LOGGING_LEVEL = logging.DEBUG | |
elif level == 'info': | |
LOGGING_LEVEL = logging.INFO |
import json | |
def dump_jsonl(data, output_path, append=False): | |
""" | |
Write list of objects to a JSON lines file. | |
""" | |
mode = 'a+' if append else 'w' | |
with open(output_path, mode, encoding='utf-8') as f: | |
for line in data: | |
json_record = json.dumps(line, ensure_ascii=False) |
import sys | |
import os | |
import glob | |
import click | |
@click.command() | |
@click.option( | |
'--whitelist', | |
'-w', | |
default='', |
# Misc python development files | |
.DS_Store | |
.vscode/ | |
.ipynb_checkpoints/ | |
__pycache__/ | |
*.py[cod] | |
*.swp | |
*.swo | |
# Don't commit data or archived notebooks (by default) |
# File path: | |
# ~/.jupyter/jupyter_notebook_config.py | |
import os | |
from subprocess import check_call | |
import datetime | |
import re | |
def timestamped_file(fname): | |
return bool(re.match('.*\d{4}-\d{2}-\d{2}\.ipynb', fname)) |
# __author__ = 'Alex Galea' | |
# __license__ = MIT | |
# __version__ = '0.1.0' | |
# Build with cookiecutter | |
# pip install cookiecutter | |
# Template reference - http://drivendata.github.io/cookiecutter-data-science/ | |
echo "Building cookiecutter template to start" | |
cookiecutter https://github.com/drivendata/cookiecutter-data-science |
import pandas as pd | |
import numpy as np | |
import os | |
import sys | |
import re | |
import datetime | |
import time | |
import glob | |
import json | |
from tqdm import tqdm, tqdm_notebook |