skillfed

cobble

Create data objects

cobble v0.1.4 15.6M downloads/30d#1,178 on PyPI6
Permissive license DORMANT released

What it is and what it does

Cobble is a decorator-based library for defining data classes with minimal boilerplate. It provides the `@cobble.data` decorator to automatically generate `__eq__`, `__repr__`, and other common methods for classes, along with a `cobble.field()` mechanism for declaring attributes with optional defaults. The library also includes a visitor pattern implementation via `@cobble.visitor` and `@cobble.visitable` decorators, allowing you to traverse and process hierarchies of related objects—useful for building interpreters, AST walkers, or other tree-based algorithms.

The package has no runtime dependencies and supports Python 3.5 through 3.12. It occupies a niche between manual class definition and more comprehensive solutions like the standard library's dataclasses module or third-party libraries like attrs. The dormant maintenance status (last release in June 2024, repository unarchived) suggests the library is stable but not actively developed.

Use it for:

  • Define immutable or semi-immutable data structures with automatic equality and string representation without writing boilerplate methods.
  • Build expression trees or abstract syntax trees where you need to traverse nodes using the visitor pattern.
  • Create domain objects in a domain-driven design context where you want minimal ceremony and automatic serialization-friendly representations.
  • Implement interpreters or evaluators that walk object hierarchies using the visitor pattern to dispatch behavior.
  • Prototype data models quickly without committing to a heavier framework or dataclass library.

Worth the install?

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

Cobble is a Python library for creating data classes with automatic implementations of common methods like `__eq__` and `__repr__`, and for building visitor patterns over object hierarchies.

Yes, if you need a lightweight visitor pattern implementation or prefer decorator-based data class generation over Python 3.7+ dataclasses. The zero-dependency install and broad Python version support make it low-risk. However, if you are on Python 3.7+ and do not need the visitor pattern, the standard library's dataclasses module or attrs may be more actively maintained alternatives. The dormant maintenance status is not a blocker for stable code, but verify that the feature set meets your needs before adopting.

Install

cobble on PyPI

pip

pip install cobble

uv

uv add cobble

poetry

poetry add cobble

Installing cobble

Before you install

Installation is frictionless with no runtime dependencies. The package is dormant (last release 2024-06-01, 804 days ago) but the repository remains active and unarchived, suggesting stable maintenance rather than abandonment.

License in practice

Cobble is licensed under the 2-Clause BSD license, a permissive open-source license that allows commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.

Quickstart

pip install cobble

import cobble

@cobble.data
class Song(object):
    name = cobble.field()
    artist = cobble.field()
    album = cobble.field(default=None)

song = Song("MFEO", artist="Jack's Mannequin")
print(song)

Verify before relying

  • Whether cobble's visitor pattern implementation offers advantages over Python's built-in approaches or other visitor libraries
  • Performance characteristics compared to dataclasses (standard library in Python 3.7+) or attrs
  • Active maintenance status given dormancy classification despite recent repository activity

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.5)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 804 days since the last release
Last repo commit
First released
Downloads 15,618,177/month — #1,178 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cobble-0.1.4-py3-none-any.whl

Keywords: data, object, case, class

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

python data class generatorautomatic __repr__ __eq__ implementationvisitor pattern librarydata object creationpython dataclass alternativeclass decorator for data objectsobject hierarchy traversal
data-class-decoratorvisitor-patterncode-generation

More Software Development packages