listdb module

class listdb.DB(db_path_name)

Bases: dbparam.DbParam

export_csv(tinydb_log_file, db_path_name, export_path_name)

Export full DB table ‘devices’ content to CSV

Parameters:
  • tinydb_log_file – log file to send the message
  • db_path_name – full path name of the DB to list
  • export_path_name – full path name of .CVS file to export the DB
Returns:

list(tinydb_log_file, db_path_name)

List full DB content.

Parameters:
  • tinydb_log_file – log file to send the message
  • db_path_name – full path name of the DB to list
Returns:

listdb._listdb()

List the full content of the DB specified in the configuration file netor.conf, unless a full path name to different TinyDB database is specified as an argument.

Verify existence of netor.conf file, since it could be required by the confparse module in order to get the DB full path name.

example:
../tinydb/scripts/listdb.py /full/path/name/database.json

Also has an export function to dump the current DB to a .csv file. If you want to export another DB you will need to netor-db-switch first.

example:
../tinydb/scripts/listdb.py -e
Returns:nothing