apply


Nameapply JSON
Version 1.7 PyPI version JSON
download
home_pagehttps://github.com/stefanholek/apply
SummaryAn apply function for Python 2 and 3
upload_time2023-09-14 13:35:04
maintainer
docs_urlhttps://pythonhosted.org/apply/
authorStefan H. Holek
requires_python!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7
licenseBSD-2-Clause
keywords apply read write property properties
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====
apply
=====
------------------------------------
An apply function for Python 2 and 3
------------------------------------

Package Contents
================

apply(object, args=None, kwargs=None)
    Call object with args and kwargs; return its results.

Overview
========

Python 3 has no apply. We like apply.
If you like apply as well, have no fear. This version of apply works
across all versions of Python.

Examples
========

apply allows to create read/write properties in a very compact way:

.. code-block:: python

    from apply import apply

    class X509:

        def __init__(self, store):
            self.store = store

        @apply
        def CN():
            doc = 'The common name attribute'
            def get(self):
                return self.store.get('CN')
            def set(self, value):
                self.store.put('CN', value)
            return property(get, set, None, doc)

    record = X509(LDAP())
    record.CN = 'Slate Rock and Gravel Company'

Documentation
=============

For further details please refer to the `API Documentation`_.

.. _`API Documentation`: https://apply.readthedocs.io/en/stable/


Changelog
=========

1.7 - 2023-09-14
----------------

- Update tox.ini for latest tox.
  [stefan]

- Add GitHub CI workflow.
  [stefan]

- Add .readthedocs.yaml file.
  [stefan]

- Pin sphinx and sphinx-rtd-theme versions in docs extra.
  [stefan]

1.6 - 2022-03-09
----------------

- Add Python 3.8-3.10 to tox.ini. Remove old Python versions.
  [stefan]

- Replace deprecated ``python setup.py test`` in tox.ini.
  [stefan]

- Remove deprecated ``test_suite`` from setup.py.
  [stefan]

- Move metadata to setup.cfg and add a pyproject.toml file.
  [stefan]

- Include tests in sdist but not in wheel.
  [stefan]

1.5 - 2019-01-28
----------------

- Add MANIFEST.in.
  [stefan]

- Release as wheel.
  [stefan]

1.4 - 2017-02-05
----------------

- Support Python 2.6-3.6 without 2to3.
  [stefan]

- Add a LICENSE file.
  [stefan]

1.3 - 2014-04-19
----------------

- Remove setuptools from install_requires because it isn't.
  [stefan]

1.2 - 2011-11-26
----------------

- Update README.
  [stefan]

1.1 - 2011-11-26
----------------

- Fix function signature.
  [stefan]

1.0 - 2011-11-25
----------------

- Initial release.
  [stefan]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/stefanholek/apply",
    "name": "apply",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/apply/",
    "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7",
    "maintainer_email": "",
    "keywords": "apply,read,write,property,properties",
    "author": "Stefan H. Holek",
    "author_email": "stefan@epy.co.at",
    "download_url": "https://files.pythonhosted.org/packages/74/16/039da9c28eed267b3cfe451dab87dce538a7d8abf68e5e8e565968e1f049/apply-1.7.tar.gz",
    "platform": null,
    "description": "=====\napply\n=====\n------------------------------------\nAn apply function for Python 2 and 3\n------------------------------------\n\nPackage Contents\n================\n\napply(object, args=None, kwargs=None)\n    Call object with args and kwargs; return its results.\n\nOverview\n========\n\nPython 3 has no apply. We like apply.\nIf you like apply as well, have no fear. This version of apply works\nacross all versions of Python.\n\nExamples\n========\n\napply allows to create read/write properties in a very compact way:\n\n.. code-block:: python\n\n    from apply import apply\n\n    class X509:\n\n        def __init__(self, store):\n            self.store = store\n\n        @apply\n        def CN():\n            doc = 'The common name attribute'\n            def get(self):\n                return self.store.get('CN')\n            def set(self, value):\n                self.store.put('CN', value)\n            return property(get, set, None, doc)\n\n    record = X509(LDAP())\n    record.CN = 'Slate Rock and Gravel Company'\n\nDocumentation\n=============\n\nFor further details please refer to the `API Documentation`_.\n\n.. _`API Documentation`: https://apply.readthedocs.io/en/stable/\n\n\nChangelog\n=========\n\n1.7 - 2023-09-14\n----------------\n\n- Update tox.ini for latest tox.\n  [stefan]\n\n- Add GitHub CI workflow.\n  [stefan]\n\n- Add .readthedocs.yaml file.\n  [stefan]\n\n- Pin sphinx and sphinx-rtd-theme versions in docs extra.\n  [stefan]\n\n1.6 - 2022-03-09\n----------------\n\n- Add Python 3.8-3.10 to tox.ini. Remove old Python versions.\n  [stefan]\n\n- Replace deprecated ``python setup.py test`` in tox.ini.\n  [stefan]\n\n- Remove deprecated ``test_suite`` from setup.py.\n  [stefan]\n\n- Move metadata to setup.cfg and add a pyproject.toml file.\n  [stefan]\n\n- Include tests in sdist but not in wheel.\n  [stefan]\n\n1.5 - 2019-01-28\n----------------\n\n- Add MANIFEST.in.\n  [stefan]\n\n- Release as wheel.\n  [stefan]\n\n1.4 - 2017-02-05\n----------------\n\n- Support Python 2.6-3.6 without 2to3.\n  [stefan]\n\n- Add a LICENSE file.\n  [stefan]\n\n1.3 - 2014-04-19\n----------------\n\n- Remove setuptools from install_requires because it isn't.\n  [stefan]\n\n1.2 - 2011-11-26\n----------------\n\n- Update README.\n  [stefan]\n\n1.1 - 2011-11-26\n----------------\n\n- Fix function signature.\n  [stefan]\n\n1.0 - 2011-11-25\n----------------\n\n- Initial release.\n  [stefan]\n",
    "bugtrack_url": null,
    "license": "BSD-2-Clause",
    "summary": "An apply function for Python 2 and 3",
    "version": "1.7",
    "project_urls": {
        "Documentation": "https://apply.readthedocs.io/en/stable/",
        "Homepage": "https://github.com/stefanholek/apply"
    },
    "split_keywords": [
        "apply",
        "read",
        "write",
        "property",
        "properties"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4fdd0f381b9b70421861d57fa41602ea2ca3d21a2c38d3a8071d78dcdec1a73",
                "md5": "b274f87134d2f98759d8fe0ea70d108b",
                "sha256": "ad8917b5e1a0b8ae12dbcd8a34f3e0c4ebecf9fb1e13b5a8fd4190d6a4a02bf3"
            },
            "downloads": -1,
            "filename": "apply-1.7-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b274f87134d2f98759d8fe0ea70d108b",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7",
            "size": 3705,
            "upload_time": "2023-09-14T13:35:02",
            "upload_time_iso_8601": "2023-09-14T13:35:02.743335Z",
            "url": "https://files.pythonhosted.org/packages/d4/fd/d0f381b9b70421861d57fa41602ea2ca3d21a2c38d3a8071d78dcdec1a73/apply-1.7-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7416039da9c28eed267b3cfe451dab87dce538a7d8abf68e5e8e565968e1f049",
                "md5": "8b01ca12017449b8f475b64cd907714a",
                "sha256": "91fdcdc7bb8a0b976ac55bac4372d93c82911e695858731fece05b9dbfe63833"
            },
            "downloads": -1,
            "filename": "apply-1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "8b01ca12017449b8f475b64cd907714a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7",
            "size": 4493,
            "upload_time": "2023-09-14T13:35:04",
            "upload_time_iso_8601": "2023-09-14T13:35:04.395098Z",
            "url": "https://files.pythonhosted.org/packages/74/16/039da9c28eed267b3cfe451dab87dce538a7d8abf68e5e8e565968e1f049/apply-1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-14 13:35:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stefanholek",
    "github_project": "apply",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "apply"
}
        
Elapsed time: 1.53321s