|
1 | | -# python_template |
| 1 | +# wine_quality |
2 | 2 |
|
3 | | - |
4 | | -<!-- <img src="https://user-images.githubusercontent.com/4097471/144654508-823c6e31-5e10-404c-9f9f-0d6b9d6ce617.jpg" width="300"> --> |
| 3 | + |
5 | 4 |
|
6 | 5 | ## Summary |
7 | | -Oftentimes the initial setup of a Python repo can take a few minutes to a couple hours. |
8 | | -By laying the foundation to rapidly implement an idea, can focus on the good bits instead of |
9 | | -devops drudgery. |
10 | | - |
11 | | -### Caveat Emptor |
12 | | -Very little of this gets tested on Windows hosts. Windows Subsystem for Linux (WSL) is used where necessary with the default Ubuntu LTS install. Moved bulk of document to the [markdown](markdown/) directory to opt-in vs. opt-out of documentation. |
13 | | - |
14 | | -Be the change et al if Windows is your main and you wanna raise a PR with broad instructions on getting tooling working under Windows (e.g., docker, poetry, playwright.) |
| 6 | +Udacity course on data science. |
15 | 7 |
|
16 | 8 | **Table of Contents** |
17 | | -* [python_template](#python_template) |
| 9 | +* [wine_quality](#wine_quality) |
18 | 10 | * [Summary](#summary) |
19 | | - * [Caveat Emptor](#caveat-emptor) |
20 | 11 | * [Setup](#setup) |
21 | 12 | * [Usage](#usage) |
22 | | - * [Mac and Linux users](#mac-and-linux-users) |
| 13 | + * [Poetry](#poetry) |
| 14 | + * [Docker](#docker) |
| 15 | + * [Both](#both) |
23 | 16 | * [TODO](#todo) |
| 17 | + * [Further Reading](#further-reading) |
24 | 18 |
|
25 | 19 | ## Setup |
26 | 20 | * Install |
27 | 21 | * [editorconfig](https://editorconfig.org/) |
28 | | - * [wsl](https://docs.microsoft.com/en-us/windows/wsl/setup/environment) |
29 | 22 | * [asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf) |
30 | 23 | * [poetry](https://python-poetry.org/docs/) |
31 | | - * [docker-compose](https://docs.docker.com/compose/install/) |
32 | | - * [playwright](https://playwright.dev/python/docs/intro#installation) |
33 | | - * [Kubernetes (k8s)](markdown/kubernetes.md) |
| 24 | + * [docker](https://docs.docker.com/compose/install/) |
| 25 | +* Download CSVs from [here](https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/) |
| 26 | + * Move to `csv` directory |
34 | 27 |
|
35 | 28 | ## Usage |
36 | | -### Mac and Linux users |
37 | | -Development environments and tooling are first-class citizens on macOS and *nix. For Windows faithfuls, please setup [WSL](markdown/wsl.md). |
| 29 | +### Poetry |
| 30 | +* Install requirements via Poetry: |
| 31 | + ```bash |
| 32 | + poetry install |
| 33 | + poetry run ipython kernel install --name "python3.10.7" --user |
| 34 | + ``` |
| 35 | +* Run Jupyter Lab |
| 36 | + ```bash |
| 37 | + poetry shell |
| 38 | + jupyter lab --ip=0.0.0.0 --port=8888 --no-browser |
| 39 | + ``` |
| 40 | +* Quit the server via `ctrl-c` in the terminal |
| 41 | +* Enter `deactivate` to exit the Poetry virtual environment |
| 42 | + |
| 43 | +### Docker |
| 44 | +* Customize the `.env.example` and rename to `.env` |
| 45 | +* General commands |
| 46 | +```bash |
| 47 | +# build image locally |
| 48 | +docker-compose build --pull --no-cache |
| 49 | +
|
| 50 | +# start container |
| 51 | +docker-compose up -d |
| 52 | +
|
| 53 | +# stop container |
| 54 | +docker-compose stop |
| 55 | +
|
| 56 | +# remove container and network |
| 57 | +docker-compose down |
| 58 | +``` |
| 59 | + |
| 60 | +### Both |
| 61 | +* Open a browser and navigate to `http://127.0.0.1:888` |
| 62 | + * Docker uses the token specified in `.env` |
| 63 | +* Select the "python3.10.7" kernel if asked |
| 64 | +* Open `refactor-wine-quality.ipynb` from the left-hand column |
| 65 | +* Run cells by selecting them and pressing `shift-enter` |
38 | 66 |
|
39 | 67 | ## TODO |
40 | | -* Django |
41 | | - * Merge with [docker_python](https://github.com/pythoninthegrass/docker_python) and put the latter on an ice float |
42 | | -* Flask |
43 | | - * Bonus points for [Svelte](https://svelte.dev/blog/the-easiest-way-to-get-started) front-end ❤️ |
44 | | -* FastAPI |
45 | | -* MongoDB |
46 | | - * Switch to `docker-compose` |
47 | | - * Fix unique index deleting too many keys |
48 | | -* k8s |
49 | | - * `~/.kubeconfig` |
50 | | -* ansible |
51 | | -* wsl |
52 | | - * VSCode |
53 | | - * Remote WSL install and usage |
54 | | - * Or at least further reading nods |
55 | | -* Debugging |
56 | | - * Dependencies |
57 | | - * script itself via [icecream](https://github.com/gruns/icecream) |
| 68 | +* Get Jupyter working in [VSCode](https://github.com/microsoft/vscode-jupyter) |
| 69 | +* `Makefile` |
| 70 | + |
| 71 | +## Further Reading |
| 72 | +[Starting JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html) |
| 73 | + |
| 74 | +[Jupyter Docker Stacks — Docker Stacks documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) |
| 75 | + |
| 76 | +[Dockerizing Jupyter Projects](https://towardsdatascience.com/dockerizing-jupyter-projects-39aad547484a) |
0 commit comments