Skip to main content

.. image:: https://travis-ci.org/MacHu-GWU/inspect_mate-project.svg?branch=master :target: https://travis-ci.org/MacHu-GWU/inspect_mate-project?branch=master

.. image:: https://codecov.io/gh/MacHu-GWU/inspect_mate-project/branch/master/graph/badge.svg :target: https://codecov.io/gh/MacHu-GWU/inspect_mate-project

.. image:: https://img.shields.io/pypi/v/inspect_mate.svg :target: https://pypi.python.org/pypi/inspect_mate

.. image:: https://img.shields.io/pypi/l/inspect_mate.svg :target: https://pypi.python.org/pypi/inspect_mate

.. image:: https://img.shields.io/pypi/pyversions/inspect_mate.svg :target: https://pypi.python.org/pypi/inspect_mate

.. image:: https://img.shields.io/badge/Star_Me_on_GitHub!--None.svg?style=social :target: https://github.com/MacHu-GWU/inspect_mate-project

Forked from https://github.com/MacHu-GWU/inspect_mate-project to keep up to date with Python versions

Welcome to inspect_mate Documentation

inspect_mate can easily separate:

  1. regular attribute.
  2. property attribute.
  3. regular method.
  4. static method.
  5. class method.
  6. all attributes, include regular attribute and property attribute.
  7. all methods, include regular method, static method and class method.

Quick Links

Example

import:

.. code-block:: python

from inspect_mate import (
    is_attribute,
    is_property_method,
    is_regular_method,
    is_static_method,
    is_class_method,
    get_attributes,
    get_property_methods,
    get_regular_methods,
    get_static_methods,
    get_class_methods,
    get_all_attributes,
    get_all_methods,
)

define a class:

.. code-block:: python

class Base(object):
    attribute = "attribute"

    def __init__(self):
        self.initiated_attribute = "initiated_attribute"

    @property
    def property_method(self):
        return "property_method"

    def regular_method(self):
        return "regular_method"

    @staticmethod
    def static_method():
        return "static_method"

    @classmethod
    def class_method(cls):
        return "class_method"


class Klass(Base):
    pass


instance = Klass()

usage:

.. code-block:: python

# tester_function(klass_or_instance, "attribute_name")
>>> is_attribute(Klass, "attribute")
True
>>> is_property_method(Klass, "property_attribute")
True
>>> is_regular_method(Klass, "regular_method")
True
>>> is_static_method(Klass, "static_method")
True
>>> is_class_method(Klass, "class_method")
True

>>> is_attribute(instance, "attribute")
True
>>> is_attribute(instance, "initiated_attribute")
True
>>> is_property_method(instance, "property_attribute")
True
>>> is_regular_method(instance, "regular_method")
True
>>> is_static_method(instance, "static_method")
True
>>> is_class_method(instance, "class_method")
True

# getter_function(klass_or_instance), yield (attr, value)
>>> get_attributes(Klass)
[("attribute", "attribute")]

>>> get_property_methods(Klass)
[("property_attribute", "property_attribute")]

>>> get_regular_methods(Klass)
[("regular_method", Klass.regular_method)]

>>> get_static_methods(Klass)
[("static_method", "Klass.static_method")]

>>> get_class_methods(Klass)
[("class_method", "Klass.class_method")]

>>> get_all_attributes(Klass)
[("attribute", "attribute"), ("property_attribute", "property_attribute")]

>>> get_all_methods(Klass)
[("regular_method", Klass.regular_method), ("static_method", "Klass.static_method"), ("class_method", "Klass.class_method")]

.. _install:

Install

inspect_mate is released on PyPI, so all you need is:

.. code-block:: console

$ pip install inspect_mate

To upgrade to latest version:

.. code-block:: console

$ pip install --upgrade inspect_mate

Metadata

Release files for inspect-mate-pp 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inspect-mate-pp 0.0.4
File Size Uploaded Provenance
inspect_mate_pp-0.0.4.tar.gz 4.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for inspect-mate-pp 0.0.4
File Interpreter ABI Platform
inspect_mate_pp-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / inspect_mate_pp-0.0.4.tar.gz

Download URL inspect_mate_pp-0.0.4.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6eee156a1300c61ccfdc1be080516ce6387fde2e361c3643e57c940588a3b4e0
BLAKE2b-256 checksum
How to use checksums
4806d32e49b42df638ceaeb9d6c266c666d75937dbf593703e63d58351ce67f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / inspect_mate_pp-0.0.4-py3-none-any.whl

Download URL inspect_mate_pp-0.0.4-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f11d294c33334aae85d95dbb87aed53a968f50d76cc692e449c994da120cf9b
BLAKE2b-256 checksum
How to use checksums
ee07cace1653467e8c6164837c006db18adbb88ff57ab9d9891f57073962bb2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for inspect-mate-pp 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page