# methodtools

> Expand standard functools to methods

- **URL**: https://www.freshcrate.ai/projects/methodtools
- **Author**: Jeong YunWon
- **Category**: Developer Tools
- **Latest version**: `0.4.7` (2026-04-21)
- **License**: BSD 2-Clause License
- **Source**: https://github.com/youknowone/methodtools
- **Language**: Python
- **GitHub**: 86 stars, 11 forks
- **Registry**: pypi (`methodtools`)
- **Tags**: `functools`, `lru_cache`, `method`, `pypi`, `ring`

## Description

methodtools
===========

Expand functools features to methods, classmethods, staticmethods and even for
(unofficial) hybrid methods.

For now, methodtools only provides `methodtools.lru_cache`.

Use `methodtools` module instead of `functools` module. Than it will work as
you expected.

.. code:: python

    from methodtools import lru_cache

    class A(object):

        # cached method. the storage lifetime follows `self` object
        @lru_cache()
        def cached_method(self, args):
            ...

        # cached classmethod. the storage lifetime follows `A` class
        @lru_cache()  # the order is important!
        @classmethod  # always lru_cache on top of classmethod
        def cached_classmethod(self, args):
            ...

        # cached staticmethod. the storage lifetime follows `A` class
        @lru_cache()  # the order is important!
        @staticmethod  # always lru_cache on top of staticmethod
        def cached_staticmethod(self, args):
            ...

    @lru_cache()  # just same as functools.lru_cache
    def cached_function():
        ...


Installation
------------

PyPI is the recommended way.

.. sourcecode:: shell

    $ pip install methodtools

To browse versions and tarballs, visit:
    `<https://pypi.python.org/pypi/methodtools/>`_

.. note::
    If you are working on Python 2, install also `functools32`.


See also
--------

- [Documentation](https://methodtools.readthedocs.io/en/latest/)
- This project is derived from `Ring <https://github.com/youknowone/ring/>`_,
  a rich cache interface using the same method handling technique.
- To learn more about bound method dispatching, see also
  [wirerope](https://github.com/youknowone/wirerope).

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `0.4.7` | 2026-04-21 | Low | Imported from PyPI (0.4.7) |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |
| `main@2024-08-23` | 2024-08-23 | Low | Latest activity on main branch |

## Citation

- HTML: https://www.freshcrate.ai/projects/methodtools
- Markdown: https://www.freshcrate.ai/projects/methodtools.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/methodtools/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
