Skip to main content

Represent

PyPI Version Documentation CI Status Coverage Python Version MIT License

Installation

$ pip install represent

Automatic Generation

from represent import autorepr


@autorepr
class Rectangle:
    def __init__(self, name, color, width, height):
        self.name = name
        self.color = color
        self.width = width
        self.height = height

rect = Rectangle('Timothy', 'red', 15, 4.5)
print(rect)
Rectangle(name='Timothy', color='red', width=15, height=4.5)

Declarative Generation

from represent import ReprHelperMixin


class ContrivedExample(ReprHelperMixin, object):
    def __init__(self, description, radians, shape, color, miles):
        self.description = description
        self.degrees = radians * 180 / 3.141592654
        self.shape = shape
        self._color = color
        self.km = 1.60934 * miles

    def _repr_helper_(self, r):
        r.positional_from_attr('description')
        r.positional_with_value(self.degrees * 3.141592654 / 180)
        r.keyword_from_attr('shape')
        r.keyword_from_attr('color', '_color')
        r.keyword_with_value('miles', self.km / 1.60934)

ce = ContrivedExample('does something', 0.345, 'square', 'red', 22)

print(ce)
from IPython.lib.pretty import pprint
pprint(ce)
ContrivedExample('does something', 0.345, shape='square', color='red', miles=22.0)
ContrivedExample('does something',
                 0.345,
                 shape='square',
                 color='red',
                 miles=22.0)

Release files for Represent 2.2.0

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

Source distribution (sdist)

Source distribution for Represent 2.2.0
File Size Uploaded
represent-2.2.0.tar.gz 71.3 kB Details

Built distribution (wheel)

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

Total release size: 80.1 kB

Release files / represent-2.2.0.tar.gz

Download URL represent-2.2.0.tar.gz
Size 71.3 kB
Tags Source
SHA-256 checksum
How to use checksums
403daa7f8360390b84b143b7bf1dd720965a3e93a234994923c7123cc55d5fe1
BLAKE2b-256 checksum
How to use checksums
51f0965dfb05568ec7d56cd37b8fc75eb35ed159c0e9a80309019155511046ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 20, 2026.

Transparency log

Release files / represent-2.2.0-py3-none-any.whl

Download URL represent-2.2.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
317db78ccb92cdbd5cd836652b34812385a12610f825d9d950874d2a39fd0f02
BLAKE2b-256 checksum
How to use checksums
835a373677ed4e15b094365c68f6f0e825f972d6b0e2976312b47ac794fcbb34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1

2 release files

2.0

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

1.0.0.dev0

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