python-doc-inherit
==================
Utilities to inherit method documentation from parent classes.
Badges
------
.. image:: https://img.shields.io/travis/kavdev/python-doc-inherit/master.svg?style=flat-square
:target: https://travis-ci.org/kavdev/python-doc-inherit
.. image:: https://img.shields.io/codecov/c/github/kavdev/python-doc-inherit/master.svg?style=flat-square
:target: http://codecov.io/github/kavdev/python-doc-inherit?branch=master
.. image:: https://img.shields.io/requires/github/kavdev/python-doc-inherit.svg?style=flat-square
:target: https://requires.io/github/kavdev/python-doc-inherit/requirements/?branch=master
.. image:: https://img.shields.io/codacy/75dbe2685efe47c3aa203a53154c9e7e.svg?style=flat-square
:target: https://www.codacy.com/app/kavanaugh-development/python-doc-inherit/dashboard
.. image:: https://img.shields.io/pypi/v/python-doc-inherit.svg?style=flat-square
:target: https://pypi.python.org/pypi/python-doc-inherit
.. image:: https://img.shields.io/pypi/dw/python-doc-inherit.svg?style=flat-square
:target: https://pypi.python.org/pypi/python-doc-inherit
.. image:: https://img.shields.io/github/issues/kavdev/python-doc-inherit.svg?style=flat-square
:target: https://github.com/kavdev/python-doc-inherit/issues
.. image:: https://img.shields.io/github/license/kavdev/python-doc-inherit.svg?style=flat-square
:target: https://github.com/kavdev/python-doc-inherit/blob/master/LICENSE
Installation
------------
Install python-doc-inherit:
.. code-block:: bash
pip install python-doc-inherit
Usage
-----
Simple method decorator (will cause other decorators to fail)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
from doc_inherit import method_doc_inherit
class Foo(object):
def foo(self):
"""Frobber"""
pass
class Bar(Foo):
@method_doc_inherit
def foo(self):
pass
Now, ``Bar.foo.__doc__ == Bar().foo.__doc__ == Foo.foo.__doc__ == "Frobber"``
Simple class decorator
~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
from doc_inherit import class_doc_inherit
class Foo(object):
def foo(self):
"""Frobber"""
pass
@class_doc_inherit
class Bar(Foo):
def foo(self):
pass
Now, ``Bar.foo.__doc__ == Bar().foo.__doc__ == Foo.foo.__doc__ == "Frobber"``
Metaclass
~~~~~~~~~
.. code-block:: python
from doc_inherit.metaclasses import DocStringInheritor
from six import add_metaclass # Note: Six is not included in this distribution.
class Animal:
def move_to(self, dest):
"""Move to *dest*"""
pass
@add_metaclass(DocStringInheritor)
class Bird(Animal):
def move_to(self, dest):
pass
Now, ``Animal.move_to.__doc__ == Bird.move_to.__doc__ == "Move to *dest*"``
Running the Tests
------------------
.. code-block:: bash
pip install -r requirements/test.txt
./runtests.py
Changes
=======
0.1.1 (2016-06-18)
----------------------
* small fixes
0.1.0 (2016-06-18)
----------------------
* Initial release
Metadata
Release files for python-doc-inherit 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-doc-inherit-0.3.0.tar.gz | 6.1 kB | Without provenance | Details for python-doc-inherit-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_doc_inherit-0.3.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for python_doc_inherit-0.3.0-py2.py3-none-any.whl |
Total release size: 11.9 kB
Release files / python-doc-inherit-0.3.0.tar.gz
| Download URL | python-doc-inherit-0.3.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99aa5f18ceb07463128bb1fd33f43a8b789b89b7dc1033a783ee5c41fdf31fa7
|
|
BLAKE2b-256 checksum How to use checksums |
41b6763d2474e0ed3946f470513f0ee61b5be7921880a2421b311810049d8881
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / python_doc_inherit-0.3.0-py2.py3-none-any.whl
| Download URL | python_doc_inherit-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
588ad773a64d9a0f20cb7edf22a7d7c5421996744b0f024f042524f5fc7d226f
|
|
BLAKE2b-256 checksum How to use checksums |
74a946749cd2d28b7b566d240fecb0293e3b5af3741e8f25517d3677329ee545
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for python-doc-inherit 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.