from __future__ import annotations

from typing import Any, ClassVar, Iterator, overload

class Block:
    name: str
    def __init__(self, arg0: str) -> None: ...
    def add_item(self, item: Item, pos: int = ...) -> Item: ...
    def as_string(self, style: Style = ...) -> str: ...
    @overload
    def find(self, prefix: str, tags: list[str]) -> Table: ...
    @overload
    def find(self, tags: list[str]) -> Table: ...
    def find_frame(self, name: str) -> Block: ...
    def find_loop(self, tag: str) -> Column: ...
    def find_loop_item(self, tag: str) -> Item: ...
    def find_mmcif_category(self, category: str) -> Table: ...
    def find_or_add(self, prefix: str, tags: list[str]) -> Table: ...
    def find_pair(self, tag: str) -> object: ...
    def find_pair_item(self, tag: str) -> Item: ...
    def find_value(self, tag: str) -> str: ...
    def find_values(self, tag: str) -> Column: ...
    def get_index(self, tag: str) -> int: ...
    def get_mmcif_category(self, name: str, raw: bool = ...) -> dict[str, list[str]]: ...
    def get_mmcif_category_names(self) -> list[str]: ...
    def init_loop(self, prefix: str, tags: list[str]) -> Loop: ...
    def init_mmcif_loop(self, cat: str, tags: list[str]) -> Loop: ...
    def item_as_table(self, arg0: Item) -> Table: ...
    def move_item(self, old_pos: int, new_pos: int) -> None: ...
    def set_mmcif_category(self, name: str, data: dict[str, list[str] | tuple[str]], raw: bool = ...) -> None: ...
    def set_pair(self, tag: str, value: str) -> None: ...
    def set_pairs(self, prefix: str, data: dict[str, str | int], raw: bool = ...) -> None: ...
    def write_file(self, filename: str, style: Style = ...) -> None: ...
    def __getitem__(self, index: int) -> Item: ...
    def __iter__(self) -> Iterator[Item]: ...

class Column:
    tag: str
    def __init__(self) -> None: ...
    def get_loop(self) -> Loop: ...
    def str(self, index: int) -> str: ...
    def __bool__(self) -> bool: ...
    def __getitem__(self, arg0: int) -> Item: ...
    def __iter__(self) -> Iterator[Any]: ...
    def __len__(self) -> int: ...
    def __setitem__(self, arg0: int, arg1: Item) -> None: ...

class Document:
    source: str
    def __init__(self) -> None: ...
    def add_copied_block(self, block: Block, pos: int = ...) -> Block: ...
    def add_new_block(self, name: str, pos: int = ...) -> Block: ...
    def as_json(self, mmjson: bool = ..., lowercase_names: bool = ...) -> str: ...
    def as_string(self, style: Style = ...) -> str: ...
    def check_for_duplicates(self) -> None: ...
    def check_for_missing_values(self) -> None: ...
    def clear(self) -> None: ...
    def find_block(self, name: str) -> Block: ...
    def parse_file(self, arg0: str) -> None: ...
    def parse_string(self, arg0: str) -> None: ...
    def sole_block(self) -> Block: ...
    def write_file(self, filename: str, style: Style = ...) -> None: ...
    def __contains__(self, name: str) -> bool: ...
    def __delitem__(self, index: int) -> None: ...
    @overload
    def __getitem__(self, name: str) -> Block: ...
    @overload
    def __getitem__(self, index: int) -> Block: ...
    @overload
    def __getitem__(self, arg0: slice) -> list[Block]: ...
    def __iter__(self) -> Iterator[Block]: ...
    def __len__(self) -> int: ...

class Item:
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    def erase(self) -> None: ...
    @property
    def frame(self) -> Block: ...
    @property
    def line_number(self) -> int: ...
    @property
    def loop(self) -> Loop: ...
    @property
    def pair(self) -> object: ...

class Loop:
    def __init__(self) -> None: ...
    def add_row(self, new_values: list[str], pos: int = ...) -> None: ...
    def length(self) -> int: ...
    def set_all_values(self, columns: list[list[str]]) -> None: ...
    def val(self, row: int, col: int) -> str: ...
    def width(self) -> int: ...
    @property
    def tags(self) -> list[str]: ...
    @property
    def values(self) -> list[str]: ...

class Style:
    __members__: ClassVar[dict[Any, Any]] = ...  # read-only
    Aligned: ClassVar[Style] = ...
    Indent35: ClassVar[Style] = ...
    NoBlankLines: ClassVar[Style] = ...
    Pdbx: ClassVar[Style] = ...
    PreferPairs: ClassVar[Style] = ...
    Simple: ClassVar[Style] = ...
    __entries: ClassVar[dict[Any, Any]] = ...
    def __init__(self, value: int) -> None: ...
    def __eq__(self, other: object) -> bool: ...
    def __getstate__(self) -> int: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    def __setstate__(self, state: int) -> None: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...

class Table:
    class Row:
        def __init__(self, *args: Any, **kwargs: Any) -> None: ...
        def get(self, index: int) -> str: ...
        def has(self, index: int) -> bool: ...
        def str(self, arg0: int) -> str: ...
        def __getitem__(self, arg0: int) -> str: ...
        def __iter__(self) -> Iterator[str]: ...
        def __len__(self) -> int: ...
        def __setitem__(self, arg0: int, arg1: str) -> None: ...
        @property
        def row_index(self) -> int: ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    def append_row(self, new_values: list[str]) -> None: ...
    def column(self, n: int) -> Column: ...
    def erase(self) -> None: ...
    def find_column(self, tag: str) -> Column: ...
    def find_row(self, arg0: str) -> Table.Row: ...
    def get_prefix(self) -> str: ...
    def has_column(self, arg0: int) -> bool: ...
    def move_row(self, old_pos: int, new_pos: int) -> None: ...
    def remove_row(self, row_index: int) -> None: ...
    def width(self) -> int: ...
    def __bool__(self) -> bool: ...
    @overload
    def __delitem__(self, arg0: int) -> None: ...
    @overload
    def __delitem__(self, arg0: slice) -> None: ...
    def __getitem__(self, arg0: int) -> Table.Row: ...
    def __iter__(self) -> Iterator[Any]: ...
    def __len__(self) -> int: ...
    @property
    def loop(self) -> Loop: ...
    @property
    def prefix_length(self) -> int: ...
    @property
    def tags(self) -> Table.Row: ...

@overload
def as_int(value: str) -> int: ...
@overload
def as_int(value: str, default: int) -> int: ...
def as_number(value: str, default: float = ...) -> float: ...
def as_string(value: str) -> str: ...
def is_null(value: str) -> bool: ...
def quote(string: str) -> str: ...
def quote_list(arg0: list[str]) -> list[str]: ...
def read(filename: str) -> Document: ...
def read_file(filename: str) -> Document: ...
def read_mmjson(filename: str) -> Document: ...
def read_string(data: str) -> Document: ...
