Last active
March 7, 2020 23:24
-
-
Save agalea91/a872ca2eabd8f64561b591d7e9c313df to your computer and use it in GitHub Desktop.
Initialize a data science python project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# __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 | |
# Get newly created dir | |
cd "$(\ls -rt | tail -1)" | |
echo "\nMoved to `pwd`\nIs this your new project dir? (y/n)?" | |
read answer | |
if echo "$answer" | grep -iq "^n" ; then | |
echo "Something went wrong. Run cleanup manually 😑" | |
exit 1 | |
else | |
echo "Cleaning up cookiecutter setup 🍪" | |
fi | |
# Remove things I don't use | |
rm Makefile | |
rm -r docs | |
rm tox.ini | |
rm test_environment.py | |
rm -r data/external | |
# Make results folder | |
echo "Making results folder" | |
mv reports results | |
mkdir resutls/tables | |
mkdir results/reports | |
echo "Downloading README.md" | |
curl https://gist.githubusercontent.com/agalea91/a1924d89f3193e390b19afe60c37072c/raw/README.md > README.md | |
echo "Downloading requirements.txt" | |
curl https://gist.githubusercontent.com/agalea91/d5a644b7f0a0ea0bfae237d00ac4cd82/raw/requirements.txt > requirements.txt | |
echo "Downloading .gitignore" | |
curl https://gist.githubusercontent.com/agalea91/e5c94aa44db1648e6c6f2c41e183cbf7/raw/.gitignore > .gitignore | |
# Build out notebooks dir | |
cd notebooks | |
echo "Downloading clean.py" | |
curl https://gist.githubusercontent.com/agalea91/bf277d23aaf3ba2daee3bff62b9a24d6/raw/clean.py > clean.py | |
mkdir src | |
echo "Downloading jupyter_defaults.py" | |
curl https://gist.githubusercontent.com/agalea91/d81e089c89c2a828c4e4c0b4e1919911/raw/jupyter_default.py > src/jupyter_default.py | |
cd .. | |
echo "Done 🍰" | |
tree . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment