dataclasses
A backport of the dataclasses module for Python 3.6
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 dataclassesuv
uv add dataclassespoetry
poetry add dataclassesInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
djangorestframework-dataclassesAutomatically generates Django REST Framework…
permissive · top 5,000 on PyPI
daciteConverts dictionaries into dataclass instances…
permissive · top 1,000 on PyPI
typed-json-dataclassAdds JSON serialization and type validation to…
permissive · top 15,000 on PyPI
argparse-dataclassBuilds command-line interfaces declaratively by…
permissive · top 5,000 on PyPI
dataclasses-jsonschemaGenerates JSON Schema from Python dataclasses…
permissive · top 15,000 on PyPI
dataclass-csvReads and writes CSV files using Python…
permissive · top 15,000 on PyPI
datafilesDatafiles is a file-based ORM that…
permissive · top 15,000 on PyPI
dataclasses-jsonConverts Python dataclasses to and from JSON…
permissive · top 1,000 on PyPI
dataclass-wizardDataclass Wizard converts Python dataclasses to…
permissive · top 5,000 on PyPI
types-dataclassesProvides type stubs for Python's dataclasses…
permissive · top 15,000 on PyPI