Metadata-Version: 2.1
Name: apply
Version: 1.7
Summary: An apply function for Python 2 and 3
Home-page: https://github.com/stefanholek/apply
Author: Stefan H. Holek
Author-email: stefan@epy.co.at
License: BSD-2-Clause
Project-URL: Documentation, https://apply.readthedocs.io/en/stable/
Keywords: apply,read,write,property,properties
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: docs
Requires-Dist: sphinx ==5.3.0 ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme ==1.0.0 ; extra == 'docs'

=====
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]
