database package

database.load module

Load project information and read from the project database

create_db(sql_file_name: str)[source]

Create a new sql table from .slq file in /database

Parameters:

sql_file_name (str) – name of the sql file to create

class ProjectLoader[source]

Bases: object

property open_folder

Open the directory in win explorer

load_db()[source]
class Database(db_path)[source]

Bases: object

execute(query)[source]
create_col(table: str, col_name: str, type: str)[source]

Create a new column in table

Parameters:
  • table (str) – table name to add the column

  • col_name (str) – column name

  • type (str) – data type for the column (e.g., TEXT, INT)

col_names(table) list[source]

Get column names

update(table, col_name, condition_col=None, condition_value=None, value=None)[source]

Update values to table

to_csv(table, add_date=True, open_folder=True)[source]

Convert database to csv

Parameters:
  • table (str) – Name of the table

  • open_folder (bool) – Open the output directory

to_dataframe(query)[source]

Convert to pandas dataframe according to the query statement

Parameters:

query (str) – SQL query statement

Returns:

df

Return type:

dataframe

class DBInfo(db)[source]

Bases: object

load_cluster_db()[source]
load_song_db()[source]