Coder Social home page Coder Social logo

modern-data-cookiecutter's Introduction

Modern Data Cookiecutter

Status Python Version Tests pre-commit enabled Black codestyle

Modern Cookiecutter template for Python-based data science/engineering/analytics projects. Created by Coefficient.

Inspired by:

Usage

# Install cookiecutter (if you haven't already done so)
pipx install cookiecutter

# Install the latest release directly from this repo
cookiecutter https://github.com/CoefficientSystems/modern-data-cookiecutter

# Follow instructions in docs/getting_started.md or docs/quickstart.md

Features

๐Ÿ“ฆ Managing Python & Package Dependencies

๐Ÿ‘ท Code Quality, Testing & CI

๐Ÿค– Data Science

๐Ÿ”’ Security Features

๐Ÿ“š Documentation, IDE Settings & Release Notes

  • Get started easily using Getting Started or the Quickstart with further documentation on how to use the packages in this cookiecutter available in docs/
  • VS Code Settings configures features like "Format on save", isort configuration, bracket pair colorization, Pylance and mypy alongside recommended extensions
  • Automated release notes using towncrier

Contributing

Please see CONTRIBUTING.md for guidance on how to request features, report issues, setup a development environment, test this cookiecutter and contribute to development.

modern-data-cookiecutter's People

Contributors

dependabot[bot] avatar graingert-coef avatar hicksl avatar jcoombes avatar john-sandall avatar lukecoeff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

modern-data-cookiecutter's Issues

Fix Poetry Plugins Deprecation Warning.

Warning: poetry-plugin-export will not be installed by default in a future version of Poetry.
In order to avoid a breaking change and make your automation forward-compatible, please install poetry-plugin-export explicitly. See https://python-poetry.org/docs/plugins/#using-plugins for details on how to install a plugin.
To disable this warning run 'poetry config warnings.export false'.

install poetry-up plugin and poetry-plugin-export via pipx inject?

Replace flake8 with ruff

Release 0.1

Issues

  • #1
  • #5
  • tutorial1 ("Getting to know")
  • tutorial2 ("Create from scratch")
  • "Project templates made easy"
  • #6
  • #8
  • #10
  • #12
  • Add ccds inspired data directory layout
  • #14

Better gitignores

# Data
data/**/*.*
!**/data/**/README.md
!**/data/**/*.gitkeep
!**/data/**/file.csv

pre-commit autoupdate

Run pre-commit autoupdate in outer repo, manually copy the version changes into the inner precommit

Remove deprecated python.sortImports.args from settings.json

This can be removed from settings.json (double check using latest isort):

"python.sortImports.args": ["--recursive"],

because

[ERROR 2022-5-29 22:19:11.680]: /Users/john/.vscode/extensions/ms-python.python-2022.8.1/pythonFiles/lib/python/isort/main.py:1261: UserWarning: W0501: The following deprecated CLI flags were used and ignored: --recursive!
  warn(
/Users/john/.vscode/extensions/ms-python.python-2022.8.1/pythonFiles/lib/python/isort/main.py:1265: UserWarning: W0500: Please see the 5.0.0 Upgrade guide: https://pycqa.github.io/isort/docs/upgrade_guides/5.0.0.html

Add instructions for installing on Linux

For Vertex Workbench (Debian):

# Install deps
# from https://bgasparotto.com/install-pyenv-ubuntu-debian
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev

# Auto-installer
curl https://pyenv.run | bash

.bashrc not working on workbench? Added to .bash_profile:

conda deactivate

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

# Restart your shell for the changes to take effect.

# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"

# Add this for Poetry
export PATH=$HOME/.local/bin:$PATH

Installed pyenv-virtualenvwrapper plugin using git clone: https://github.com/pyenv/pyenv-virtualenvwrapper

pre-commit updates

# Update all versions in this file by running:
#   $ pre-commit autoupdate

Update all packages

Fix poetryup

poetryup is failing on install with the following message:

CalledProcessError

  Command '['git', '--git-dir', '/var/folders/98/2gsv1cnj48n3k_s4zfh6mxqc0000gn/T/pypoetry-git-poetryup37axluxm/.git', '--work-tree', '/var/folders/98/2gsv1cnj48n3k_s4zfh6mxqc0000gn/T/pypoetry-git-poetryup37axluxm', 'checkout', 'fdfaf4d446249f8f69db613bac285e818a7df92f']' returned non-zero exit status 128.

  at ~/.poetry/lib/poetry/utils/_compat.py:217 in run
      213โ”‚                 process.wait()
      214โ”‚                 raise
      215โ”‚             retcode = process.poll()
      216โ”‚             if check and retcode:
    โ†’ 217โ”‚                 raise CalledProcessError(
      218โ”‚                     retcode, process.args, output=stdout, stderr=stderr
      219โ”‚                 )
      220โ”‚         finally:
      221โ”‚             # None because our context manager __exit__ does not use them.

It looks like this is coming from this part of the outer pyproject.toml

poetryup = { git = "https://github.com/john-sandall/poetryup.git", rev = "fdfaf4d446249f8f69db613bac285e818a7df92f" } # pragma: allowlist secret

Poetry TOML Confiiguration Files Location Deprecation

Change the getting_started and quickstart docs to fix these issues in pre-commit.

poetry-export...................................................................Failed
- hook id: poetry-export
- files were modified by this hook

Configuration file exists at /Users/jamie/Library/Preferences/pypoetry, reusing this directory.

Consider moving TOML configuration files to /Users/jamie/Library/Application Support/pypoetry, as support for the legacy directory will be removed in an upcoming release.

What breaks if I just move these files? Are there environment variables or other installs that break somewhere if I do this?

Base package doesn't pass pre-commit

pylint..........................................................................Failed
- hook id: pylint
- exit code: 16

************* Module tests.test_gershwin
tests/test_gershwin.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_gershwin.py:6:0: C0116: Missing function or method docstring (missing-function-docstring)

------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: 6.67/10, +0.00)

Todo

  • Add module docstring to tests

Tutorial

Please can you create a beginner friendly tutorial for this? I know there's docs/quickstart.md but this feels written for people who know what they're doing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.