memoized-property


Namememoized-property JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/estebistec/python-memoized-property
SummaryA simple python decorator for defining properties that only run their fget function once
upload_time2016-09-29 06:16:34
maintainerNone
docs_urlNone
authorSteven Cummings
requires_pythonNone
licenseBSD
keywords memoized property decorator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            =================
memoized_property
=================

.. image:: https://badge.fury.io/py/memoized-property.png
    :target: http://badge.fury.io/py/memoized-property
    
.. image:: https://travis-ci.org/estebistec/python-memoized-property.png?branch=master
        :target: https://travis-ci.org/estebistec/python-memoized-property

.. image:: https://pypip.in/d/memoized-property/badge.png
        :target: https://crate.io/packages/memoized-property?version=latest


A simple python decorator for defining properties that only run their fget function once.

* Free software: BSD license

What?
-----

A Python property that only calls its ``fget`` function one time. How many times have you written
this code (or similar)?

::

    def class C(object):

        @property
        def name(self):
            if not hasattr(self, '_name'):
                self._name = some_expensive_load()
            return self._name

I've written it just enough times to be annoyed enough to capture this module. The result is this::

    from memoized_property import memoized_property

    def class C(object):

        @memoized_property
        def name(self):
            # Boilerplate guard conditional avoided, but this is still only called once
            return some_expensive_load()

Why?
----

I couldn't find a pre-existing version of this on PyPI. I found one other on GitHub,
https://github.com/ytyng/python-memoized-property, but it was not published to PyPI.




History
-------

1.0.3 (2016-09-28)
++++++++++++++++++

* Build universal wheels
* Support Python 3.4, 3.5

1.0.2 (2014-05-02)
++++++++++++++++++

* Remove dependency on six

1.0.1 (2014-01-01)
++++++++++++++++++

* Added python 3.2 compatability

1.0.0 (2013-12-26)
++++++++++++++++++

* First release on PyPI.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/estebistec/python-memoized-property",
    "name": "memoized-property",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "memoized property decorator",
    "author": "Steven Cummings",
    "author_email": "cummingscs@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/70/db/23f8b5d86c9385299586c2469b58087f658f58eaeb414be0fd64cfd054e1/memoized-property-1.0.3.tar.gz",
    "platform": "UNKNOWN",
    "description": "=================\nmemoized_property\n=================\n\n.. image:: https://badge.fury.io/py/memoized-property.png\n    :target: http://badge.fury.io/py/memoized-property\n    \n.. image:: https://travis-ci.org/estebistec/python-memoized-property.png?branch=master\n        :target: https://travis-ci.org/estebistec/python-memoized-property\n\n.. image:: https://pypip.in/d/memoized-property/badge.png\n        :target: https://crate.io/packages/memoized-property?version=latest\n\n\nA simple python decorator for defining properties that only run their fget function once.\n\n* Free software: BSD license\n\nWhat?\n-----\n\nA Python property that only calls its ``fget`` function one time. How many times have you written\nthis code (or similar)?\n\n::\n\n    def class C(object):\n\n        @property\n        def name(self):\n            if not hasattr(self, '_name'):\n                self._name = some_expensive_load()\n            return self._name\n\nI've written it just enough times to be annoyed enough to capture this module. The result is this::\n\n    from memoized_property import memoized_property\n\n    def class C(object):\n\n        @memoized_property\n        def name(self):\n            # Boilerplate guard conditional avoided, but this is still only called once\n            return some_expensive_load()\n\nWhy?\n----\n\nI couldn't find a pre-existing version of this on PyPI. I found one other on GitHub,\nhttps://github.com/ytyng/python-memoized-property, but it was not published to PyPI.\n\n\n\n\nHistory\n-------\n\n1.0.3 (2016-09-28)\n++++++++++++++++++\n\n* Build universal wheels\n* Support Python 3.4, 3.5\n\n1.0.2 (2014-05-02)\n++++++++++++++++++\n\n* Remove dependency on six\n\n1.0.1 (2014-01-01)\n++++++++++++++++++\n\n* Added python 3.2 compatability\n\n1.0.0 (2013-12-26)\n++++++++++++++++++\n\n* First release on PyPI.",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A simple python decorator for defining properties that only run their fget function once",
    "version": "1.0.3",
    "project_urls": {
        "Download": "UNKNOWN",
        "Homepage": "https://github.com/estebistec/python-memoized-property"
    },
    "split_keywords": [
        "memoized",
        "property",
        "decorator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70db23f8b5d86c9385299586c2469b58087f658f58eaeb414be0fd64cfd054e1",
                "md5": "ae9bf3ef40b9a08a4f1798fb322c6865",
                "sha256": "4be4d0209944b9b9b678dae9d7e312249fe2e6fb8bdc9bdaa1da4de324f0fcf5"
            },
            "downloads": -1,
            "filename": "memoized-property-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "ae9bf3ef40b9a08a4f1798fb322c6865",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5011,
            "upload_time": "2016-09-29T06:16:34",
            "upload_time_iso_8601": "2016-09-29T06:16:34.770963Z",
            "url": "https://files.pythonhosted.org/packages/70/db/23f8b5d86c9385299586c2469b58087f658f58eaeb414be0fd64cfd054e1/memoized-property-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2016-09-29 06:16:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "estebistec",
    "github_project": "python-memoized-property",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "memoized-property"
}
        
Elapsed time: 1.74001s