Skip to main content

Classify

PyPI Version GitHub Actions Workflow Status Python Versions

See everything a Python class inherits, and the code behind it.

Classify walks a class's MRO, gathers every member it inherits (methods, attributes, properties, etc.), and displays the class as though it had been written in one place, source code included.

It outputs to the terminal or HTML, or you can use it as a library and do what you want with the results.

If you've used CCBV, but wanted it for any Python class, then classify is here to help.

Installation

Classify imports the classes you point it at, so it has to live alongside the code you want to look at. Install it as a development dependency of the project you're inspecting, in the same virtual environment.

Beyond that it's an ordinary Python package, so however you usually install one will do, eg:

pip install classify

or

uv add --dev classify

Examples

Simple class hierarchy

Take this example:

class Greeter:
    def greet(self):
        return f"Hello, {self.name}"


class Person(Greeter):
    def __init__(self, name):
        self.name = name

    def greet(self):
        return f"Croeso, {self.name}"

pass it to classify via its dotted path:

classify dotted.path.to.Person

and it shows you everything Person has defined on it.

Overridden methods are included, earliest in the inheritance tree first, with a comment to say which class they were defined on.

class Person(Greeter):

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

    # Defined on: Greeter
    def greet(self):
        return f"Hello, {self.name}"

    def greet(self):
        return f"Croeso, {self.name}"

Curious how it works with a larger class? Try it out with the standard library's http.server.SimpleHTTPRequestHandler, which has 3 parent classes in its inheritance tree:

classify http.server.SimpleHTTPRequestHandler

Django

Django classes (models, forms, etc.) work too, as long as you give classify a settings module to bootstrap Django with.

Take a model:

from django.db import models


class Article(models.Model):
    title = models.CharField(max_length=200)
    slug = models.SlugField(unique=True)
    published = models.DateTimeField(null=True)

    class Meta:
        app_label = "docs"

    def __str__(self):
        return self.title

and pass its dotted path along with --django-settings:

classify docs.models.Article --django-settings docs.settings

Fields are rendered as the source that declared them, using the same serialiser Django writes migrations with:

class Article(Model):
    """
    Article(id, title, slug, published)
    """
    id = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')
    objects = docs.Article.objects
    published = models.DateTimeField(null=True)
    slug = models.SlugField(unique=True)
    title = models.CharField(max_length=200)

    # ... 779 more lines

Django is only imported when you pass --django-settings, so it doesn't need to be installed otherwise.

Usage

Usage: classify [OPTIONS] KLASS

  See everything a Python class inherits, and the code behind it.

Options:
  --console-theme TEXT            Theme to render console output with, any
                                  Pygments style works here  [default:
                                  monokai]
  --debug                         Show debug logs
  --django-settings TEXT          Pass a dotted path to your Django settings
                                  when using with a Django project.
                                  classify.contrib.django.settings exists if
                                  you need it.
  --renderer [console|html|pager]
                                  How would you like your content rendered?
                                  [default: console]
  -o, --output DIRECTORY          Path for output files to be saved
  -p, --port INTEGER              The port to serve content at, requires
                                  --serve  [default: 8000]
  -s, --serve                     Serve HTML content, requires --renderer=html
  --version                       Show the version and exit.
  --help                          Show this message and exit.

--console-theme takes the name of any style Pygments ships with; they're listed at https://pygments.org/styles/.

Metadata

Release files for classify 2026.10.2

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

Source distribution (sdist)

Source distribution for classify 2026.10.2
File Size Uploaded Provenance
classify-2026.10.2.tar.gz 16.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for classify 2026.10.2
File Interpreter ABI Platform
classify-2026.10.2-py3-none-any.whl Python 3 none any Details

Total release size: 36.2 kB

Release files / classify-2026.10.2.tar.gz

Download URL classify-2026.10.2.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5e27cb394b6a66b29d3274550fb40b81e683c0b27a6fba590d18107a4df6eb2b
BLAKE2b-256 checksum
How to use checksums
dd6b7fc031b4f083a3ac931c77825321e15ebc14ca57451175545c17f0a799d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / classify-2026.10.2-py3-none-any.whl

Download URL classify-2026.10.2-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b84ff32bf78c61a6e1eabefcd472056d9f6792800964b2c654c1115301bfabc6
BLAKE2b-256 checksum
How to use checksums
41dce67bfe51e96a465636a6543af38957d0f1c2a291be94a10ad023a0145d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for classify 2026.10.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for classify-2026.10.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

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.

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