Skip to content

andela-technology/datascience-code-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

datascience-python-template

This repository is a cookiecutter templates for quick python project scaffolding.

Requirements

Install cookiecutter with either of the following

  • pip: pip install cookiecutter
  • homebrew: brew install cookiecutter

Features

This package template is set up to allow scientists/developers to be immediately productive writing python. Here are some of the features the package format setups up automatically.

  • Automatically sets the python package version from the git tag. If a git tag is not preset then the latest git commit hash is used.
  • Linting/formatting are automatically setup using tox.
  • ✅ Isolated builds with tox.
  • ✅ Example unit tests.
  • ✅ Example command line entry point.
  • pre-commit git hooks.

Usage

You can read the templates directly from git without downloading them you do need to provide the --directory argument to select the template. An example below,

cookiecutter git+ssh://git@github.com/andela-technology/datascience-code-template --directory basic-template

Example

Here we show the steps need to create an example package called cat-tracker.

# generate your package from the template
cookiecutter git+ssh://git@github.com/andela-technology/ds-code-template --directory basic-template

# Answer questions:
    package_name: cat-tracker
    module_name: cat_tracker

# new directory will have generated code
cd cat_tracker

# Initialize the git repo, add files and commit
#❗ NOTE: You must do this step or the generated package won't build.
git init . && git add -A && git commit -am "Initial Commit"

# If you do not have poetry on your computer, run (MacOS) 
brew install poetry
# after you make a virtualenv install and build the package
poetry install

# run linting/formatting/tests
tox

# If everything succeed then you are good to go! Push your code to github.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors