GithubHelp home page GithubHelp logo

sgraaf / cookiecutter-python-package Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 92 KB

A cookiecutter template for creating a new Python package

License: MIT License

Python 83.77% Makefile 7.84% Batchfile 8.39%

cookiecutter-python-package's Introduction

Machine Learning ๐Ÿค– and Data Science ๐Ÿงฎ Engineer with a focus on NLP. Full-stack Pythonista ๐Ÿ. He/him.

cookiecutter-python-package's People

Contributors

dependabot[bot] avatar sgraaf avatar

Watchers

 avatar

cookiecutter-python-package's Issues

Add typehint support for `sphinx.ext.autodoc`

The idea here is to define type hints only in the class / function signature and leave them out of the docstring.

I first noticed that structlog has a nice API reference with type annotations, without including them in the docstrings (only in the signature). For this, they use the (undocumented ?!) sphinx.ext.autodoc.typehints Sphinx extension.

Alternatives exist, like sphinx-autodoc-typehints, which gives the following example:

This allows you to use type hints in a very natural fashion, allowing you to migrate from this:

def format_unit(value, unit):
    """
    Formats the given value as a human readable string using the given units.

    :param float|int value: a numeric value
    :param str unit: the unit for the value (kg, m, etc.)
    :rtype: str
    """
    return f"{value} {unit}"

to this:

from typing import Union


def format_unit(value: Union[float, int], unit: str) -> str:
    """
    Formats the given value as a human readable string using the given units.

    :param value: a numeric value
    :param unit: the unit for the value (kg, m, etc.)
    """
    return f"{value} {unit}"

Add options for more licenses

Add options for more licenses. For Python, the most popular OSI licenses are (determined via the GitHub REST API):

  1. MIT
  2. GNU General Public License v3.0
  3. Apache license 2
  4. GNU General Public License v2.0
  5. BSD 3-clause "New" or "Revised" license
  6. GNU Affero General Public License v3.0
  7. The Unlicense

The first three licenses are already supported.

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.