GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing iris.gecode.dev — Python API reference Python API referenceThe public API of the Read text instance files with Iris reader specs. Parse a reader spec with The package also installs the CallSite
class
CallSite
CallSite(filename: str, line: int, function: str)
A place in the host program: where a builder statement was called.
CallSite.filenamefilename: str
The file of the calling code, as its code object names it. CallSite.lineline: int
The line of the call, counting from 1. CallSite.functionfunction: str
The name of the calling function, such as Data
class
Data:
The data from one read or catalog.
A handle from Data.intsThe integer row of an entry at a path. Data.array
def
array( self, key: str | gecode_iris.build.Field[Any], /, *path: int) -> numpy.typing.NDArray[Any] | list[Value]:
An array of an entry, or of its row at a path. The result is a Data.to_dictAll entries as a Data.to_json
def
to_json(self) -> str:
The canonical JSON document, ending in a newline. Data.to_dzn
def
to_dzn(self) -> str:
The MiniZinc data text defined in the Specification's appendix B. Data.entriesentries: tuple[Entry, ...]
The entries in the order their names were defined. Entry
class
Entry
Entry(name: str, value_type: Literal['int', 'float', 'string'], depth: int)
The name, value type and depth of one entry in Entry.namename: str
The entry name. Entry.value_typevalue_type: Literal['int', 'float', 'string']
The type of the entry's scalars. Entry.depthdepth: int
The number of array levels: 0 for a scalar, 1 for a row, and so on. Error
class
Error
Error( text: str, code: str, message: str, line: int | None, column: int | None, path: tuple[int, ...] | None, origin: str | None, document: str, call_site: CallSite | None = None)
A language error from parsing a reader spec or reading an input.
Host failures, such as a missing file, raise built-in exceptions instead and have no error code. Error.codecode: str
The stable error code, such as Error.messagemessage: str
The message, without location or excerpt. Error.lineline: int | None
The line of the location, counting from 1. Error.columncolumn: int | None
The byte column of the location, counting from 1. Error.pathpath: tuple[int, ...] | None
The record path of a failed check over records. Error.originorigin: str | None
The input or reader spec origin of the location, such as its path. Error.call_sitecall_site: CallSite | None
Where the statement the error belongs to was called, for a spec built
with Error.to_json
def
to_json(self) -> str:
Return the canonical JSON error document. Spec
class
Spec:
A parsed and checked reader spec. One Spec.parseParse and check a reader spec given as Spec.loadRead and parse a reader spec file; the path is the error origin. Spec.read
def
read( self, source: bytes | bytearray | str | os.PathLike[str], params: Mapping[str, str] | None = None, *, origin: str | None = None) -> Data:
Read one instance from input bytes or from a path. Spec.catalog
def
catalog( self, source: bytes | bytearray | str | os.PathLike[str], params: Mapping[str, str] | None = None, *, origin: str | None = None) -> Data:
List the instances in the input, with the same arguments as ValueValue =
int | float | str | list['Value']
An entry value: The iris commandThe
def
main() -> None:
Run |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |