stronglytypedproperty


Namestronglytypedproperty JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://gitlab.com/semantik-software/code/python/StronglyTypedProperty
SummaryAdds strongly typed property to a class
upload_time2023-05-13 01:46:50
maintainerWilliam McLendon
docs_urlNone
authorWilliam McLendon
requires_python>=3.6,<4.0
licenseLICENSE
keywords property strongly typed
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- GitLab Badges -->


StronglyTypedProperty
=====================

Sometimes we need to enforce that a property meets certain type and/or value restrictions
because the consumers of that property have made assumptions regarding the data that is
stored.

The permissiveness of Python to allow anything to be assigned to a property gives us
tremendous flexibility but it can also complicate debugging when things go wrong,
especially when the wrong data is written into a property. When this happens we will
either have an application that runs to completion without failing but gives an incorrect
result or we may get an exception thrown at a point-of-use. Either one of these cases can
be time consuming to debug depending on the complexity of the application as we need to
find *where*, *why*, and *when* the bad data was written to the variable.

While it can be costly to do this checking at each assignment, there are times
when we really wish to lock down a property and restrict what can be assigned
to it so that any errors will manifest at assignment rather than a use point.
In applications that we need to identify exactly where things go wrong quickly
(i.e., fail-fast systems) the value of this may well outweigh the hit on
performance that we take.

*StronglyTypedProperty* provides a [Data Class][1] like interface with an additional
ability to perform strong type checking as well as value checking on the property
created.
Type checking operations are performed when values are assigned to the property.
The following capabilities are provided:

* Restrict assigned data to a list of allowable types.
* Specify the internal sotrage type of the property.
* Set default values (for read before write situations).
* Provide optional *value* checking on assignment in addition to type checking.

Documentation and User Guide
============================
See the [User Guide][4] for detailed documentation on the package. This includes
the API docs, user guide, and examples.

History
=======
*StronglyTypedProperty* is pulled from [*ConfigParserEnhanced*][3] into its own module
because it is an interesting and useful class. Splitting these up was the intent from
the beginning when it was originally developed.

Updates
=======
See [CHANGELOG][2] for information on changes.


[1]: https://docs.python.org/3/library/dataclasses.html
[2]: https://gitlab.com/semantik-software/code/python/StronglyTypedProperty/-/blob/main/CHANGELOG.md
[3]: https://github.com/sandialabs/ConfigParserEnhanced
[4]: https://semantik-software.gitlab.io/code/python/StronglyTypedProperty/



            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/semantik-software/code/python/StronglyTypedProperty",
    "name": "stronglytypedproperty",
    "maintainer": "William McLendon",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "wcmclen@hotmail.com",
    "keywords": "Property,Strongly Typed",
    "author": "William McLendon",
    "author_email": "wcmclen@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/72/cf/deae00dcd37b091a75fd8ce3e0a93b949d08802c04029e72ee232ba787cc/stronglytypedproperty-0.1.0.tar.gz",
    "platform": null,
    "description": "<!-- GitLab Badges -->\n\n\nStronglyTypedProperty\n=====================\n\nSometimes we need to enforce that a property meets certain type and/or value restrictions\nbecause the consumers of that property have made assumptions regarding the data that is\nstored.\n\nThe permissiveness of Python to allow anything to be assigned to a property gives us\ntremendous flexibility but it can also complicate debugging when things go wrong,\nespecially when the wrong data is written into a property. When this happens we will\neither have an application that runs to completion without failing but gives an incorrect\nresult or we may get an exception thrown at a point-of-use. Either one of these cases can\nbe time consuming to debug depending on the complexity of the application as we need to\nfind *where*, *why*, and *when* the bad data was written to the variable.\n\nWhile it can be costly to do this checking at each assignment, there are times\nwhen we really wish to lock down a property and restrict what can be assigned\nto it so that any errors will manifest at assignment rather than a use point.\nIn applications that we need to identify exactly where things go wrong quickly\n(i.e., fail-fast systems) the value of this may well outweigh the hit on\nperformance that we take.\n\n*StronglyTypedProperty* provides a [Data Class][1] like interface with an additional\nability to perform strong type checking as well as value checking on the property\ncreated.\nType checking operations are performed when values are assigned to the property.\nThe following capabilities are provided:\n\n* Restrict assigned data to a list of allowable types.\n* Specify the internal sotrage type of the property.\n* Set default values (for read before write situations).\n* Provide optional *value* checking on assignment in addition to type checking.\n\nDocumentation and User Guide\n============================\nSee the [User Guide][4] for detailed documentation on the package. This includes\nthe API docs, user guide, and examples.\n\nHistory\n=======\n*StronglyTypedProperty* is pulled from [*ConfigParserEnhanced*][3] into its own module\nbecause it is an interesting and useful class. Splitting these up was the intent from\nthe beginning when it was originally developed.\n\nUpdates\n=======\nSee [CHANGELOG][2] for information on changes.\n\n\n[1]: https://docs.python.org/3/library/dataclasses.html\n[2]: https://gitlab.com/semantik-software/code/python/StronglyTypedProperty/-/blob/main/CHANGELOG.md\n[3]: https://github.com/sandialabs/ConfigParserEnhanced\n[4]: https://semantik-software.gitlab.io/code/python/StronglyTypedProperty/\n\n\n",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "Adds strongly typed property to a class",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://semantik-software.gitlab.io/code/python/StronglyTypedProperty",
        "Homepage": "https://gitlab.com/semantik-software/code/python/StronglyTypedProperty",
        "Issues": "https://gitlab.com/semantik-software/code/python/stronglytypedproperty/-/issues",
        "Repository": "https://gitlab.com/semantik-software/code/python/StronglyTypedProperty"
    },
    "split_keywords": [
        "property",
        "strongly typed"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ef3528f9bfadeb72031a85cc46834c6538bb329136a3971add1628938b46a94",
                "md5": "1df3daef07095e4eda19abaf0b72ba47",
                "sha256": "1cf6fdaa6baef32e296cdbfc80f32abffa790cfcbace3d6710b4eabbbbc8b534"
            },
            "downloads": -1,
            "filename": "stronglytypedproperty-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1df3daef07095e4eda19abaf0b72ba47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 15909,
            "upload_time": "2023-05-13T01:46:48",
            "upload_time_iso_8601": "2023-05-13T01:46:48.923829Z",
            "url": "https://files.pythonhosted.org/packages/4e/f3/528f9bfadeb72031a85cc46834c6538bb329136a3971add1628938b46a94/stronglytypedproperty-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "72cfdeae00dcd37b091a75fd8ce3e0a93b949d08802c04029e72ee232ba787cc",
                "md5": "a5837acbdb3eba0b9007a51d3c685127",
                "sha256": "9016adf54196c3d8d51b7d42eb4ab675b52395015367f7ff4e3e6b9c15b7ad0c"
            },
            "downloads": -1,
            "filename": "stronglytypedproperty-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a5837acbdb3eba0b9007a51d3c685127",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 10485,
            "upload_time": "2023-05-13T01:46:50",
            "upload_time_iso_8601": "2023-05-13T01:46:50.753692Z",
            "url": "https://files.pythonhosted.org/packages/72/cf/deae00dcd37b091a75fd8ce3e0a93b949d08802c04029e72ee232ba787cc/stronglytypedproperty-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-13 01:46:50",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "semantik-software",
    "gitlab_project": "code",
    "lcname": "stronglytypedproperty"
}
        
Elapsed time: 0.06546s