# Dataclasses Features

The code generator uses the default `dataclasses` options but you can toggle all of them through the cli flags or a generator config

    <Config xmlns="http://pypi.org/project/xsdata" version="22.1">
      <Output maxLineLength="79">
        <Package>tests.fixtures.stripe.models.balance</Package>
        <Format repr="true" eq="true" order="true" unsafeHash="false" frozen="true" slots="false" kwOnly="false">dataclasses</Format>
        <Structure>single-package</Structure>

Frozen Model

The code generator will use tuples instead of lists as well.

        )
        source_types: Optional[SourceTypes] = field(
            default=None,
            metadata={
                "type": "Element",
                "required": True,
            },
        )

    @dataclass(order=True, frozen=True)
    class Balance:
        class Meta:
            name = "balance"

        object_value: Optional[str] = field(
            default=None,
            metadata={
                "name": "object",
                "type": "Element",
                "required": True,
            },
        )
        available: Tuple[Available, ...] = field(
            default_factory=tuple,
            metadata={
                "type": "Element",
                "min_occurs": 1,
            },
        )
        connect_reserved: Tuple[ConnectReserved, ...] = field(
            default_factory=tuple,
            metadata={
                "type": "Element",
                "min_occurs": 1,

Frozen Bindings

    import pprint
    from tests import fixtures_dir
    from tests.fixtures.stripe.models import Balance
    from xsdata.formats.dataclass.parsers import JsonParser

    xml_path = fixtures_dir.joinpath("stripe/samples/balance.json")
    parser = JsonParser()
    root = parser.from_path(xml_path, Balance)
    print(root.pending[0])
    print(root.pending[1])

    Pending(amount=835408472, currency='usd', source_types=SourceTypes(bank_account=0, card=835408472))
    Pending(amount=-22251, currency='eur', source_types=SourceTypes(bank_account=0, card=-22251))