pandas_dataclasses.core.specs module#

class Spec(name: str | None = None, origin: type | None = None, factory: Callable[[...], DataFrame | Series[Any]] | None = None, fields: Fields = ())[source]#

Bases: object

Specification of pandas data creation.

Parameters:
  • name (str | None)

  • origin (type | None)

  • factory (Callable[[...], DataFrame | Series[Any]] | None)

  • fields (Fields)

name: str | None = None#

Name of the specification.

origin: type | None = None#

Original dataclass of the specification.

factory: Callable[[...], DataFrame | Series[Any]] | None = None#

Factory for pandas data creation.

fields: Fields = ()#

List of field specifications.

classmethod from_dataclass(dataclass: type) Self[source]#

Create a specification from a data class.

Parameters:

dataclass (type)

Return type:

Self

update(obj: Any) Self[source]#

Update the specification by an object.

Parameters:

obj (Any)

Return type:

Self