Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 1.92 KB

File metadata and controls

78 lines (60 loc) · 1.92 KB

Starting a Python project

This document lists steps that I follow when starting a new Python project.

Steps

Step 1: Create a git repo.

I typically do it either on github or bitbucket.

Step 2: Clone this empty git repo on to your local machine.

Voila. Now you have an empty folder (with git setup) on your local machine.

Step 3: Ensure that nbstripout is installed.

This is a must if you plan to work with Jupyter Notebooks.

$ sudo apt-get update
$ sudo apt-get -y install python3-pip
$ pip3 install nbstripout
$ nbstripout install

The .git/config will look something like this once the nbstripout is successfully setup for this repo.

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = git@github.com:vclab/axiom-analytics.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
	remote = origin
	merge = refs/heads/main
[filter "nbstripout"]
	clean = \"/usr/bin/python3\" -m nbstripout
	smudge = cat
[diff "ipynb"]
	textconv = \"/usr/bin/python3\" -m nbstripout -t

Can't find nbstripout even after installation

If you can't seem to find nbstripout even after you have installed it, check out ~/.local/bin.

$ ~/.local/bin/nbstripout install

Step 4: Start coding.

Check out here for some ideas on how to do Python development using Docker on remote machines.

Happy hacking!