gatelogue_types.GD

class gatelogue_types.GD(database: str | bytes | PathLike[str] | PathLike[bytes] = ':memory:')

Bases: object

Main class that contains an sqlite3.Connection

__init__(database: str | bytes | PathLike[str] | PathLike[bytes] = ':memory:')

Methods

__init__([database])

create(sources[, database, has_sources])

Internal Use

drop_sources([cur])

Drop all *Source tables

from_bytes(data)

from_bytes_readonly(data)

get(*[, sources, getter])

get_async(*[, sources, getter])

get_node(i[, ty])

Get a single node

nodes([ty])

Get all nodes, optionally of a specific type.

Attributes

has_sources

Whether the database has sources

timestamp

Time that the aggregation of the data was done

version

Version number of the database format

conn

Connection to the underlying SQL database

class Getters

Bases: object

async static aiohttp(url: str) bytes
static httpx(url: str) bytes
static niquests(url: str) bytes
static requests(url: str) bytes
async static rnet(url: str) bytes
static urllib(url: str) bytes
static urllib3(url: str) bytes
conn: Connection

Connection to the underlying SQL database

classmethod create(sources: list[str], database=':memory:', *, has_sources: bool = True) Self

Internal Use

drop_sources(cur: Cursor | None = None)

Drop all *Source tables

classmethod from_bytes(data: bytes) Self
classmethod from_bytes_readonly(data: bytes) Self
classmethod get(*, sources: bool = False, getter: Callable[[str], bytes] | None = None)
async classmethod get_async(*, sources: bool = False, getter: Callable[[str], Awaitable[bytes]] | None = None)
get_node(i: int, ty: type[T] | None = None) T

Get a single node

If ty is None, LocatedNode or Node, find the node type automatically. Set ty to a specific node type only if you can guarantee that the node of ID i is of said node type.

property has_sources: bool

Whether the database has sources

nodes(ty: type[T] | None = None) Iterator[T]

Get all nodes, optionally of a specific type.

property timestamp: str

Time that the aggregation of the data was done

property version: int

Version number of the database format