├── .gitattributes ├── {{ cookiecutter.repo_name }} ├── data │ └── .gitkeep ├── tests │ └── .gitkeep ├── figures │ └── .gitkeep ├── notebooks │ └── .gitkeep ├── {{ cookiecutter.python_module_name }} │ └── __init__.py ├── tox.ini ├── environment.yml ├── setup.py ├── .gitignore ├── README.md ├── LICENSE └── Makefile ├── requirements.txt ├── .gitignore ├── cookiecutter.json ├── README.md ├── LICENSE └── tests └── test_creation.py /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/tests/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | cookiecutter 2 | pytest 3 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/figures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/notebooks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | docs/site/ 2 | 3 | # OSX Junk 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/{{ cookiecutter.python_module_name }}/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/tox.ini: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 79 3 | max-complexity = 10 4 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/environment.yml: -------------------------------------------------------------------------------- 1 | name: {{ cookiecutter.conda_environment }} 2 | dependencies: 3 | - python={{cookiecutter.python_version}} -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_name": "project_name", 3 | "repo_name": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}", 4 | "python_module_name": "{{ cookiecutter.repo_name }}", 5 | "author_name": "Your name (or your organization/company/team)", 6 | "description": "A short description of the project.", 7 | "open_source_license": [ "MIT", "BSD", "Not open source" ], 8 | "conda_environment": "{{ cookiecutter.repo_name }}", 9 | "python_version": "Python interpreter (e.g. 3, 3.5, 2.7)" 10 | } 11 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from setuptools import setup, find_packages 3 | 4 | 5 | def read(fname): 6 | return open(os.path.join(os.path.dirname(__file__), fname)).read() 7 | 8 | 9 | setup( 10 | name="{{ cookiecutter.python_module_name }}", 11 | 12 | description="{{ cookiecutter.description }}", 13 | 14 | author="{{ cookiecutter.author_name }}", 15 | 16 | packages=find_packages(exclude=['data', 'figures', 'output', 'notebooks']), 17 | 18 | long_description=read('README.md'), 19 | ) 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cookiecutter Data Science for Python 2 | 3 | A minimal _Python_ project structure for doing and sharing data science work. 4 | 5 | This cookiecutter is based on [Cookiecutter Data Science](http://drivendata.github.io/cookiecutter-data-science/). 6 | 7 | 8 | ### Requirements to use the cookiecutter template: 9 | ----------- 10 | - Python 2.7 or 3.5 11 | - [Cookiecutter Python package](http://cookiecutter.readthedocs.org/en/latest/installation.html) >= 1.4.0: This can be installed with pip by or conda depending on how you manage your Python packages: 12 | 13 | ``` bash 14 | $ pip install cookiecutter 15 | ``` 16 | 17 | or 18 | 19 | ``` bash 20 | $ conda config --add channels conda-forge 21 | $ conda install cookiecutter 22 | ``` 23 | 24 | 25 | ### To start a new project, run: 26 | ------------ 27 | 28 | ```bash 29 | $ cookiecutter https://github.com/hgrif/cookiecutter-ds-python 30 | ``` 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 DrivenData, Inc. 3 | 4 | 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: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | 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. 9 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *,cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # dotenv 80 | .env 81 | 82 | # virtualenv 83 | .venv 84 | venv/ 85 | ENV/ 86 | 87 | # Spyder project settings 88 | .spyderproject 89 | 90 | # Rope project settings 91 | .ropeproject 92 | 93 | # Pycharm 94 | .idea 95 | 96 | # Cookiecutter folders 97 | /data/ 98 | /figures/ 99 | /output/ 100 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/README.md: -------------------------------------------------------------------------------- 1 | {{cookiecutter.project_name}} 2 | ============================== 3 | 4 | {{cookiecutter.description}} 5 | 6 | Project Organization 7 | ------------ 8 | 9 | │ 10 | ├── data/ <- The original, immutable data dump. 11 | │ 12 | ├── figures/ <- Figures saved by scripts or notebooks. 13 | │ 14 | ├── notebooks/ <- Jupyter notebooks. Naming convention is a short `-` delimited 15 | │ description, a number (for ordering), and the creator's initials, 16 | │ e.g. `initial-data-exploration-01-hg`. 17 | │ 18 | ├── output/ <- Manipulated data, logs, etc. 19 | │ 20 | ├── tests/ <- Unit tests. 21 | │ 22 | ├── {{ cookiecutter.python_module_name }}/ <- Python module with source code of this project. 23 | │ 24 | ├── environment.yml <- conda virtual environment definition file. 25 | │ 26 | ├── LICENSE 27 | │ 28 | ├── Makefile <- Makefile with commands like `make environment` 29 | │ 30 | ├── README.md <- The top-level README for developers using this project. 31 | │ 32 | └── tox.ini <- tox file with settings for running tox; see tox.testrun.org 33 | 34 | 35 | -------- 36 | 37 |
Project based on the cookiecutter data science project template.
38 | 39 | 40 | Set up 41 | ------------ 42 | 43 | Install the virtual environment with conda and activate it: 44 | 45 | ```bash 46 | $ conda env create -f environment.yml 47 | $ conda activate example-project 48 | ``` 49 | 50 | Install `{{ cookiecutter.python_module_name }}` in the virtual environment: 51 | 52 | ```bash 53 | $ pip install --editable . 54 | ``` 55 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/LICENSE: -------------------------------------------------------------------------------- 1 | {% if cookiecutter.open_source_license == 'MIT' %} 2 | The MIT License (MIT) 3 | Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | {% elif cookiecutter.open_source_license == 'BSD' %} 11 | Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without modification, 15 | are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright notice, this 18 | list of conditions and the following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above copyright notice, this 21 | list of conditions and the following disclaimer in the documentation and/or 22 | other materials provided with the distribution. 23 | 24 | * Neither the name of {{ cookiecutter.project_name }} nor the names of its 25 | contributors may be used to endorse or promote products derived from this 26 | software without specific prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 29 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 31 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 32 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 35 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 36 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | {% endif %} 39 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: create_environment git 2 | 3 | ################################################################################# 4 | # GLOBALS # 5 | ################################################################################# 6 | 7 | PROJECT_NAME = {{ cookiecutter.repo_name }} 8 | CONDA_ENVIRONMENT = {{ cookiecutter.conda_environment }} 9 | PYTHON_VERSION = {{ cookiecutter.python_version }} 10 | 11 | ################################################################################# 12 | # COMMANDS # 13 | ################################################################################# 14 | 15 | ## Set up python interpreter environment 16 | environment: 17 | conda env create -f environment.yml 18 | 19 | git: 20 | git init 21 | 22 | 23 | ################################################################################# 24 | # Self Documenting Commands # 25 | ################################################################################# 26 | 27 | .DEFAULT_GOAL := show-help 28 | 29 | # Inspired by