centraldogma.data package

Submodules

centraldogma.data.change module

class centraldogma.data.change.Change(path: str, type: ChangeType, content: Any | None = None)

Bases: object

content: Any | None = None
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
path: str
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
type: ChangeType
class centraldogma.data.change.ChangeType(value)

Bases: Enum

An enumeration.

APPLY_JSON_PATCH = 'APPLY_JSON_PATCH'
APPLY_TEXT_PATCH = 'APPLY_TEXT_PATCH'
REMOVE = 'REMOVE'
RENAME = 'RENAME'
UPSERT_JSON = 'UPSERT_JSON'
UPSERT_TEXT = 'UPSERT_TEXT'

centraldogma.data.commit module

class centraldogma.data.commit.Commit(summary: str, detail: str | None = None, markup: str | None = None)

Bases: object

detail: str | None = None
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
markup: str | None = None
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
summary: str
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str

centraldogma.data.content module

class centraldogma.data.content.Content(path: str, type: str, url: str, revision: int, content: Any | None = None)

Bases: object

content: Any | None = None
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
path: str
revision: int
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
type: str
url: str

centraldogma.data.creator module

class centraldogma.data.creator.Creator(name: str, email: str)

Bases: object

email: str
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
name: str
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str

centraldogma.data.entry module

class centraldogma.data.entry.Entry(revision: Revision, path: str, entry_type: EntryType, content: T)

Bases: Generic[T]

A file or a directory in a repository.

property content: T

Returns the content.

Raises:

EntryNoContentException – it occurs if the content is None

content_as_text() str

Returns the textual representation of the specified content.

Raises:

EntryNoContentException – it occurs if the content is None

static directory(revision: Revision, path: str) Entry[None]

Returns a newly-created Entry of a directory.

Parameters:
  • revision – the revision of the directory

  • path – the path of the directory

has_content() bool

Returns if this Entry has content, which is always True if it’s not a directory.

static json(revision: Revision, path: str, content: Any) Entry[Any]

Returns a newly-created Entry of a JSON file.

Parameters:
  • revision – the revision of the JSON file

  • path – the path of the JSON file

  • content – the content of the JSON file

static text(revision: Revision, path: str, content: str) Entry[str]

Returns a newly-created Entry of a text file.

Parameters:
  • revision – the revision of the text file

  • path – the path of the text file

  • content – the content of the text file

class centraldogma.data.entry.EntryType(value)

Bases: Enum

An enumeration.

DIRECTORY = 'DIRECTORY'
JSON = 'JSON'
TEXT = 'TEXT'

centraldogma.data.merge_source module

class centraldogma.data.merge_source.MergeSource(path: str, optional: bool = True)

Bases: object

optional: bool = True
path: str

centraldogma.data.merged_entry module

class centraldogma.data.merged_entry.MergedEntry(revision: Revision, paths: List[str], entry_type: EntryType, content: dict | list | str | int | float | bool | None)

Bases: object

property content: str | dict

Returns the content.

Raises:

EntryNoContentException – it occurs if the content is None

static from_dict(json: dict | list | str | int | float | bool | None)

centraldogma.data.project module

class centraldogma.data.project.Project(name: str, creator: Creator | None = None, created_at: datetime | None = None, url: str | None = None)

Bases: object

created_at: datetime | None = None
creator: Creator | None = None
dataclass_json_config = {'letter_case': <function camelcase>}
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
name: str
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
url: str | None = None

centraldogma.data.push_result module

class centraldogma.data.push_result.PushResult(revision: int, pushed_at: datetime)

Bases: object

dataclass_json_config = {'letter_case': <function camelcase>}
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
pushed_at: datetime
revision: int
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str

centraldogma.data.repository module

class centraldogma.data.repository.Repository(name: str, creator: Creator | None = None, created_at: datetime | None = None, head_revision: int | None = -1, url: str | None = None)

Bases: object

created_at: datetime | None = None
creator: Creator | None = None
dataclass_json_config = {'letter_case': <function camelcase>}
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
head_revision: int | None = -1
name: str
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
url: str | None = None

centraldogma.data.revision module

class centraldogma.data.revision.Revision(major: int)

Bases: object

A revision number of a Commit.

static head() Revision

Revision -1, also known as ‘HEAD’.

static init() Revision

Revision 1, also known as ‘INIT’.

major: int