indoc


Nameindoc JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/dsm-72/indoc
SummaryLiteral Enum
upload_time2023-09-05 19:36:53
maintainer
docs_urlNone
authordsm-72
requires_python>=3.11
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # indoc

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Developer Guide

### Setup

``` sh
# create conda environment
$ mamba env create -f env.yml

# update conda environment
$ mamba env update -n indoc --file env.yml
```

### Install

``` sh
pip install -e .

# install from pypi
pip install indoc
```

### nbdev

``` sh
# activate conda environment
$ conda activate indoc

# make sure the indoc package is installed in development mode
$ pip install -e .

# make changes under nbs/ directory
# ...

# compile to have changes apply to the indoc package
$ nbdev_prepare
```

### Publishing

``` sh
# publish to pypi
$ nbdev_pypi

# publish to conda
$ nbdev_conda --build_args '-c conda-forge'
$ nbdev_conda --mambabuild --build_args '-c conda-forge -c dsm-72'
```

# Usage

## Installation

Install latest from the GitHub
[repository](https://github.com/dsm-72/indoc):

``` sh
$ pip install git+https://github.com/dsm-72/indoc.git
```

or from [conda](https://anaconda.org/dsm-72/indoc)

``` sh
$ conda install -c dsm-72 indoc
```

or from [pypi](https://pypi.org/project/indoc/)

``` sh
$ pip install indoc
```

## Documentation

Documentation can be found hosted on GitHub
[repository](https://github.com/dsm-72/indoc)
[pages](https://dsm-72.github.io/indoc/). Additionally you can find
package manager specific guidelines on
[conda](https://anaconda.org/dsm-72/indoc) and
[pypi](https://pypi.org/project/indoc/) respectively.

### [`indoc`](https://dsm-72.github.io/indoc/indoc.html#indoc) decorator

define (base / mixin) class with a docstring we want to pass to a
subclass

``` python
@dataclass
class Mix:
    r'''
    A Mixin class

    Attributes
    ----------
    a : str
        a string
    i : int, optional
        an int
    b : bool, optional
        a bool

    Methods
    -------
    is_b(self) -> bool
        checks if b is True    
    '''
    a: str
    _: KW_ONLY
    i: int = 0
    b: bool = False

    @property
    def prop(self):
        return self.a

    @abstractmethod
    def is_b(self) -> bool:
        return self.b
```

A subclass we want to have `Mix`’s docstring

``` python
foodoc = '''
    A Foo class
    
    Attributes
    ----------
    q : bool

    Methods
    -------
    is_q(self) -> bool
        checks if q is True
    '''    

@indoc
@dataclass
class Foo(Mix):
    __doc__ = foodoc
    q: bool
    def is_q(self) -> bool:
        return self.q
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dsm-72/indoc",
    "name": "indoc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "nbdev jupyter notebook python",
    "author": "dsm-72",
    "author_email": "sumner.magruder@yale.edu",
    "download_url": "https://files.pythonhosted.org/packages/f1/88/6a3158d416bfb3592f2f54b7770710e11276b85c00fd30b1bcd256d4c7c1/indoc-0.0.4.tar.gz",
    "platform": null,
    "description": "# indoc\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Developer Guide\n\n### Setup\n\n``` sh\n# create conda environment\n$ mamba env create -f env.yml\n\n# update conda environment\n$ mamba env update -n indoc --file env.yml\n```\n\n### Install\n\n``` sh\npip install -e .\n\n# install from pypi\npip install indoc\n```\n\n### nbdev\n\n``` sh\n# activate conda environment\n$ conda activate indoc\n\n# make sure the indoc package is installed in development mode\n$ pip install -e .\n\n# make changes under nbs/ directory\n# ...\n\n# compile to have changes apply to the indoc package\n$ nbdev_prepare\n```\n\n### Publishing\n\n``` sh\n# publish to pypi\n$ nbdev_pypi\n\n# publish to conda\n$ nbdev_conda --build_args '-c conda-forge'\n$ nbdev_conda --mambabuild --build_args '-c conda-forge -c dsm-72'\n```\n\n# Usage\n\n## Installation\n\nInstall latest from the GitHub\n[repository](https://github.com/dsm-72/indoc):\n\n``` sh\n$ pip install git+https://github.com/dsm-72/indoc.git\n```\n\nor from [conda](https://anaconda.org/dsm-72/indoc)\n\n``` sh\n$ conda install -c dsm-72 indoc\n```\n\nor from [pypi](https://pypi.org/project/indoc/)\n\n``` sh\n$ pip install indoc\n```\n\n## Documentation\n\nDocumentation can be found hosted on GitHub\n[repository](https://github.com/dsm-72/indoc)\n[pages](https://dsm-72.github.io/indoc/). Additionally you can find\npackage manager specific guidelines on\n[conda](https://anaconda.org/dsm-72/indoc) and\n[pypi](https://pypi.org/project/indoc/) respectively.\n\n### [`indoc`](https://dsm-72.github.io/indoc/indoc.html#indoc) decorator\n\ndefine (base / mixin) class with a docstring we want to pass to a\nsubclass\n\n``` python\n@dataclass\nclass Mix:\n    r'''\n    A Mixin class\n\n    Attributes\n    ----------\n    a : str\n        a string\n    i : int, optional\n        an int\n    b : bool, optional\n        a bool\n\n    Methods\n    -------\n    is_b(self) -> bool\n        checks if b is True    \n    '''\n    a: str\n    _: KW_ONLY\n    i: int = 0\n    b: bool = False\n\n    @property\n    def prop(self):\n        return self.a\n\n    @abstractmethod\n    def is_b(self) -> bool:\n        return self.b\n```\n\nA subclass we want to have `Mix`\u2019s docstring\n\n``` python\nfoodoc = '''\n    A Foo class\n    \n    Attributes\n    ----------\n    q : bool\n\n    Methods\n    -------\n    is_q(self) -> bool\n        checks if q is True\n    '''    \n\n@indoc\n@dataclass\nclass Foo(Mix):\n    __doc__ = foodoc\n    q: bool\n    def is_q(self) -> bool:\n        return self.q\n```\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Literal Enum",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/dsm-72/indoc"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0545f103dea4965c96391f5c872440fbae9601f772f1cbb4a923061efb176871",
                "md5": "1c7c7ae28d14ec87a2d3ca3047b5f3a0",
                "sha256": "2d47938cdf2ec66bb599c53e373be3ec7124067cf2d72636e830c1db29a25a76"
            },
            "downloads": -1,
            "filename": "indoc-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1c7c7ae28d14ec87a2d3ca3047b5f3a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 14489,
            "upload_time": "2023-09-05T19:36:51",
            "upload_time_iso_8601": "2023-09-05T19:36:51.897298Z",
            "url": "https://files.pythonhosted.org/packages/05/45/f103dea4965c96391f5c872440fbae9601f772f1cbb4a923061efb176871/indoc-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f1886a3158d416bfb3592f2f54b7770710e11276b85c00fd30b1bcd256d4c7c1",
                "md5": "314aba520212b836cc0d322128d43be2",
                "sha256": "e0500b466d1b78339142bb1d0b92d7a4cda6be0809ecd56940a612c619f8db05"
            },
            "downloads": -1,
            "filename": "indoc-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "314aba520212b836cc0d322128d43be2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 15019,
            "upload_time": "2023-09-05T19:36:53",
            "upload_time_iso_8601": "2023-09-05T19:36:53.313571Z",
            "url": "https://files.pythonhosted.org/packages/f1/88/6a3158d416bfb3592f2f54b7770710e11276b85c00fd30b1bcd256d4c7c1/indoc-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-05 19:36:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dsm-72",
    "github_project": "indoc",
    "github_not_found": true,
    "lcname": "indoc"
}
        
Elapsed time: 0.13534s