Metadata-Version: 2.1
Name: StrEnum
Version: 0.4.4
Summary: An Enum that inherits from str.
Home-page: https://github.com/irgeek/StrEnum
Author: James Sinclair
Author-email: james@nurfherder.com
License: UNKNOWN
Description: # StrEnum
        
        [![Build Status](https://github.com/irgeek/StrEnum/workflows/Python%20package/badge.svg)](https://github.com/irgeek/StrEnum/actions)
        
        
        StrEnum is a Python `enum.Enum` that inherits from `str` to complement
        `enum.IntEnum` in the standard library.  Supports python 3.6+.
        
        ## Installation
        
        You can use [pip](https://pip.pypa.io/en/stable/) to install.
        
        ```bash
        pip install StrEnum
        ```
        
        ## Usage
        
        ```python
        from enum import auto
        from strenum import StrEnum
        
        
        class HttpMethod(StrEnum):
            GET = auto()
            HEAD = auto()
            POST = auto()
            PUT = auto()
            DELETE = auto()
            CONNECT = auto()
            OPTIONS = auto()
            TRACE = auto()
            PATCH = auto()
        
        
        print(f"An HTTP method: {HttpMethod.GET}")  # prints "An HTTP method: GET"
        ```
        
        There are also case-folding versions available:
        
        ```pycon
        >>> from pprint import pprint
        >>> from enum import auto
        >>> from strenum import StrEnum, LowercaseStrEnum, UppercaseStrEnum
        >>>
        >>> class Regular(StrEnum):
        ...     Member = auto()
        ...
        >>>
        >>> class Lower(LowercaseStrEnum):
        ...     Member = auto()
        ...
        >>>
        >>> class Upper(UppercaseStrEnum):
        ...     Member = auto()
        ...
        >>>
        >>> pprint((Regular.Member, Lower.Member, Upper.Member))
        ( <Regular.Member: 'Member'>,
            <Lower.Member: 'member'>,
            <Upper.Member: 'MEMBER'>)
        ```
        
        ## Why not `enum34-custom`'s `StrEnum`?
        
        Because it's not compatible with modern versions of python ([see issue](https://github.com/kissgyorgy/enum34-custom/issues/7)).
        
        ## Contributing
        Pull requests are welcome. For major changes, please open an issue first to
        discuss what you would like to change.
        
        Please ensure tests pass before submitting a PR. This repository uses
        [Black](https://black.readthedocs.io/en/stable/) and
        [Pylint](https://www.pylint.org/) for consistency. Both are run automatically
        as part of the test suite.
        
        ## Running the tests
        
        Tests can be run using `make`:
        
        ```
        make test
        ```
        
        This will create a virutal environment, install the module and its test
        dependencies and run the tests. Alternatively you can do the same thing
        manually:
        
        ```
        python3 -m venv .venv
        .venv/bin/pip install .[test]
        .venv/bin/pytest
        ```
        
        ## License
        [MIT](https://choosealicense.com/licenses/mit/)
        
        **N.B. Starting with Python 3.10, `enum.StrEnum` is available in the standard
        library.  This implementation is _not_ a drop-in replacement for the standard
        library implementation. Sepcifically, the Python devs have decided to case fold
        name to lowercase by default when `auto()` is used which I think violates the
        principle of least surprise.**
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: release
