database explorer

class dballe.Explorer

Browser for a summary of DB-All-e database of message contents.

Use rebuild() or update() to populate the explorer.

If a file name is passed to the constructor, the Explorer automatically loads contents from the file (if it exists), and saves them to the file on update.

The persistence file is in JSON format if the file name ends with .json or if no Xapian support is compiled in. Otherwise, the Explorer will persist using an indexed Xapian database.

# Populate an explorer with the contents of a database
explorer = dballe.Explorer()
with explorer.rebuild() as update:
    with db.transaction() as tr:
        update.add_db(tr)
all_levels

get all level values

all_reports

get all report values

all_stations

get all stations

all_stats

get the stats for all values

all_tranges

get all time range values

all_varcodes

get all varcode values

levels

get all the level values currently selected

query_summary() → dballe.CursorSummarySummary

Get the currently selected Explorer summary information

Returns

a cursor to iterate the query results (see dballe.CursorSummarySummary)

Adding query=details will be ignored for Explorers and considered always present, as details are always provided in results.

query_summary_all() → dballe.CursorSummarySummary

Get all the Explorer summary information.

Returns

a cursor to iterate the query results (see dballe.CursorSummarySummary)

Adding query=details will be ignored for Explorers and considered always present, as details are always provided in results.

rebuild()

Empty the Explorer and start adding new data to it.

Returns an ExplorerUpdate context manager object that can be used to add data to the explorer in a single transaction.

reports

get all the report values currently selected

set_filter()

Set a new filter, updating all browsing data

stations

get all the stations currently selected

stats

get stats for the currently selected values

to_json()

Serialize the contents of this explorer to JSON.

Only the global summary is serialized: the current query is not preserved.

tranges

get all the time range values currently selected

update()

Start adding new data to the Explorer without clearing it first.

Returns an ExplorerUpdate context manager object that can be used to add data to the explorer in a single transaction.

varcodes

get all the varcode values currently selected

class dballe.DBExplorer

Browser for a summary of DB-All-e database of message contents.

Use rebuild() or update() to populate the explorer.

If a file name is passed to the constructor, the Explorer automatically loads contents from the file (if it exists), and saves them to the file on update.

The persistence file is in JSON format if the file name ends with .json or if no Xapian support is compiled in. Otherwise, the Explorer will persist using an indexed Xapian database.

# Populate an explorer with the contents of a database
explorer = dballe.Explorer()
with explorer.rebuild() as update:
    with db.transaction() as tr:
        update.add_db(tr)
all_levels

get all level values

all_reports

get all report values

all_stations

get all stations

all_stats

get the stats for all values

all_tranges

get all time range values

all_varcodes

get all varcode values

levels

get all the level values currently selected

query_summary() → dballe.CursorSummaryDBSummary

Get the currently selected Explorer summary information

Returns

a cursor to iterate the query results (see dballe.CursorSummaryDBSummary)

Adding query=details will be ignored for Explorers and considered always present, as details are always provided in results.

query_summary_all() → dballe.CursorSummaryDBSummary

Get all the Explorer summary information.

Returns

a cursor to iterate the query results (see dballe.CursorSummaryDBSummary)

Adding query=details will be ignored for Explorers and considered always present, as details are always provided in results.

rebuild()

Empty the Explorer and start adding new data to it.

Returns an ExplorerUpdate context manager object that can be used to add data to the explorer in a single transaction.

reports

get all the report values currently selected

set_filter()

Set a new filter, updating all browsing data

stations

get all the stations currently selected

stats

get stats for the currently selected values

to_json()

Serialize the contents of this explorer to JSON.

Only the global summary is serialized: the current query is not preserved.

tranges

get all the time range values currently selected

update()

Start adding new data to the Explorer without clearing it first.

Returns an ExplorerUpdate context manager object that can be used to add data to the explorer in a single transaction.

varcodes

get all the varcode values currently selected

class dballe.ExplorerUpdate

Manage updates to an Explorer

add_db()

Add the summary of the contents of the given database to the Explorer.

add_explorer()

Add the currently selected contents of the given Explorer or DBExplorer to the Explorer.

add_json()

Add the contents of the given JSON string to the Explorer.

add_messages()

Add dballe.Message objects to the explorer.

It takes the same messages argument of dballe.DB.import_messages().

class dballe.DBExplorerUpdate

Manage updates to an Explorer

add_db()

Add the summary of the contents of the given database to the Explorer.

add_explorer()

Add the currently selected contents of the given Explorer or DBExplorer to the Explorer.

add_json()

Add the contents of the given JSON string to the Explorer.

add_messages()

Add dballe.Message objects to the explorer.

It takes the same messages argument of dballe.DB.import_messages().