DirectReport.database package

Submodules

DirectReport.database.blocker_storage module

class DirectReport.database.blocker_storage.BlockerDataStore(db_path, conn=None)[source]

Bases: object

add_blocker_entry(blocker, associated_entry_uuid_str, uuid_str=None)[source]

Adds a new blocker entry to the blockers_uuid_table.

Parameters:
  • blocker – The blocker entry.

  • associated_entry_uuid_str – The associated entry UUID as a string.

  • uuid_str – The UUID of the blocker entry as a string (optional).

Returns:

None

create_table()[source]

Creates the blockers_uuid_table table in the SQLite database if it doesn’t exist.

entries_for_associated_uuid(associated_uuid)[source]

Retrieves a list of blocker entries associated with the specified UUID.

Parameters:

associated_uuid – The UUID to retrieve blocker entries for.

Returns:

A list of blocker entries associated with the UUID.

DirectReport.database.daily_storage module

class DirectReport.database.daily_storage.DailyUUIDTable(db_path, conn=None)[source]

Bases: object

A class to interact with SQLite database for managing daily date-UUID mappings.

add_uuid(date, week_uuid_str, uuid_str=None)[source]

Adds a UUID for the specified date to the SQLite database.

Parameters:
  • date – The date to associate with the UUID.

  • week_uuid_str – The week UUID string.

  • uuid_str – The day UUID string (optional). If not provided, a new UUID will be generated.

create_table()[source]

Creates the day_uuid_table table in the SQLite database if it doesn’t exist.

delete_all_entries()[source]

Deletes all entries from the database.

Returns:

Void

delete_entry_by_date(date)[source]

Deletes the date-UUID mapping associated with the specified date.

Parameters:

date – The date to delete the associated UUID for.

find_uuid_by_date(date)[source]

Finds the UUID associated with the specified date.

Parameters:

date – The date to find the associated UUID for.

Returns:

The UUID string if found, otherwise None.

get_uuid(date)[source]

Retrieves the UUID associated with the specified date.

Parameters:

date – The date to get the associated UUID for.

Returns:

The UUID string if found, otherwise None.

list_all_entries()[source]

Lists all date-UUID mappings from the SQLite database.

Returns:

A list of tuples containing (date, week_uuid, day_uuid).

update_uuid(date, uuid_str)[source]

Updates the UUID associated with the specified date in the SQLite database.

Parameters:
  • date – The date to update the associated UUID for.

  • uuid_str – The new UUID string.

DirectReport.database.entry_storage module

class DirectReport.database.entry_storage.EntryStorage(db_path, conn=None)[source]

Bases: object

A class to interact with SQLite database for storing and retrieving Entry objects.

add_entry(entry)[source]

Adds an Entry object to the SQLite database.

Parameters:

entry – The Entry object to add.

create_table()[source]

Creates the entries table in the SQLite database if it doesn’t exist.

delete_all_entries()[source]

Deletes all entries from the database.

Returns:

None

delete_entry(uuid)[source]

Deletes an Entry object from the SQLite database by its UUID.

Parameters:

uuid – The UUID of the entry to delete.

get_entries_by_week(week_uuid)[source]

Retrieves all entries for a given week.

Parameters:

week_uuid – The UUID of the week for which to retrieve entries.

Returns:

A list of dictionaries containing the entries’ data for the specified week.

get_entry(uuid)[source]

Retrieves an Entry object from the SQLite database by its UUID.

Parameters:

uuid – The UUID of the entry to retrieve.

Returns:

The Entry object if found, otherwise None.

get_uuid(date)[source]

Retrieves the UUID associated with the specified date.

Parameters:

date – The date to get the associated UUID for.

Returns:

The UUID string if found, otherwise None.

list_all_entries()[source]

Lists all date-UUID mappings from the SQLite database.

Returns:

A list of tuples containing (date, week_uuid, day_uuid).

update_entry(entry)[source]

Updates an existing Entry object in the SQLite database.

Parameters:

entry – The Entry object to update.

DirectReport.database.jira_storage module

class DirectReport.database.jira_storage.JiraDataStore(db_path, conn=None)[source]

Bases: object

add_jira_entry(jira_tag, jira_entry, associated_entry_uuid_str, uuid_str=None)[source]

Adds a new Jira entry to the jiras_uuid_table.

Parameters:
  • jira_tag – The Jira tag.

  • jira_entry – The Jira entry.

  • associated_entry_uuid_str – The associated entry UUID as a string.

  • uuid_str – The UUID of the Jira entry as a string (optional).

Returns:

None

create_table()[source]

Creates the jiras_uuid_table table in the SQLite database if it doesn’t exist.

entries_for_associated_uuid(associated_uuid)[source]

Retrieves a list of Jira entries associated with the specified UUID.

Parameters:

associated_uuid – The UUID to retrieve Jira entries for.

Returns:

A list of Jira entries associated with the UUID.

DirectReport.database.note_storage module

class DirectReport.database.note_storage.NoteDataStore(db_path, conn=None)[source]

Bases: object

add_notes_entry(note_entry, associated_entry_uuid_str, uuid_str=None)[source]

Adds a new note entry to the note_uuid_table.

Parameters:
  • note_entry – The note entry.

  • associated_entry_uuid_str – The associated entry UUID as a string.

  • uuid_str – The UUID of the note entry as a string (optional).

Returns:

None

create_table()[source]

Creates the note_uuid_table table in the SQLite database if it doesn’t exist.

entries_for_associated_uuid(associated_uuid)[source]

Retrieves a list of note entries associated with the specified UUID.

Parameters:

associated_uuid – The UUID to retrieve note entries for.

Returns:

A list of note entries associated with the UUID.

DirectReport.database.weekly_storage module

class DirectReport.database.weekly_storage.WeekUUIDTable(db_path, conn=None)[source]

Bases: object

A class to interact with SQLite database for managing date-UUID mappings.

add_uuid(date, uuid_str=None)[source]

Adds a UUID for the specified date to the SQLite database.

Parameters:
  • date – The date to associate with the UUID.

  • uuid_str – The UUID string (optional). If not provided, a new UUID will be generated.

create_table()[source]

Creates the date_uuid_table table in the SQLite database if it doesn’t exist.

delete_all_entries()[source]

Deletes all entries from the database.

Returns:

None

delete_entry_by_date(date)[source]

Deletes the date-UUID mapping associated with the specified date.

Parameters:

date – The date to delete the associated UUID for.

find_uuid_by_date(date)[source]

Finds the UUID associated with the specified date.

Parameters:

date – The date to find the associated UUID for.

Returns:

The UUID string if found, otherwise None.

get_uuid(date)[source]

Retrieves the UUID associated with the specified date.

Parameters:

date – The date to get the associated UUID for.

Returns:

The UUID string if found, otherwise None.

list_all_entries()[source]

Lists all date-UUID mappings from the SQLite database.

Returns:

A list of tuples containing (date, UUID).

update_uuid(date, uuid_str)[source]

Updates the UUID associated with the specified date in the SQLite database.

Parameters:
  • date – The date to update the associated UUID for.

  • uuid_str – The new UUID string.

Module contents

Init file for database classes