skillfed

dataclasses

A backport of the dataclasses module for Python 3.6

dataclasses v0.8 9.7M downloads/30d#1,507 on PyPI593
Permissive license Apache DORMANT released

What it is and what it does

This package is a backport of the dataclasses module from PEP 557 to Python 3.6. It allows you to define classes using the `@dataclass` decorator, which automatically generates common methods like `__init__`, `__repr__`, `__eq__`, and others based on type-annotated class attributes. This eliminates boilerplate code for simple data-holding classes.

The package is now historical: Python 3.7 and later include dataclasses in the standard library, so this backport is only needed if you are stuck on Python 3.6. The repository is no longer maintained, and the package has received no updates since 2020. If you are on Python 3.7 or later, use the built-in module instead.

Use it for:

  • Define simple data classes on Python 3.6 without writing verbose `__init__` and `__repr__` methods.
  • Migrate legacy Python 3.6 codebases to use dataclass syntax before upgrading to Python 3.7+.
  • Prototype or maintain applications that must run on Python 3.6 and need structured data types.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides the PEP 557 dataclasses module for Python 3.6, enabling decorator-based class definitions with automatic generation of `__init__`, `__repr__`, and other standard methods.

Only if you are actively running Python 3.6 and need dataclass syntax. For any Python 3.7 or later, use the built-in dataclasses module instead. The package is stable and has no known vulnerabilities, but it is unmaintained and serves a shrinking audience. Do not install it for new projects targeting modern Python versions.

Install

dataclasses on PyPI

pip

pip install dataclasses

uv

uv add dataclasses

poetry

poetry add dataclasses

Installing dataclasses

Before you install

Low install friction with no runtime dependencies. Dormant maintenance since 2020-11-13 (over 2100 days); the repo is not archived but receives no active development. This is expected—the package exists solely to backport a feature that became standard in Python 3.7.

License in practice

Apache License (permissive). No restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install dataclasses

from dataclasses import dataclass

@dataclass
class InventoryItem:
    name: str
    unit_price: float
    quantity_on_hand: int = 0

item = InventoryItem('hammers', 10.49, 12)

Requires Python 3.6 exactly (>=3.6, <3.7); not compatible with Python 3.7 or later, which have dataclasses built-in.

Verify before relying

  • Whether dict insertion-order guarantee holds reliably across all Python 3.6 implementations beyond CPython.

Package facts

License Apache (permissive)
Python support capped below the current Python release (>=3.6, <3.7)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 2,100 days since the last release
Last repo commit
First released
Downloads 9,670,338/month — #1,507 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dataclasses-0.8-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.6Topic :: Software Development :: Libraries :: Python Modules

Tags

python 3.6 dataclasses backportpep 557 implementationdataclass decoratorautomatic __init__ generationtyped class definitions
backportpython-3.6

More Python Modules packages