metya 6 anni fa
commit
a9b7b35044
60 ha cambiato i file con 1619 aggiunte e 0 eliminazioni
  1. 1 0
      .gitattributes
  2. 6 0
      .gitignore
  3. 8 0
      LICENSE
  4. 95 0
      README.md
  5. 13 0
      cookiecutter.json
  6. 24 0
      docs/README.md
  7. 3 0
      docs/docs/css/extra.css
  8. BIN
      docs/docs/favicon.ico
  9. 246 0
      docs/docs/index.md
  10. 11 0
      docs/mkdocs.yml
  11. 4 0
      requirements.txt
  12. 47 0
      tests/conftest.py
  13. 113 0
      tests/test_creation.py
  14. 86 0
      {{ cookiecutter.repo_name }}/.gitignore
  15. 17 0
      {{ cookiecutter.repo_name }}/.pre-commit-config.yaml
  16. 38 0
      {{ cookiecutter.repo_name }}/LICENSE
  17. 170 0
      {{ cookiecutter.repo_name }}/Makefile
  18. 54 0
      {{ cookiecutter.repo_name }}/README.md
  19. 0 0
      {{ cookiecutter.repo_name }}/__init__.py
  20. 0 0
      {{ cookiecutter.repo_name }}/app/__init__.py
  21. 0 0
      {{ cookiecutter.repo_name }}/app/api.py
  22. 0 0
      {{ cookiecutter.repo_name }}/app/app.py
  23. 0 0
      {{ cookiecutter.repo_name }}/app/main.py
  24. 0 0
      {{ cookiecutter.repo_name }}/data/external/.gitkeep
  25. 0 0
      {{ cookiecutter.repo_name }}/data/interim/.gitkeep
  26. 0 0
      {{ cookiecutter.repo_name }}/data/processed/.gitkeep
  27. 0 0
      {{ cookiecutter.repo_name }}/data/raw/.gitkeep
  28. 153 0
      {{ cookiecutter.repo_name }}/docs/Makefile
  29. 4 0
      {{ cookiecutter.repo_name }}/docs/commands.rst
  30. 244 0
      {{ cookiecutter.repo_name }}/docs/conf.py
  31. 14 0
      {{ cookiecutter.repo_name }}/docs/getting-started.rst
  32. 24 0
      {{ cookiecutter.repo_name }}/docs/index.rst
  33. 190 0
      {{ cookiecutter.repo_name }}/docs/make.bat
  34. 0 0
      {{ cookiecutter.repo_name }}/logs/.gitkeep
  35. 0 0
      {{ cookiecutter.repo_name }}/models/.gitkeep
  36. 0 0
      {{ cookiecutter.repo_name }}/nets/__init__.py
  37. 0 0
      {{ cookiecutter.repo_name }}/nets/models/.gitkeep
  38. 0 0
      {{ cookiecutter.repo_name }}/nets/models/__init__.py
  39. 0 0
      {{ cookiecutter.repo_name }}/nets/models/models.py
  40. 0 0
      {{ cookiecutter.repo_name }}/nets/models/predict.py
  41. 0 0
      {{ cookiecutter.repo_name }}/nets/models/train.py
  42. 0 0
      {{ cookiecutter.repo_name }}/nets/pipelines/.gitkeep
  43. 0 0
      {{ cookiecutter.repo_name }}/nets/settings.py
  44. 5 0
      {{ cookiecutter.repo_name }}/nets/utils/__init__.py
  45. 0 0
      {{ cookiecutter.repo_name }}/nets/utils/featurize.py
  46. 0 0
      {{ cookiecutter.repo_name }}/nets/utils/make_dataset.py
  47. 0 0
      {{ cookiecutter.repo_name }}/nets/utils/utils.py
  48. 0 0
      {{ cookiecutter.repo_name }}/nets/visualization/.gitkeep
  49. 0 0
      {{ cookiecutter.repo_name }}/nets/visualization/__init__.py
  50. 0 0
      {{ cookiecutter.repo_name }}/nets/visualization/visualization.py
  51. 0 0
      {{ cookiecutter.repo_name }}/notebooks/.gitkeep
  52. 1 0
      {{ cookiecutter.repo_name }}/notebooks/1.0-{{cookiecutter.author_name}}-eda.ipynb
  53. 0 0
      {{ cookiecutter.repo_name }}/references/.gitkeep
  54. 0 0
      {{ cookiecutter.repo_name }}/reports/.gitkeep
  55. 0 0
      {{ cookiecutter.repo_name }}/reports/figures/.gitkeep
  56. 0 0
      {{ cookiecutter.repo_name }}/reports/images/.gitkeep
  57. 10 0
      {{ cookiecutter.repo_name }}/requirements.txt
  58. 10 0
      {{ cookiecutter.repo_name }}/setup.py
  59. 25 0
      {{ cookiecutter.repo_name }}/test_environment.py
  60. 3 0
      {{ cookiecutter.repo_name }}/tox.ini

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+* text=auto

+ 6 - 0
.gitignore

@@ -0,0 +1,6 @@
+docs/site/
+
+# test cache
+.cache/*
+tests/__pycache__/*
+*.pytest_cache/

+ 8 - 0
LICENSE

@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 95 - 0
README.md

@@ -0,0 +1,95 @@
+# Cookiecutter Cookiekaker Data Science Template inspired by @vasinkd and @drivendata
+
+_A not quite logical, nad unreasonably standardized, but flexible project structure for doing and sharing data science work at certain motivation and place._
+
+Cookiecutter Data Science is a real game changer for data science projects. I use it, but change many things, because, you know, automotization!
+
+I made several tweaks on base of drivendata template which helps me to improve my working routine.
+
+__HOW TO USE:__
+
+First of all, install cookiecutter with:
+```bash
+$ pip install cookiecutter
+```
+or
+```bash
+$ conda install cookiecutter
+```
+or 
+```bash
+$ apt install cookiecutter
+```
+After that you can use template with:
+```bash
+$ cookiecutter https://github.com/metya/cookiekaker
+```
+
+__Features:__
+- May choose python3.5, python3.6, python3.7, python3.8
+
+
+- Creation of virtual envronment is limited to virtualenv.
+- Creation of virtual envronment also sets up git vcs and dvc vcs and pre-commit hooks
+- Project library renamed from src to project_name which lets you use the created library on your machine from anythere
+- Added pipeline folder to store all dvc pipelines there
+- Added data/features folder
+- Added settings.py to illustrate how to use .env file
+- Added an empty noteboook "1.0-{{cookiecutter.author_name}}-dvc-pipeline.ipynb" to store all dvc pipelines creation commands and to illustrate that numeration of notebooks is a good idea
+- Cleared make_dataset.py since I find it too restrictive and confusing
+- Removed aws sync functions
+- Removed data folder from .gitignore since dvc version control takes care of .gitignore
+- Removed tox.ini since .pre-commit.yaml is enough for me
+
+### The resulting directory structure
+------------
+
+The directory structure of your new project looks like this:
+
+```
+├── LICENSE
+├── Makefile           <- Makefile with commands like `make data` or `make train`
+├── README.md          <- The top-level README for developers using this project.
+├── data
+│   ├── external       <- Data from third party sources.
+│   ├── interim        <- Intermediate data that has been transformed.
+│   ├── processed      <- The final, canonical data sets for modeling.
+│   ├── features       <- Features may be stored here
+│   ├── inference      <- Inference stages may be stored here
+│   └── raw            <- The original, immutable data dump.
+│
+├── docs               <- A default Sphinx project; see sphinx-doc.org for details
+│
+├── models             <- Trained and serialized models, model predictions, or model summaries
+│
+├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
+│                         the creator's initials, and a short `-` delimited description, e.g.
+│                         `1.0-jqp-initial-data-exploration`.
+│
+├── references         <- Data dictionaries, manuals, and all other explanatory materials.
+│
+├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
+│   └── figures        <- Generated graphics and figures to be used in reporting
+│
+├── .pre-commit-config.yaml <- Stores pre-commit settings
+│
+├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
+│                         generated with `pip freeze > requirements.txt`
+│
+├── __init__.py
+│
+└── <project_name>     <- Source code for use in this project.
+    ├── __init__.py    <- Makes {{cookiecutter.repo_name}} a Python module
+    │    
+    ├── settings.py <- illustrates how to use .env file
+    │
+    ├── data           <- Scripts to download or generate data
+    │   └── make_dataset.py
+    │
+    ├── features       <- Scripts to turn raw data into features for modeling
+    │   └── featurize.py
+    │
+    └── models         <- Scripts to train models and then use trained models to make
+        │                 predictions
+        └── train.py
+```

+ 13 - 0
cookiecutter.json

@@ -0,0 +1,13 @@
+{
+    "project_name": "project_name",
+    "repo_name": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}",
+    "author_name": "Your username (or your organization/company/team)",
+    "description": "A short description of the project.",
+    "open_source_license": ["No license file", "MIT", "BSD-3-Clause"],
+    "s3_bucket": "[OPTIONAL] your-bucket-for-syncing-data (do not include 's3://')",
+    "aws_profile": "default",
+    "minio": "[OPTIONAL] your-minio-for-syncing data",
+    "minio_profile": "default",
+    "python_interpreter": ["python"],
+    // "git_remote_repo": "Your remote repo for this project"
+}

+ 24 - 0
docs/README.md

@@ -0,0 +1,24 @@
+Generating the docs
+----------
+
+Install requirements:
+
+    pip install -r requirements.txt
+
+or 
+
+    conda install --yes --file requirements.txt
+
+Change directories into the docs folder:
+
+    cd docs
+
+Use [mkdocs](http://www.mkdocs.org/) structure to update the documentation. Test locally with:
+
+    mkdocs serve
+
+Once the docs look good, publish to `gh-pages` branch with:
+
+    mkdocs gh-deploy --clean
+
+** Note **: Never edit the generated site by hand because using `gh-deploy` blows away the `gh-pages` branch and you'll lose your edits.

+ 3 - 0
docs/docs/css/extra.css

@@ -0,0 +1,3 @@
+h1, h2, h3 {
+    margin-top: 77px;
+}

BIN
docs/docs/favicon.ico


+ 246 - 0
docs/docs/index.md

@@ -0,0 +1,246 @@
+# Cookiecutter Data Science
+
+_A logical, reasonably standardized, but flexible project structure for doing and sharing data science work._
+
+## Why use this project structure?
+
+> We're not talking about bikeshedding the indentation aesthetics or pedantic formatting standards — ultimately, data science code quality is about correctness and reproducibility.
+
+When we think about data analysis, we often think just about the resulting reports, insights, or visualizations. While these end products are generally the main event, it's easy to focus on making the products _look nice_ and ignore the _quality of the code that generates them_. Because these end products are created programmatically, **code quality is still important**! And we're not talking about bikeshedding the indentation aesthetics or pedantic formatting standards — ultimately, data science code quality is about correctness and reproducibility.
+
+It's no secret that good analyses are often the result of very scattershot and serendipitous explorations. Tentative experiments and rapidly testing approaches that might not work out are all part of the process for getting to the good stuff, and there is no magic bullet to turn data exploration into a simple, linear progression.
+
+That being said, once started it is not a process that lends itself to thinking carefully about the structure of your code or project layout, so it's best to start with a clean, logical structure and stick to it throughout. We think it's a pretty big win all around to use a fairly standardized setup like this one. Here's why:
+
+
+### Other people will thank you
+
+> Nobody sits around before creating a new Rails project to figure out where they want to put their views; they just run `rails new` to get a standard project skeleton like everybody else.
+
+A well-defined, standard project structure means that a newcomer can begin to understand an analysis without digging in to extensive documentation. It also means that they don't necessarily have to read 100% of the code before knowing where to look for very specific things.
+
+Well organized code tends to be self-documenting in that the organization itself provides context for your code without much overhead. People will thank you for this because they can:
+
+ - Collaborate more easily with you on this analysis
+ - Learn from your analysis about the process and the domain
+ - Feel confident in the conclusions at which the analysis arrives
+
+A good example of this can be found in any of the major web development frameworks like Django or Ruby on Rails. Nobody sits around before creating a new Rails project to figure out where they want to put their views; they just run `rails new` to get a standard project skeleton like everybody else. Because that default project structure is _logical_ and _reasonably standard across most projects_, it is much easier for somebody who has never seen a particular project to figure out where they would find the various moving parts.
+
+Another great example is the [Filesystem Hierarchy Standard](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard) for Unix-like systems. The `/etc` directory has a very specific purpose, as does the `/tmp` folder, and everybody (more or less) agrees to honor that social contract. That means a Red Hat user and an Ubuntu user both know roughly where to look for certain types of files, even when using each other's system — or any other standards-compliant system for that matter!
+
+Ideally, that's how it should be when a colleague opens up your data science project.
+
+### You will thank you
+
+Ever tried to reproduce an analysis that you did a few months ago or even a few years ago? You may have written the code, but it's now impossible to decipher whether you should use `make_figures.py.old`, `make_figures_working.py` or `new_make_figures01.py` to get things done. Here are some questions we've learned to ask with a sense of existential dread:
+
+* Are we supposed to go in and join the column X to the data before we get started or did that come from one of the notebooks?
+* Come to think of it, which notebook do we have to run first before running the plotting code: was it "process data" or "clean data"?
+* Where did the shapefiles get downloaded from for the geographic plots?
+* _Et cetera, times infinity._
+
+These types of questions are painful and are symptoms of a disorganized project. A good project structure encourages practices that make it easier to come back to old work, for example separation of concerns, abstracting analysis as a [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph), and engineering best practices like version control.
+
+### Nothing here is binding
+
+> "A foolish consistency is the hobgoblin of little minds" — Ralph Waldo Emerson (and [PEP 8!](https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds))
+
+Disagree with a couple of the default folder names? Working on a project that's a little nonstandard and doesn't exactly fit with the current structure? Prefer to use a different package than one of the (few) defaults?
+
+**Go for it!** This is a lightweight structure, and is intended to be a good _starting point_ for many projects. Or, as PEP 8 put it:
+
+> Consistency within a project is more important. Consistency within one module or function is the most important. ... However, know when to be inconsistent -- sometimes style guide recommendations just aren't applicable. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask!
+
+## Getting started
+
+With this in mind, we've created a data science cookiecutter template for projects in Python. Your analysis doesn't have to be in Python, but the template does provide some Python boilerplate that you'd want to remove (in the `src` folder for example, and the Sphinx documentation skeleton in `docs`).
+
+### Requirements
+
+ - Python 2.7 or 3.5
+ - [cookiecutter Python package](http://cookiecutter.readthedocs.org/en/latest/installation.html) >= 1.4.0: `pip install cookiecutter`
+
+
+### Starting a new project
+
+Starting a new project is as easy as running this command at the command line. No need to create a directory first, the cookiecutter will do it for you.
+
+```nohighlight
+cookiecutter https://github.com/drivendata/cookiecutter-data-science
+```
+
+### Example
+
+[![asciicast](https://asciinema.org/a/244658.svg)](https://asciinema.org/a/244658)
+
+## Directory structure
+
+```nohighlight
+├── LICENSE
+├── Makefile           <- Makefile with commands like `make data` or `make train`
+├── README.md          <- The top-level README for developers using this project.
+├── data
+│   ├── external       <- Data from third party sources.
+│   ├── interim        <- Intermediate data that has been transformed.
+│   ├── processed      <- The final, canonical data sets for modeling.
+│   └── raw            <- The original, immutable data dump.
+│
+├── docs               <- A default Sphinx project; see sphinx-doc.org for details
+│
+├── models             <- Trained and serialized models, model predictions, or model summaries
+│
+├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
+│                         the creator's initials, and a short `-` delimited description, e.g.
+│                         `1.0-jqp-initial-data-exploration`.
+│
+├── references         <- Data dictionaries, manuals, and all other explanatory materials.
+│
+├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
+│   └── figures        <- Generated graphics and figures to be used in reporting
+│
+├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
+│                         generated with `pip freeze > requirements.txt`
+│
+├── setup.py           <- Make this project pip installable with `pip install -e`
+├── src                <- Source code for use in this project.
+│   ├── __init__.py    <- Makes src a Python module
+│   │
+│   ├── data           <- Scripts to download or generate data
+│   │   └── make_dataset.py
+│   │
+│   ├── features       <- Scripts to turn raw data into features for modeling
+│   │   └── build_features.py
+│   │
+│   ├── models         <- Scripts to train models and then use trained models to make
+│   │   │                 predictions
+│   │   ├── predict_model.py
+│   │   └── train_model.py
+│   │
+│   └── visualization  <- Scripts to create exploratory and results oriented visualizations
+│       └── visualize.py
+│
+└── tox.ini            <- tox file with settings for running tox; see tox.testrun.org
+```
+
+## Opinions
+
+There are some opinions implicit in the project structure that have grown out of our experience with what works and what doesn't when collaborating on data science projects. Some of the opinions are about workflows, and some of the opinions are about tools that make life easier. Here are some of the beliefs which this project is built on—if you've got thoughts, please [contribute or share them](#contributing).
+
+### Data is immutable
+
+Don't ever edit your raw data, especially not manually, and especially not in Excel. Don't overwrite your raw data. Don't save multiple versions of the raw data. Treat the data (and its format) as immutable. The code you write should move the raw data through a pipeline to your final analysis. You shouldn't have to run all of the steps every time you want to make a new figure (see [Analysis is a DAG](#analysis-is-a-dag)), but anyone should be able to reproduce the final products with only the code in `src` and the data in `data/raw`.
+
+Also, if data is immutable, it doesn't need source control in the same way that code does. Therefore, ***by default, the data folder is included in the `.gitignore` file.*** If you have a small amount of data that rarely changes, you may want to include the data in the repository. Github currently warns if files are over 50MB and rejects files over 100MB. Some other options for storing/syncing large data include [AWS S3](https://aws.amazon.com/s3/) with a syncing tool (e.g., [`s3cmd`](http://s3tools.org/s3cmd)), [Git Large File Storage](https://git-lfs.github.com/), [Git Annex](https://git-annex.branchable.com/), and [dat](http://dat-data.com/). Currently by default, we ask for an S3 bucket and use [AWS CLI](http://docs.aws.amazon.com/cli/latest/reference/s3/index.html) to sync data in the `data` folder with the server.
+
+### Notebooks are for exploration and communication
+
+Notebook packages like the [Jupyter notebook](http://jupyter.org/), [Beaker notebook](http://beakernotebook.com/), [Zeppelin](http://zeppelin-project.org/), and other literate programming tools are very effective for exploratory data analysis. However, these tools can be less effective for reproducing an analysis. When we use notebooks in our work, we often subdivide the `notebooks` folder. For example, `notebooks/exploratory` contains initial explorations, whereas `notebooks/reports` is more polished work that can be exported as html to the `reports` directory.
+
+Since notebooks are challenging objects for source control (e.g., diffs of the `json` are often not human-readable and merging is near impossible), we recommended not collaborating directly with others on Jupyter notebooks. There are two steps we recommend for using notebooks effectively:
+
+ 1. Follow a naming convention that shows the owner and the order the analysis was done in. We use the format `<step>-<ghuser>-<description>.ipynb` (e.g., `0.3-bull-visualize-distributions.ipynb`).
+
+ 2. Refactor the good parts. Don't write code to do the same task in multiple notebooks. If it's a data preprocessing task, put it in the pipeline at `src/data/make_dataset.py` and load data from `data/interim`. If it's useful utility code, refactor it to `src`.
+
+ Now by default we turn the project into a Python package (see the `setup.py` file). You can import your code and use it in notebooks with a cell like the following:
+
+```
+# OPTIONAL: Load the "autoreload" extension so that code can change
+%load_ext autoreload
+
+# OPTIONAL: always reload modules so that as you change code in src, it gets loaded
+%autoreload 2
+
+from src.data import make_dataset
+```
+
+### Analysis is a DAG
+
+Often in an analysis you have long-running steps that preprocess data or train models. If these steps have been run already (and you have stored the output somewhere like the `data/interim` directory), you don't want to wait to rerun them every time. We prefer [`make`](https://www.gnu.org/software/make/) for managing steps that depend on each other, especially the long-running ones. Make is a common tool on Unix-based platforms (and [is available for Windows]()). Following the [`make` documentation](https://www.gnu.org/software/make/), [Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html#Makefile-Conventions), and [portability guide](http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Portable-Make.html#Portable-Make) will help ensure your Makefiles work effectively across systems. Here are [some](http://zmjones.com/make/) [examples](http://blog.kaggle.com/2012/10/15/make-for-data-scientists/) to [get started](https://web.archive.org/web/20150206054212/http://www.bioinformaticszen.com/post/decomplected-workflows-makefiles/). A number of data folks use `make` as their tool of choice, including [Mike Bostock](https://bost.ocks.org/mike/make/).
+
+There are other tools for managing DAGs that are written in Python instead of a DSL (e.g., [Paver](http://paver.github.io/paver/#), [Luigi](http://luigi.readthedocs.org/en/stable/index.html), [Airflow](http://pythonhosted.org/airflow/cli.html), [Snakemake](https://snakemake.readthedocs.io/en/stable/), [Ruffus](http://www.ruffus.org.uk/), or [Joblib](https://pythonhosted.org/joblib/memory.html)). Feel free to use these if they are more appropriate for your analysis.
+
+### Build from the environment up
+
+The first step in reproducing an analysis is always reproducing the computational environment it was run in. You need the same tools, the same libraries, and the same versions to make everything play nicely together.
+
+One effective approach to this is use [virtualenv](https://virtualenv.pypa.io/en/latest/) (we recommend [virtualenvwrapper](https://virtualenvwrapper.readthedocs.org/en/latest/) for managing virtualenvs). By listing all of your requirements in the repository (we include a `requirements.txt` file) you can easily track the packages needed to recreate the analysis. Here is a good workflow:
+
+ 1. Run `mkvirtualenv` when creating a new project
+ 2. `pip install` the packages that your analysis needs
+ 3. Run `pip freeze > requirements.txt` to pin the exact package versions used to recreate the analysis
+ 4. If you find you need to install another package, run `pip freeze > requirements.txt` again and commit the changes to version control.
+
+If you have more complex requirements for recreating your environment, consider a virtual machine based approach such as [Docker](https://www.docker.com/) or [Vagrant](https://www.vagrantup.com/). Both of these tools use text-based formats (Dockerfile and Vagrantfile respectively) you can easily add to source control to describe how to create a virtual machine with the requirements you need.
+
+### Keep secrets and configuration out of version control
+
+You _really_ don't want to leak your AWS secret key or Postgres username and password on Github. Enough said — see the [Twelve Factor App](http://12factor.net/config) principles on this point. Here's one way to do this:
+
+#### Store your secrets and config variables in a special file
+
+Create a `.env` file in the project root folder. Thanks to the `.gitignore`, this file should never get committed into the version control repository. Here's an example:
+
+```nohighlight
+# example .env file
+DATABASE_URL=postgres://username:password@localhost:5432/dbname
+AWS_ACCESS_KEY=myaccesskey
+AWS_SECRET_ACCESS_KEY=mysecretkey
+OTHER_VARIABLE=something
+```
+
+#### Use a package to load these variables automatically.
+
+If you look at the stub script in `src/data/make_dataset.py`, it uses a package called [python-dotenv](https://github.com/theskumar/python-dotenv) to load up all the entries in this file as environment variables so they are accessible with `os.environ.get`. Here's an example snippet adapted from the `python-dotenv` documentation:
+
+```python
+# src/data/dotenv_example.py
+import os
+from dotenv import load_dotenv, find_dotenv
+
+# find .env automagically by walking up directories until it's found
+dotenv_path = find_dotenv()
+
+# load up the entries as environment variables
+load_dotenv(dotenv_path)
+
+database_url = os.environ.get("DATABASE_URL")
+other_variable = os.environ.get("OTHER_VARIABLE")
+```
+
+#### AWS CLI configuration
+When using Amazon S3 to store data, a simple method of managing AWS access is to set your access keys to environment variables. However, managing mutiple sets of keys on a single machine (e.g. when working on multiple projects) it is best to use a [credentials file](https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html), typically located in `~/.aws/credentials`. A typical file might look like:
+```
+[default]
+aws_access_key_id=myaccesskey
+aws_secret_access_key=mysecretkey
+
+[another_project]
+aws_access_key_id=myprojectaccesskey
+aws_secret_access_key=myprojectsecretkey
+```
+You can add the profile name when initialising a project; assuming no applicable environment variables are set, the profile credentials will be used be default.
+
+### Be conservative in changing the default folder structure
+
+To keep this structure broadly applicable for many different kinds of projects, we think the best approach is to be liberal in changing the folders around for _your_ project, but be conservative in changing the default structure for _all_ projects.
+
+We've created a <span class="label label-info">folder-layout</span> label specifically for issues proposing to add, subtract, rename, or move folders around. More generally, we've also created a <span class="label label-warning">needs-discussion</span> label for issues that should have some careful discussion and broad support before being implemented.
+
+## Contributing
+
+The Cookiecutter Data Science project is opinionated, but not afraid to be wrong. Best practices change, tools evolve, and lessons are learned. **The goal of this project is to make it easier to start, structure, and share an analysis.** [Pull requests](https://github.com/drivendata/cookiecutter-data-science/pulls) and [filing issues](https://github.com/drivendata/cookiecutter-data-science/issues) is encouraged. We'd love to hear what works for you, and what doesn't.
+
+If you use the Cookiecutter Data Science project, link back to this page or [give us a holler](https://twitter.com/drivendataorg) and [let us know](mailto:info@drivendata.org)!
+
+## Links to related projects and references
+
+Project structure and reproducibility is talked about more in the R research community. Here are some projects and blog posts if you're working in R that may help you out.
+
+ - [Project Template](http://projecttemplate.net/index.html) - An R data analysis template
+ - "[Designing projects](http://nicercode.github.io/blog/2013-04-05-projects/)" on Nice R Code
+ - "[My research workflow](http://www.carlboettiger.info/2012/05/06/research-workflow.html)" on Carlboettiger.info
+ - "[A Quick Guide to Organizing Computational Biology Projects](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000424)" in PLOS Computational Biology
+
+Finally, a huge thanks to the [Cookiecutter](https://cookiecutter.readthedocs.org/en/latest/) project ([github](https://github.com/audreyr/cookiecutter)), which is helping us all spend less time thinking about and writing boilerplate and more time getting things done.

+ 11 - 0
docs/mkdocs.yml

@@ -0,0 +1,11 @@
+site_name: Cookiekaker
+site_description: A project template and directory structure for certain Python data science projects.
+site_favicon: favicon.ico
+repo_url: https://github.com/metya/Cookiekaker
+edit_uri: edit/master/docs/docs
+copyright: Project maintained by the friendly folks.
+theme: cinder
+extra_css:
+  - css/extra.css
+pages:
+  - Home: index.md

+ 4 - 0
requirements.txt

@@ -0,0 +1,4 @@
+mkdocs
+mkdocs-cinder
+cookiecutter
+pytest

+ 47 - 0
tests/conftest.py

@@ -0,0 +1,47 @@
+import sys
+import pytest
+import shutil
+from pathlib import Path
+from cookiecutter import main
+
+CCDS_ROOT = Path(__file__).parents[1].resolve()
+
+args = {
+        'project_name': 'keker',
+        'author_name': 'kaker',
+        'open_source_license': 'BSD-3-Clause',
+        'python_interpreter': 'python'
+        }
+
+
+def system_check(basename):
+    platform = sys.platform
+    if 'linux' in platform:
+        basename = basename.lower()
+    return basename
+
+
+@pytest.fixture(scope='class', params=[{}, args])
+def default_baked_project(tmpdir_factory, request):
+    temp = tmpdir_factory.mktemp('data-project')
+    out_dir = Path(temp).resolve()
+
+    pytest.param = request.param
+    main.cookiecutter(
+        str(CCDS_ROOT),
+        no_input=True,
+        extra_context=pytest.param,
+        output_dir=out_dir
+    )
+
+    pn = pytest.param.get('project_name') or 'project_name'
+    
+    # project name gets converted to lower case on Linux but not Mac
+    pn = system_check(pn)
+
+    proj = out_dir / pn
+    request.cls.path = proj
+    yield 
+
+    # cleanup after
+    shutil.rmtree(out_dir)

+ 113 - 0
tests/test_creation.py

@@ -0,0 +1,113 @@
+import os
+import pytest
+from subprocess import check_output
+from conftest import system_check
+
+
+def no_curlies(filepath):
+    """ Utility to make sure no curly braces appear in a file.
+        That is, was jinja able to render everthing?
+    """
+    with open(filepath, 'r') as f:
+        data = f.read()
+
+    template_strings = [
+        '{{',
+        '}}',
+        '{%',
+        '%}'
+    ]
+
+    template_strings_in_file = [s in data for s in template_strings]
+    return not any(template_strings_in_file)
+
+
+@pytest.mark.usefixtures("default_baked_project")
+class TestCookieSetup(object):
+    def test_project_name(self):
+        project = self.path
+        if pytest.param.get('project_name'):
+            name = system_check('DrivenData')
+            assert project.name == name
+        else:
+            assert project.name == 'project_name'
+
+    def test_author(self):
+        setup_ = self.path / 'setup.py'
+        args = ['python', setup_, '--author']
+        p = check_output(args).decode('ascii').strip()
+        if pytest.param.get('author_name'):
+            assert p == 'DrivenData'
+        else:
+            assert p == 'Your name (or your organization/company/team)'
+
+    def test_readme(self):
+        readme_path = self.path / 'README.md'
+        assert readme_path.exists()
+        assert no_curlies(readme_path)
+        if pytest.param.get('project_name'):
+            with open(readme_path) as fin:
+                assert 'DrivenData' == next(fin).strip()
+
+    def test_setup(self):
+        setup_ = self.path / 'setup.py'
+        args = ['python', setup_, '--version']
+        p = check_output(args).decode('ascii').strip()
+        assert p == '0.1.0'
+
+    def test_license(self):
+        license_path = self.path / 'LICENSE'
+        assert license_path.exists()
+        assert no_curlies(license_path)
+
+    def test_license_type(self):
+        setup_ = self.path / 'setup.py'
+        args = ['python', setup_, '--license']
+        p = check_output(args).decode('ascii').strip()
+        if pytest.param.get('open_source_license'):
+            assert p == 'BSD-3'
+        else:
+            assert p == 'MIT'
+
+    def test_requirements(self):
+        reqs_path = self.path / 'requirements.txt'
+        assert reqs_path.exists()
+        assert no_curlies(reqs_path)
+        if pytest.param.get('python_interpreter'):
+            with open(reqs_path) as fin:
+                lines = list(map(lambda x: x.strip(), fin.readlines()))
+            assert 'pathlib2' in lines
+
+    def test_makefile(self):
+        makefile_path = self.path / 'Makefile'
+        assert makefile_path.exists()
+        assert no_curlies(makefile_path)
+
+    def test_folders(self):
+        expected_dirs = [
+            'data',
+            'data/external',
+            'data/interim',
+            'data/processed',
+            'data/raw',
+            'docs',
+            'models',
+            'notebooks',
+            'references',
+            'reports',
+            'reports/figures',
+            'src',
+            'src/data',
+            'src/features',
+            'src/models',
+            'src/visualization',
+        ]
+
+        ignored_dirs = [
+            str(self.path)
+        ]
+
+        abs_expected_dirs = [str(self.path / d) for d in expected_dirs]
+        abs_dirs, _, _ = list(zip(*os.walk(self.path)))
+        assert len(set(abs_expected_dirs + ignored_dirs) - set(abs_dirs)) == 0
+

+ 86 - 0
{{ cookiecutter.repo_name }}/.gitignore

@@ -0,0 +1,86 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# DotEnv configuration
+.env
+
+# Database
+*.db
+*.rdb
+
+# Pycharm
+.idea
+
+# VS Code
+.vscode/
+
+# Spyder
+.spyproject/
+
+# Jupyter NB Checkpoints
+.ipynb_checkpoints/
+
+# Mac OS-specific storage files
+.DS_Store
+
+# vim
+*.swp
+*.swo
+
+# Mypy cache
+.mypy_cache/

+ 17 - 0
{{ cookiecutter.repo_name }}/.pre-commit-config.yaml

@@ -0,0 +1,17 @@
+repos:
+-   repo: git://github.com/pre-commit/pre-commit-hooks
+    rev: v1.4.0
+    hooks:
+    -   id: flake8
+        exclude: (^tests/.*\.py$|docs/conf.py|setup.py)
+        args:
+        - --ignore=W503
+    -   id: check-added-large-files
+-   repo: git://github.com/pre-commit/mirrors-pylint
+    rev: v2.3.0
+    hooks:
+    -   id: pylint
+        exclude: (^tests/.*\.py$|docs/conf.py|setup.py)
+        args:
+        - --errors-only
+        - --disable=import-error

+ 38 - 0
{{ cookiecutter.repo_name }}/LICENSE

@@ -0,0 +1,38 @@
+{% if cookiecutter.open_source_license == 'MIT' %}
+The MIT License (MIT)
+Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+{% elif cookiecutter.open_source_license == 'BSD-3-Clause' %}
+Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+  list of conditions and the following disclaimer in the documentation and/or
+  other materials provided with the distribution.
+
+* Neither the name of {{ cookiecutter.project_name }} nor the names of its
+  contributors may be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+{% endif %}

+ 170 - 0
{{ cookiecutter.repo_name }}/Makefile

@@ -0,0 +1,170 @@
+#################################################################################
+# GLOBALS                                                                       #
+#################################################################################
+
+PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+S3BUCKET = {{ cookiecutter.s3_bucket }}
+S3PROFILE = {{ cookiecutter.aws_profile }}
+MINIO = {{ cookiecutter.minio }}
+MINIOPROFILE = {{ cookiecutter.minio_profile }}
+PROJECT_NAME = {{ cookiecutter.repo_name }}
+PYTHON_INTERPRETER = {{ cookiecutter.python_interpreter }}
+# GIT = {{ cookiecutter.git_remote_repo }}
+USERNAME = {{ cookiecutter.author_name }}
+
+#################################################################################
+# COMMANDS                                                                      #
+#################################################################################
+
+## Install Python Dependencies
+requirements: test_environment
+	$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
+	$(PYTHON_INTERPRETER) -m pip install -r requirements.txt
+
+
+## Delete all compiled Python files
+clean:
+	find . -type f -name "*.py[co]" -delete
+	find . -type d -name "__pycache__" -delete
+
+## Lint using flake8
+lint:
+	flake8 src
+
+## Make Dataset
+data: requirements
+	$(PYTHON_INTERPRETER) src/data/make_dataset.py data/raw data/processed
+
+## Upload Data to S3
+sync_data_to_s3:
+ifeq (default,$(S3PROFILE))
+	aws s3 sync data/ s3://$(S3BUCKET)/data/
+else
+	aws s3 sync data/ s3://$(S3BUCKET)/data/ --profile $(S3PROFILE)
+endif
+
+## Download Data from S3
+sync_data_from_s3:
+ifeq (default,$(S3PROFILE))
+	aws s3 sync s3://$(S3BUCKET)/data/ data/
+else
+	aws s3 sync s3://$(S3BUCKET)/data/ data/ --profile $(S3PROFILE)
+endif
+
+## Upload to minio
+sync_data_to_minio:
+ifeq (default,$(MINIOPROFILE))
+	rclone --size-only sync data/ $(MINIO)/data/ --stats-one-line -P --stats 2s
+
+## Download from minio
+sync_data_to_minio:
+ifeq (default,$(MINIOPROFILE))
+	rclone --size-only sync $(MINIO)/data/ data/ --stats-one-line -P --stats 2s
+
+
+## Initial set up of python interpreter environment, version control and pre-commit hooks
+initial_setup:
+	@bash -c "virtualenv -p $(PYTHON_INTERPRETER) $(HOME)/envs/$(PROJECT_NAME)"
+	@bash -c "git init"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install dvc[all]; dvc init"
+	@bash -c "echo '[core]' >> $(PROJECT_DIR)/.dvc/config"
+	@bash -c "echo 'analytics = false' >> $(PROJECT_DIR)/.dvc/config"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install pre-commit; pre-commit install; pre-commit autoupdate"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install -r $(PROJECT_DIR)/requirements.txt"
+	@bash -c "echo 'CWD=$(PROJECT_DIR)' >> $(PROJECT_DIR)/.env"
+	@bash -c "git add . ; git commit -am 'INITIAL COMMIT'"
+	@bash -c "git remote add origin https://github.com/$(USERNAME)/$(PROJECT_NAME).git"
+# 	@bash -c "git remote add origin $(GIT)"	
+	@echo ">>> New virtualenv created. Activate with:\nsource $(HOME)/envs/$(PROJECT_NAME)/bin/activate"
+	@echo ">>> git and dvc are ready to go"
+
+## Following set up of python interpreter environment, version control and pre-commit hooks
+following_setup:
+	@bash -c "virtualenv -p $(PYTHON_INTERPRETER) $(HOME)/envs/$(PROJECT_NAME)"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install dvc[all]"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install pre-commit; pre-commit install"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install -r $(PROJECT_DIR)/requirements.txt"
+	@echo ">>> New virtualenv created. Activate with:\nsource $(HOME)/envs/$(PROJECT_NAME)/bin/activate"
+	@echo ">>> git and dvc are ready to go"
+
+requirements:
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; pip install -r $(PROJECT_DIR)/requirements.txt"
+
+environment:
+	@echo ">>> Activate with:\nsource $(HOME)/envs/$(PROJECT_NAME)/bin/activate"
+
+commit:
+	$(eval EXP_FILE := "$(PROJECT_DIR)/$(PROJECT_NAME)/study_name.txt")
+	$(eval EXP_NAME := $(shell cat ${EXP_FILE}))
+	@bash -c "git commit -am \"completed experiment $(EXP_NAME)\"; git tag -a $(EXP_NAME) -m \"$(EXP_NAME)\""
+
+push:
+	@bash -c "git push origin --follow-tags"
+	@bash -c "source $(HOME)/envs/$(PROJECT_NAME)/bin/activate; dvc push"
+
+#################################################################################
+# PROJECT RULES                                                                 #
+#################################################################################
+
+
+
+#################################################################################
+# Self Documenting Commands                                                     #
+#################################################################################
+
+.DEFAULT_GOAL := help
+
+# Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
+# sed script explained:
+# /^##/:
+# 	* save line in hold space
+# 	* purge line
+# 	* Loop:
+# 		* append newline + line to hold space
+# 		* go to next line
+# 		* if line starts with doc comment, strip comment character off and loop
+# 	* remove target prerequisites
+# 	* append hold space (+ newline) to line
+# 	* replace newline plus comments by `---`
+# 	* print line
+# Separate expressions are necessary because labels cannot be delimited by
+# semicolon; see <http://stackoverflow.com/a/11799865/1968>
+.PHONY: help
+help:
+	@echo "$$(tput bold)Available rules:$$(tput sgr0)"
+	@echo
+	@sed -n -e "/^## / { \
+		h; \
+		s/.*//; \
+		:doc" \
+		-e "H; \
+		n; \
+		s/^## //; \
+		t doc" \
+		-e "s/:.*//; \
+		G; \
+		s/\\n## /---/; \
+		s/\\n/ /g; \
+		p; \
+	}" ${MAKEFILE_LIST} \
+	| LC_ALL='C' sort --ignore-case \
+	| awk -F '---' \
+		-v ncol=$$(tput cols) \
+		-v indent=19 \
+		-v col_on="$$(tput setaf 6)" \
+		-v col_off="$$(tput sgr0)" \
+	'{ \
+		printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
+		n = split($$2, words, " "); \
+		line_length = ncol - indent; \
+		for (i = 1; i <= n; i++) { \
+			line_length -= length(words[i]) + 1; \
+			if (line_length <= 0) { \
+				line_length = ncol - indent - length(words[i]) - 1; \
+				printf "\n%*s ", -indent, " "; \
+			} \
+			printf "%s ", words[i]; \
+		} \
+		printf "\n"; \
+	}' \
+	| more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')

+ 54 - 0
{{ cookiecutter.repo_name }}/README.md

@@ -0,0 +1,54 @@
+{{cookiecutter.project_name}}
+==============================
+
+{{cookiecutter.description}}
+
+Project Organization
+
+```
+├── LICENSE
+├── Makefile           <- Makefile with commands like `make data` or `make train`
+├── README.md          <- The top-level README for developers using this project.
+├── data
+│   ├── external       <- Data from third party sources.
+│   ├── interim        <- Intermediate data that has been transformed.
+│   ├── processed      <- The final, canonical data sets for modeling.
+│   ├── features       <- Features may be stored here
+│   ├── inference      <- Inference stages may be stored here
+│   └── raw            <- The original, immutable data dump.
+│
+├── docs               <- A default Sphinx project; see sphinx-doc.org for details
+│
+├── models             <- Trained and serialized models, model predictions, or model summaries
+│
+├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
+│                         the creator's initials, and a short `-` delimited description, e.g.
+│                         `1.0-jqp-initial-data-exploration`.
+│
+├── references         <- Data dictionaries, manuals, and all other explanatory materials.
+│
+├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
+│   └── figures        <- Generated graphics and figures to be used in reporting
+│
+├── .pre-commit-config.yaml <- Stores pre-commit settings
+│
+├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
+│                         generated with `pip freeze > requirements.txt`
+│
+├── __init__.py
+│
+└── {{cookiecutter.repo_name}}   <- Source code for use in this project.
+    ├── __init__.py    <- Makes {{cookiecutter.repo_name}} a Python module
+    │    
+    ├── settings.py <- illustrates how to use .env file
+    │
+    ├── data           <- Scripts to download or generate data
+    │   └── make_dataset.py
+    │
+    ├── features       <- Scripts to turn raw data into features for modeling
+    │   └── featurize.py
+    │
+    └── models         <- Scripts to train models and then use trained models to make
+        │                 predictions
+        └── train.py
+```

+ 0 - 0
{{ cookiecutter.repo_name }}/__init__.py


+ 0 - 0
{{ cookiecutter.repo_name }}/app/__init__.py


+ 0 - 0
{{ cookiecutter.repo_name }}/app/api.py


+ 0 - 0
{{ cookiecutter.repo_name }}/app/app.py


+ 0 - 0
{{ cookiecutter.repo_name }}/app/main.py


+ 0 - 0
{{ cookiecutter.repo_name }}/data/external/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/data/interim/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/data/processed/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/data/raw/.gitkeep


+ 153 - 0
{{ cookiecutter.repo_name }}/docs/Makefile

@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.repo_name }}.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.repo_name }}.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.repo_name }}"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.repo_name }}"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."

+ 4 - 0
{{ cookiecutter.repo_name }}/docs/commands.rst

@@ -0,0 +1,4 @@
+Commands
+========
+
+The Makefile contains the central entry points for common tasks related to this project.

+ 244 - 0
{{ cookiecutter.repo_name }}/docs/conf.py

@@ -0,0 +1,244 @@
+# -*- coding: utf-8 -*-
+#
+# {{ cookiecutter.project_name }} documentation build configuration file, created by
+# sphinx-quickstart.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import os
+import sys
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+# sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+# source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'{{ cookiecutter.project_name }}'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.1'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+# language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+# today = ''
+# Else, today_fmt is used as the format for a strftime call.
+# today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+# default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+# add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+# add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+# show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+# modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+# html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+# html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+# html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+# html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+# html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+# html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+# html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+# html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+# html_additional_pages = {}
+
+# If false, no module index is generated.
+# html_domain_indices = True
+
+# If false, no index is generated.
+# html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+# html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+# html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+# html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+# html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+# html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+# html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = '{{ cookiecutter.repo_name }}doc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+    # The paper size ('letterpaper' or 'a4paper').
+    # 'papersize': 'letterpaper',
+
+    # The font size ('10pt', '11pt' or '12pt').
+    # 'pointsize': '10pt',
+
+    # Additional stuff for the LaTeX preamble.
+    # 'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+    ('index',
+     '{{ cookiecutter.repo_name }}.tex',
+     u'{{ cookiecutter.project_name }} Documentation',
+     u"{{ cookiecutter.author_name }}", 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+# latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+# latex_appendices = []
+
+# If false, no module index is generated.
+# latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.project_name }} Documentation',
+     [u"{{ cookiecutter.author_name }}"], 1)
+]
+
+# If true, show URL addresses after external links.
+# man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+    ('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.project_name }} Documentation',
+     u"{{ cookiecutter.author_name }}", '{{ cookiecutter.project_name }}',
+     '{{ cookiecutter.description }}', 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+# texinfo_appendices = []
+
+# If false, no module index is generated.
+# texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+# texinfo_show_urls = 'footnote'

+ 14 - 0
{{ cookiecutter.repo_name }}/docs/getting-started.rst

@@ -0,0 +1,14 @@
+Getting started
+===============
+
+This is where you describe how to get set up on a clean install
+
+
+
+Syncing data to S3
+^^^^^^^^^^^^^^^^^^
+
+* `make sync_data_to_s3` will use `aws s3 sync` to recursively sync files in `data/` up to `s3://{{ cookiecutter.s3_bucket }}/data/`.
+* `make sync_data_from_s3` will use `aws s3 sync` to recursively sync files from `s3://{{ cookiecutter.s3_bucket }}/data/` to `data/`.
+* `make sync_data_to_minio` will use `rclone --size-only sync {{ cookiecutter.minio }}/data/ data/ --stats-one-line -P --stats 2s`
+

+ 24 - 0
{{ cookiecutter.repo_name }}/docs/index.rst

@@ -0,0 +1,24 @@
+.. {{ cookiecutter.project_name }} documentation master file, created by
+   sphinx-quickstart.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+{{ cookiecutter.project_name }} documentation!
+==============================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+
+   getting-started
+   commands
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`

+ 190 - 0
{{ cookiecutter.repo_name }}/docs/make.bat

@@ -0,0 +1,190 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+	set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+set I18NSPHINXOPTS=%SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html       to make standalone HTML files
+	echo.  dirhtml    to make HTML files named index.html in directories
+	echo.  singlehtml to make a single large HTML file
+	echo.  pickle     to make pickle files
+	echo.  json       to make JSON files
+	echo.  htmlhelp   to make HTML files and a HTML help project
+	echo.  qthelp     to make HTML files and a qthelp project
+	echo.  devhelp    to make HTML files and a Devhelp project
+	echo.  epub       to make an epub
+	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  text       to make text files
+	echo.  man        to make manual pages
+	echo.  texinfo    to make Texinfo files
+	echo.  gettext    to make PO message catalogs
+	echo.  changes    to make an overview over all changed/added/deprecated items
+	echo.  linkcheck  to check all external links for integrity
+	echo.  doctest    to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "singlehtml" (
+	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.repo_name }}.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.repo_name }}.ghc
+	goto end
+)
+
+if "%1" == "devhelp" (
+	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished.
+	goto end
+)
+
+if "%1" == "epub" (
+	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The epub file is in %BUILDDIR%/epub.
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "text" (
+	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The text files are in %BUILDDIR%/text.
+	goto end
+)
+
+if "%1" == "man" (
+	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The manual pages are in %BUILDDIR%/man.
+	goto end
+)
+
+if "%1" == "texinfo" (
+	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+	goto end
+)
+
+if "%1" == "gettext" (
+	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
+)
+
+if "%1" == "linkcheck" (
+	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+	goto end
+)
+
+if "%1" == "doctest" (
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+	goto end
+)
+
+:end

+ 0 - 0
{{ cookiecutter.repo_name }}/logs/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/models/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/__init__.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/models/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/models/__init__.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/models/models.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/models/predict.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/models/train.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/pipelines/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/settings.py


+ 5 - 0
{{ cookiecutter.repo_name }}/nets/utils/__init__.py

@@ -0,0 +1,5 @@
+from .utils import set_random_seed, check_args_num, file_hash, str_hash, \
+    read_config
+
+__all__ = ['set_random_seed', 'check_args_num', 'file_hash', 'str_hash',
+           'read_config']

+ 0 - 0
{{ cookiecutter.repo_name }}/nets/utils/featurize.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/utils/make_dataset.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/utils/utils.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/visualization/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/visualization/__init__.py


+ 0 - 0
{{ cookiecutter.repo_name }}/nets/visualization/visualization.py


+ 0 - 0
{{ cookiecutter.repo_name }}/notebooks/.gitkeep


+ 1 - 0
{{ cookiecutter.repo_name }}/notebooks/1.0-{{cookiecutter.author_name}}-eda.ipynb

@@ -0,0 +1 @@
+{"cells":[{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":"import os\nimport subprocess\nfrom {{cookiecutter.repo_name}}.settings import cwd"},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":"PROJECT_NAME = os.path.basename(cwd)"}],"nbformat":4,"nbformat_minor":2,"metadata":{"language_info":{"name":"python","codemirror_mode":{"name":"ipython","version":3}},"orig_nbformat":2,"file_extension":".py","mimetype":"text/x-python","name":"python","npconvert_exporter":"python","pygments_lexer":"ipython3","version":3}}

+ 0 - 0
{{ cookiecutter.repo_name }}/references/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/reports/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/reports/figures/.gitkeep


+ 0 - 0
{{ cookiecutter.repo_name }}/reports/images/.gitkeep


+ 10 - 0
{{ cookiecutter.repo_name }}/requirements.txt

@@ -0,0 +1,10 @@
+# local package
+-e .
+
+# external requirements
+click
+Sphinx
+coverage
+awscli
+flake8
+python-dotenv>=0.5.1

+ 10 - 0
{{ cookiecutter.repo_name }}/setup.py

@@ -0,0 +1,10 @@
+from setuptools import find_packages, setup
+
+setup(
+    name='{{ cookiecutter.repo_name }}',
+    packages=find_packages(),
+    version='0.1.0',
+    description='{{ cookiecutter.description }}',
+    author='{{ cookiecutter.author_name }}',
+    license='{% if cookiecutter.open_source_license == 'MIT' %}MIT{% elif cookiecutter.open_source_license == 'BSD-3-Clause' %}BSD-3{% endif %}',
+)

+ 25 - 0
{{ cookiecutter.repo_name }}/test_environment.py

@@ -0,0 +1,25 @@
+import sys
+
+REQUIRED_PYTHON = "{{ cookiecutter.python_interpreter }}"
+
+
+def main():
+    system_major = sys.version_info.major
+    if REQUIRED_PYTHON == "python":
+        required_major = 2
+    elif REQUIRED_PYTHON == "python3":
+        required_major = 3
+    else:
+        raise ValueError("Unrecognized python interpreter: {}".format(
+            REQUIRED_PYTHON))
+
+    if system_major != required_major:
+        raise TypeError(
+            "This project requires Python {}. Found: Python {}".format(
+                required_major, sys.version))
+    else:
+        print(">>> Development environment passes all tests!")
+
+
+if __name__ == '__main__':
+    main()

+ 3 - 0
{{ cookiecutter.repo_name }}/tox.ini

@@ -0,0 +1,3 @@
+[flake8]
+max-line-length = 79
+max-complexity = 10