Skip to content

martelogan-code-templates/my-python-boilerplate

Repository files navigation

My-Python-Boilerplate

Build Status

Description

This repo, constructed from Kenneth Reitz's sample python boilerplate, serves as a template for python projects developed by Logan Martel (github username: martelogan).

Creating a Project from this Skeleton

The following table illustrates steps required to setup a basic python project from this skeleton:

Status of Skeleton Tasks

  • Clone this template project
  • Find & Replace all instances of My-Python-Boilerplate (case-sensitive) with your project name
  • Find & Replace all instances of my-python-boilerplate (case-sensitive) with your project name
  • Find & Replace all instances of my_python_boilerplate (case-sensitive) with your project name
  • Modify this README (and subdirectory READMEs) with general project documentation
  • Modify project contributors as necessary under: AUTHORS, setup.py, docs/conf.py, and all README citations
  • Leverage existing directories as desired (e.g. data under data/, config under config/, etc.)
  • Delete the cloned .git subdirectory, run git init, and establish the new remote project repository
  • Replace this README section with a project status checklist

Installation

  1. Make sure you have all the dependencies needed to build this project. In particular, immediately after git clone, you should be able to successfully build the project from a command-line environment under Python 2.7 via the command:
   python setup.py develop
  1. The recommended IDE for developer consistency is PyCharm. Leveraging PyCharm, it would be ideal for project contributors to ensure that code conforms to PEP 8 standards.

(RECOMMENDATION: Ideally, it is advised to manage Python virtual environments via conda in order to safely segregate module dependencies. In this case, it is recommended to locallize pip installations during conda environment creation, to avoid dependency conflicts, by instantiating the environment with its own pip setup, à la conda create --name custom_venv_name pip. Alternatively, a basic conda venv, equipped with its own localized pip, can be configured from this project directory simply by running conda env create -f environment.yml and then activating the environment (linux example: source activate my-python-boilerplate)).

Development

Our development workflow will be simple:

Always develop on your own branch. Only merge code to Master via PR's. Only merge code that has no conflicts with master. Only merge code that builds successfully via python setup.py develop.

Execution

The first thing we do is import the module and get an ExampleClass object.

   >>> from my-python-boilerplate import ExampleClass as Ex
   >>> example = Ex("hello")
   >>> ...

License

This code is under the GNU General Public License v3.0.

If you use or modify my-python-boilerplate, please credit the original author as