From b6d02801363eaeeeddac826ee707174d9f0d74cd Mon Sep 17 00:00:00 2001 From: wassname Date: Wed, 3 Mar 2021 09:26:18 +0800 Subject: [PATCH] reduce dirs, aws policy, conda --- {{ cookiecutter.repo_name }}/LICENSE | 38 ------------------- {{ cookiecutter.repo_name }}/README.md | 38 +++++++++++++------ .../data/external/.gitkeep | 0 .../references/.gitkeep | 0 {{ cookiecutter.repo_name }}/reports/.gitkeep | 0 .../reports/figures/.gitkeep | 0 .../test_environment.py | 25 ------------ {{ cookiecutter.repo_name }}/tox.ini | 3 -- 8 files changed, 27 insertions(+), 77 deletions(-) delete mode 100644 {{ cookiecutter.repo_name }}/LICENSE delete mode 100644 {{ cookiecutter.repo_name }}/data/external/.gitkeep delete mode 100644 {{ cookiecutter.repo_name }}/references/.gitkeep delete mode 100644 {{ cookiecutter.repo_name }}/reports/.gitkeep delete mode 100644 {{ cookiecutter.repo_name }}/reports/figures/.gitkeep delete mode 100644 {{ cookiecutter.repo_name }}/test_environment.py delete mode 100644 {{ cookiecutter.repo_name }}/tox.ini diff --git a/{{ cookiecutter.repo_name }}/LICENSE b/{{ cookiecutter.repo_name }}/LICENSE deleted file mode 100644 index a811c7b..0000000 --- a/{{ cookiecutter.repo_name }}/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -{% 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 %} diff --git a/{{ cookiecutter.repo_name }}/README.md b/{{ cookiecutter.repo_name }}/README.md index fbe1848..9e40f07 100644 --- a/{{ cookiecutter.repo_name }}/README.md +++ b/{{ cookiecutter.repo_name }}/README.md @@ -6,11 +6,9 @@ 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. │   └── raw <- The original, immutable data dump. @@ -23,13 +21,9 @@ Project Organization │ 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 <- The requirements file for reproducing the analysis environment, e.g. - │ generated with `conda env export > requirements/environment.yaml` + ├── requirements <- The requirements files for reproducing the analysis environment, e.g. + │ generated with `make doc_reqs` │ ├── setup.py <- makes project pip installable (pip install -e .) so src can be imported ├── src <- Source code for use in this project. @@ -47,9 +41,7 @@ Project Organization │   │   └── 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.readthedocs.io +    └── visualize.py # Install requirements @@ -62,6 +54,30 @@ python -m pip install -e . python -m ipykernel install --user --name {{ cookiecutter.repo_name }} --display-name {{ cookiecutter.repo_name }} ``` +# AWS Policy for data sync + +See [this link](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_s3_rw-bucket.html) + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "ListObjectsInBucket", + "Effect": "Allow", + "Action": ["s3:ListBucket"], + "Resource": ["arn:aws:s3:::{{ cookiecutter.s3_bucket }}"] + }, + { + "Sid": "AllObjectActions", + "Effect": "Allow", + "Action": "s3:*Object", + "Resource": ["arn:aws:s3:::{{ cookiecutter.s3_bucket }}/*"] + } + ] +} +``` + --------

Project based on the cookiecutter data science project template. #cookiecutterdatascience

diff --git a/{{ cookiecutter.repo_name }}/data/external/.gitkeep b/{{ cookiecutter.repo_name }}/data/external/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/{{ cookiecutter.repo_name }}/references/.gitkeep b/{{ cookiecutter.repo_name }}/references/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/{{ cookiecutter.repo_name }}/reports/.gitkeep b/{{ cookiecutter.repo_name }}/reports/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/{{ cookiecutter.repo_name }}/reports/figures/.gitkeep b/{{ cookiecutter.repo_name }}/reports/figures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/{{ cookiecutter.repo_name }}/test_environment.py b/{{ cookiecutter.repo_name }}/test_environment.py deleted file mode 100644 index 0b0abea..0000000 --- a/{{ cookiecutter.repo_name }}/test_environment.py +++ /dev/null @@ -1,25 +0,0 @@ -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() diff --git a/{{ cookiecutter.repo_name }}/tox.ini b/{{ cookiecutter.repo_name }}/tox.ini deleted file mode 100644 index c32fbd8..0000000 --- a/{{ cookiecutter.repo_name }}/tox.ini +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -max-line-length = 79 -max-complexity = 10