All Projects → tony → cookiecutter-pypackage-pythonic

tony / cookiecutter-pypackage-pythonic

Licence: other
Pythonic cookiecutter template for a Python package. See https://github.com/audreyr/cookiecutter.

Projects that are alternatives of or similar to cookiecutter-pypackage-pythonic

cookiecutter-modern-pypackage
Cookiecutter template for a modern Python package.
Stars: ✭ 97 (+234.48%)
Mutual labels:  cookiecutter, pypackage
pypackage
Cookiecutter python package using Poetry, mypy, black, isort, autoflake, pytest, mkdocs, and GitHub Actions
Stars: ✭ 12 (-58.62%)
Mutual labels:  cookiecutter
cookiecutter-modern-datascience
Start a data science project with modern tools
Stars: ✭ 136 (+368.97%)
Mutual labels:  cookiecutter
pyGinit
A simple github automation cli
Stars: ✭ 15 (-48.28%)
Mutual labels:  python-package
minimal-flask-react
🍸 A minimal modern setup for flask and react
Stars: ✭ 120 (+313.79%)
Mutual labels:  cookiecutter
coba
Contextual bandit benchmarking
Stars: ✭ 29 (+0%)
Mutual labels:  python-package
cookiecutter-go
boilerplate, golang project starter tool, support go-zero/go-micro/gin
Stars: ✭ 63 (+117.24%)
Mutual labels:  cookiecutter
talkshow
A Call 4 Papers System - A simple base app as example of Flask Architecture
Stars: ✭ 56 (+93.1%)
Mutual labels:  cookiecutter
cookiecutter-reveal.js
📊 A cookiecutter template for reveal.js presentations.
Stars: ✭ 15 (-48.28%)
Mutual labels:  cookiecutter
partial dependence
Python package to visualize and cluster partial dependence.
Stars: ✭ 23 (-20.69%)
Mutual labels:  python-package
multi-imbalance
Python package for tackling multi-class imbalance problems. http://www.cs.put.poznan.pl/mlango/publications/multiimbalance/
Stars: ✭ 66 (+127.59%)
Mutual labels:  python-package
cookiecutter-pyms
Cookiecutter template for a Python microservice.
Stars: ✭ 49 (+68.97%)
Mutual labels:  cookiecutter
qt-qml-project-template-with-ci
Template for a Qt/QML application with batteries included: GitHub C.I. for your QML app; automated gui testing with Xvfb; automatic code-format checks and more. Compiles for Desktop and Mobile (Linux, Mac, Windows, and Android).
Stars: ✭ 33 (+13.79%)
Mutual labels:  cookiecutter
teanaps
자연어 처리와 텍스트 분석을 위한 오픈소스 파이썬 라이브러리 입니다.
Stars: ✭ 91 (+213.79%)
Mutual labels:  python-package
python-package-template
Easy to use template for great PyPi packages
Stars: ✭ 19 (-34.48%)
Mutual labels:  python-package
silverstripe-cookie-consent
GDPR compliant cookie popup and consent checker
Stars: ✭ 16 (-44.83%)
Mutual labels:  cookiecutter
django-quick-start
Deploy a Django app on Render
Stars: ✭ 17 (-41.38%)
Mutual labels:  cookiecutter
cookiecutter-qt-app
A cookiecutter to create Qt applications, with translations and packaging
Stars: ✭ 29 (+0%)
Mutual labels:  cookiecutter
aws-lambda-decorators
A set of Python decorators to simplify AWS lambda development
Stars: ✭ 19 (-34.48%)
Mutual labels:  python-package
python-package-boilerplate
Boilerplate for a Python Package
Stars: ✭ 75 (+158.62%)
Mutual labels:  python-package

cookiecutter-pypackage-pythonic

Forked from cookiecutter template for a Python package. Forked from audreyr/cookiecutter-pypackage.

It is inspired by Flask and werkzeug's project style patterns. It is used on the tmuxp, cihai-python and vcspull projects.

  • Free software: BSD license
  • Vanilla testing setup with unittest and python setup.py test
  • Travis-CI: Ready for Travis Continuous Integration testing
  • Tox testing: Setup to easily test for Python 2.6, 2.7, 3.3
  • Sphinx docs: Documentation ready for generation with, for example, ReadTheDocs. Note: You can install sphinx docs requirements with $ pip install -r docs/requirements.txt.

Additions and changes

Testing

  • flask/werkzeug-style testsuites. See werkzeug testsuite on github.

  • Use run-tests.py to run all tests, or pass in arguments to test a particular TestSuite, TestCase or Test:

    $ ./run-tests.py
    $ ./run-tests.py yourpackage
    $ ./run-tests.py repo_name.repo_name  # package_name.TestSuite
    $ ./run-tests.py yourpackage.testsuite.test_something
    $ ./run-tests.py testsuite.test_something
    $ ./run-tests.py test_something
    $ ./run-tests.py test_something test_something_docstring
  • setup.py downloads unittest2 for python 2.6.

Python 2.7+3.3

  • from __future__ import absolute_import, division, print_function, \
        with_statement, unicode_literals
  • repo_name/_compat.py module (derived from flask, werkzeug and jinja2.) Why a compatibility module? See Armin Ronacher's post Porting to Python 3 Redux.

Packaging

  • repo_name/__init__.py + repo_name/__about__.py: Metadata in repo_name/__init__.py e.g. __title__, __author__ can be accessed via:

    >>> about = {}
    >>> with open("repo_name/__about__.py") as fp:
    >>>     exec(fp.read(), about)
    >>> print(about['__title__'])
    Your project name

    Keeps setup.py and doc/conf.py in sync with package metadata. pypi and readthedocs distributions build off the latest package data.

    This method avoids cost of tokenizing and importing python file and avoids encountering potential import errors that may arise. It simply opens a vanilla python file and evals it.

    Derived from pypa/warehouse.

  • Relative imports in repo_name/__init__.py.

  • Relative imports in repo_name/testsuite/__init__.py.

  • Relative imports in repo_name/testsuite/{{ cookiecutter.package_name }}.py.

Docs

  • README.rst reStructuredText table for project information.
  • vim modelines for rst in TODO and CHANGELOG.
  • docs/requirements.txt, which can be targetted to install sphinx changelog package on ReadTheDocs. It will also trigger -r ../requirements.txt.
  • sphinx changelog module, (imitation of sqlalchemy, see sqlalchemy changelog)
  • Add TODO and docs/roadmap.rst.
  • Rename CHANGELOG.rst -> CHANGELOG.
  • Add docs/api.rst for documentation of API code. Initial class imported with docstring example.
  • Automatically generate header spacing based on length of cookiecutter variables.

Example data

  • Example TestCase.
  • Example Class w/ docstrings.

Usage

Install cookiecutter:

$ sudo pip install cookiecutter

Generate a Python package project:

$ cookiecutter https://github.com/tony/cookiecutter-pypackage-pythonic.git

Then:

Not Exactly What You Want?

Don't worry, you have options:

Similar Cookiecutter Templates

Fork This / Create Your Own

If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.

  • Once you have your own version working, add it to the Similar Cookiecutter Templates list above with a brief description.
  • It's up to you whether or not to rename your fork/own version. Do whatever you think sounds good.

Or Submit a Pull Request

I also accept pull requests on this, if they're small, atomic, and if they make my own packaging experience better.

See also

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].