morb_fetch.examples package

class morb_fetch.examples.Database(config=None)

Bases: object

A class to represent the examples database. It loads the examples from a CSV file and provides a method to fetch a specific example by name and identifier.

Parameters:

config (Settings | None)

list_ids()

List all example identifiers.

Returns:

The list of example identifiers.

Return type:

list[str]

lookup(id)

Lookup an example by its identifier.

Parameters:

id (str) – The identifier of the example.

Returns:

The example data.

Return type:

dict

class morb_fetch.examples.Example(meta, database=None)

Bases: object

A class to represent an example. It contains the metadata and the data associated with the example.

Parameters:
retrieve()

Retrieve the data associated with the example either from the local cache or from the server.

Returns:

None

morb_fetch.examples.get_database()

Get the global database instance.

Returns:

The global database instance.

Return type:

Database

Submodules

morb_fetch.examples.database module

class morb_fetch.examples.database.Database(config=None)

Bases: object

A class to represent the examples database. It loads the examples from a CSV file and provides a method to fetch a specific example by name and identifier.

Parameters:

config (Settings | None)

list_ids()

List all example identifiers.

Returns:

The list of example identifiers.

Return type:

list[str]

lookup(id)

Lookup an example by its identifier.

Parameters:

id (str) – The identifier of the example.

Returns:

The example data.

Return type:

dict

morb_fetch.examples.database.get_database()

Get the global database instance.

Returns:

The global database instance.

Return type:

Database

morb_fetch.examples.example module

class morb_fetch.examples.example.Example(meta, database=None)

Bases: object

A class to represent an example. It contains the metadata and the data associated with the example.

Parameters:
retrieve()

Retrieve the data associated with the example either from the local cache or from the server.

Returns:

None