diff --git a/.github/build.yml b/.github/workflows/build.yml similarity index 100% rename from .github/build.yml rename to .github/workflows/build.yml diff --git a/README.md b/README.md index 211aa8c..d55a080 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,59 @@ # Python Snippets -These __Python Snippets__ are tested with Python 3.6.x. All snippets are +These __Python Snippets__ are tested with Python 3.7.x. and are available as Jupyter notebooks (http://jupyter.org/). -## Get started... -To get started create a virtual environment and install the required packages. +## Getting Started +All the required Python packages can be installed with `pipenv`. -- Juypter Notebook -- pandas -- geojson -- beautifulsoup4 -- feedparser -- scikit-image -- matplotlib +### Project Setup +First you nee to install `pipenv`. +```bash +$ pip install --user pipenv +``` + +Install all the required packages + +```bash +$ pipenv install --dev +``` + +### Run the Notebook +You can start `jupyter-lab` to play around with the Juypter notebooks. + + +```bash +pipenv run jupyter-lab +``` + +### Run the Tests (nbval) +To test the Jupyter notebooks this project uses [nbval](https://github.com/computationalmodelling/nbval), which is a `py.test` +plugin for validating Jupyter notebooks. -### Conda -The following example shows how to create an environment with _"conda"_ -(http://conda.pydata.org/) and Python 3.6 with -the required packages. + +This will check all Jupyter notebooks for errors. ```bash -conda create -n py36-ps python=3.6 +pipenv run py.test --nbval-lax +``` + +### Upgrade Python Packages +Check which packages have changed. -source activate py36-ps +``` +pipenv update --outdated +``` + +This will upgrade everything. + +```bash +pipenv update +``` -``` +## CI Build (GitHub Actions) +- ![CI Build](https://github.com/rueedlinger/python-snippets/workflows/CI%20Build/badge.svg) ## The Python Snippets The Python snippets are organized by topic.