@@ -30,7 +30,7 @@ def attempt_login(database_address, username, password):
3030 List all schemas under the database
3131
3232 Parameters:
33- jwt_payload (dict): dictionary containing databaseAddress, username and password strings
33+ jwt_payload (dict): Dictionary containing databaseAddress, username and password strings
3434
3535 Returns:
3636 list<strings>: List of schemas names
@@ -47,7 +47,8 @@ def list_schemas(jwt_payload):
4747 List all tables and their type give a schema
4848
4949 Parameters:
50- jwt_payload (dict): dictionary containing databaseAddress, username and password strings
50+ jwt_payload (dict): Dictionary containing databaseAddress, username and password strings
51+ schema_name (str): Name of schema to list all tables from
5152
5253 Returns:
5354 dict(manual_tables=[<table_names>],
@@ -83,6 +84,24 @@ def list_tables(jwt_payload, schema_name):
8384 print (table_name + ' is of unknown table type' )
8485
8586 return tables_dict_list
87+
88+ """
89+ Get all tuples from table
90+
91+ Parameters:
92+ jwt_payload (dict): Dictionary containing databaseAddress, username and password strings
93+ schema_name (string): Schema name where to find the table under
94+ table_name (string): Table name under the given schema, must be in camel case
95+
96+ Returns:
97+ (tuples)
98+ """
99+ @staticmethod
100+ def fetch_tuples (jwt_payload , schema_name , table_name ):
101+ DJConnector .set_datajoint_config (jwt_payload )
102+
103+ schema_virtual_module = dj .create_virtual_module (schema_name , schema_name )
104+ return getattr (schema_virtual_module , table_name ).fetch (as_dict = True )
86105
87106 """
88107 Method to set credentials for database
@@ -104,10 +123,10 @@ def set_datajoint_config(jwt_payload):
104123 Helper method for converting snake to camel case
105124
106125 Parameters:
107- string (string): string in snake format to convert to camel case
126+ string (string): String in snake format to convert to camel case
108127
109128 Returns:
110- string: string formated in CamelCase notation
129+ string: String formated in CamelCase notation
111130 """
112131 @staticmethod
113132 def snake_to_camel_case (string ):
0 commit comments