litum


Namelitum JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/dsm-72/litum
SummaryLiteral Enum
upload_time2023-09-05 19:32:12
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.
            # litum

<!-- 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 litum --file env.yml
```

### Install

``` sh
pip install -e .

# install from pypi
pip install litum
```

### nbdev

``` sh
# activate conda environment
$ conda activate litum

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

# make changes under nbs/ directory
# ...

# compile to have changes apply to the litum 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/litum):

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

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

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

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

``` sh
$ pip install litum
```

## Documentation

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

Note that
[`LiteralEnum`](https://dsm-72.github.io/litum/enum.html#literalenum),
[`LitStrEnum`](https://dsm-72.github.io/litum/enum.html#litstrenum), and
[`LitIntEnum`](https://dsm-72.github.io/litum/enum.html#litintenum) have
aliases `Litum`, `Strum`, and `Intum` respectively.

``` python
@set_dtype(str)
@set_fallback('GREEN')
class MyLiteralEnum(LiteralEnum):
    RED = 'red'
    BLUE = 'blue'
    GREEN = 'green'

color = MyLiteralEnum('RED')
color, MyLiteralEnum('blue'), MyLiteralEnum('ORANGE')
```

    (<MyLiteralEnum.RED: 'red'>,
     <MyLiteralEnum.BLUE: 'blue'>,
     <MyLiteralEnum.GREEN: 'green'>)

``` python
MyLiteralEnum.check_fallback(), MyLiteralEnum.check_dtype(color)
```

    (<MyLiteralEnum.GREEN: 'green'>, True)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dsm-72/litum",
    "name": "litum",
    "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/84/e1/f765c68b30d38e6bca3795c3a3a096767e4a16922551ad4fae7bd9c68ae2/litum-0.0.4.tar.gz",
    "platform": null,
    "description": "# litum\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 litum --file env.yml\n```\n\n### Install\n\n``` sh\npip install -e .\n\n# install from pypi\npip install litum\n```\n\n### nbdev\n\n``` sh\n# activate conda environment\n$ conda activate litum\n\n# make sure the litum 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 litum 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/litum):\n\n``` sh\n$ pip install git+https://github.com/dsm-72/litum.git\n```\n\nor from [conda](https://anaconda.org/dsm-72/litum)\n\n``` sh\n$ conda install -c dsm-72 litum\n```\n\nor from [pypi](https://pypi.org/project/litum/)\n\n``` sh\n$ pip install litum\n```\n\n## Documentation\n\nDocumentation can be found hosted on GitHub\n[repository](https://github.com/dsm-72/litum)\n[pages](https://dsm-72.github.io/litum/). Additionally you can find\npackage manager specific guidelines on\n[conda](https://anaconda.org/dsm-72/litum) and\n[pypi](https://pypi.org/project/litum/) respectively.\n\nNote that\n[`LiteralEnum`](https://dsm-72.github.io/litum/enum.html#literalenum),\n[`LitStrEnum`](https://dsm-72.github.io/litum/enum.html#litstrenum), and\n[`LitIntEnum`](https://dsm-72.github.io/litum/enum.html#litintenum) have\naliases `Litum`, `Strum`, and `Intum` respectively.\n\n``` python\n@set_dtype(str)\n@set_fallback('GREEN')\nclass MyLiteralEnum(LiteralEnum):\n    RED = 'red'\n    BLUE = 'blue'\n    GREEN = 'green'\n\ncolor = MyLiteralEnum('RED')\ncolor, MyLiteralEnum('blue'), MyLiteralEnum('ORANGE')\n```\n\n    (<MyLiteralEnum.RED: 'red'>,\n     <MyLiteralEnum.BLUE: 'blue'>,\n     <MyLiteralEnum.GREEN: 'green'>)\n\n``` python\nMyLiteralEnum.check_fallback(), MyLiteralEnum.check_dtype(color)\n```\n\n    (<MyLiteralEnum.GREEN: 'green'>, True)\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/litum"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf360fe10667c0aafbe10ec4636a74bccc6811a6e3e525d7c36098a7306066b8",
                "md5": "5b6212622dbb1035eab0b1fb3ea7606a",
                "sha256": "784c57b887028405353bf86972dd11e528cd532617b50bd93e062f041b0a39d6"
            },
            "downloads": -1,
            "filename": "litum-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5b6212622dbb1035eab0b1fb3ea7606a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 12607,
            "upload_time": "2023-09-05T19:32:11",
            "upload_time_iso_8601": "2023-09-05T19:32:11.702131Z",
            "url": "https://files.pythonhosted.org/packages/bf/36/0fe10667c0aafbe10ec4636a74bccc6811a6e3e525d7c36098a7306066b8/litum-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84e1f765c68b30d38e6bca3795c3a3a096767e4a16922551ad4fae7bd9c68ae2",
                "md5": "d4cf9d5f80ac8773ccc860bc4954c503",
                "sha256": "86a6397347a2c2f1963d083ab16917e5d35830fac314974936f849158e10a073"
            },
            "downloads": -1,
            "filename": "litum-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d4cf9d5f80ac8773ccc860bc4954c503",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 13225,
            "upload_time": "2023-09-05T19:32:12",
            "upload_time_iso_8601": "2023-09-05T19:32:12.841894Z",
            "url": "https://files.pythonhosted.org/packages/84/e1/f765c68b30d38e6bca3795c3a3a096767e4a16922551ad4fae7bd9c68ae2/litum-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-05 19:32:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dsm-72",
    "github_project": "litum",
    "github_not_found": true,
    "lcname": "litum"
}
        
Elapsed time: 0.39311s