CoNNECT 0.1 documentation
Performs a query of the identified table and returns multiple columns that matched the search criteria.
Performs a query into the Project’s searchTable’s ‘fullpath’ column using the search criteria identified for a single file. Returns a single filepath.
query_file(regexStr, database=’CoNNECT’, searchtable=None, returncol=’fullpath’, searchcol=’filename’, progress=False, orderby=’fullpath’, inclusion=None, exclusion=None, orinclusion=None)
regexStr (str) – Required initial search terms
returncol (str) – Optional table column to return (default ‘fullpath’)
progress (bool) – Optional operate in verbose mode
orderby (str) – Optional column to sort results (default ‘fullpath’)
inclusion (str or list[str]) – Optional inclusion criteria to refine results. These must also be contained within searchcol (AND operation)
exclusion (str or list[str]) – Optional exclusion criteria to refine results. These must not be within the searchcol
orinclusion (str or list[str]) – Optional inclusion criteria to refine results. These may also be contained within the search column (OR operation)
Error – Any error occurs
Fullpath to a single file if only 1 file matches the search criteria, otherwise None.
None or str
Performs a query into the Project’s searchSourceTable’s ‘fullpath’ column using the search criteria identified for a single file. Returns a single filepath.
query_source_file(regexStr, database=’CoNNECT’, searchtable=None, returncol=’fullpath’, searchcol=’filename’, progress=False, orderby=’fullpath’, inclusion=None, exclusion=None, orinclusion=None)
regexStr (str) – Required initial search terms
returncol (str) – Optional table column to return (default ‘fullpath’)
progress (bool) – Optional operate in verbose mode
orderby (str) – Optional column to sort results (default ‘fullpath’)
inclusion (str or list[str]) – Optional inclusion criteria to refine results. These must also be contained within searchcol (AND operation)
exclusion (str or list[str]) – Optional exclusion criteria to refine results. These must not be within the searchcol
orinclusion (str or list[str]) – Optional inclusion criteria to refine results. These may also be contained within the search column (OR operation)
Error – Any error occurs
Fullpath to a single sourcedata file if only 1 file matches the search criteria, otherwise None.
None or str
Queries a directory for existing NIfTI images.
sql_query_dirs(regexStr, dirToCheck, showProgress)
Performs a query into the provided table/column using the search criteria identified. Returns unique directories containing the identified files.
sql_query_dirs(regexStr, showProgress, rawFlag, inclusion=None, exclusion=None)
regexStr (str) – Required search string
showProgress (bool) – Required verbose mode
rawFlag (bool) – Required true for project’s searchSourceTable (default false - project’s searchTable)
inclusion (str or list[str]) – Optional inclusion criteria to refine results. These must also be contained within searchcol (AND operation)
exclusion (str or list[str]) – Optional exclusion criteria to refine results. These must not be within the searchcol
Error – Any error occurs
The list of directories containing files matching search criteria
Performs a query into the provided table/column using the search criteria identified.
sql_query(database=’CoNNECT’, searchtable=None, returncol=’fullpath’, searchcol=’filename’, regex=None, progress=False, orderby=’fullpath’, inclusion=None, exclusion=None, orinclusion=None)
database (str) – Optional MySQL database containing the project’s searchtable (default ‘CoNNECT’)
searchtable (str) – Required MySQL table to query
returncol (str) – Optional table column to return (default ‘fullpath’)
searchcol (str) – Optional table column to query (default ‘filepath’)
regex (str) – Required initial search terms
progress (bool) – Optional operate in verbose mode
orderby (str) – Optional column to sort results (default ‘fullpath’)
inclusion (str or list[str]) – Optional inclusion criteria to refine results. These must also be contained within searchcol (AND operation)
exclusion (str or list[str]) – Optional exclusion criteria to refine results. These must not be within the searchcol
orinclusion (str or list[str]) – Optional inclusion criteria to refine results. These may also be contained within the search column (OR operation)
Error – Any error occurs
The list of columns matching search criteria
Performs a query into the provided table/column using the search criteria identified.
sql_multiple_query(database=’CoNNECT’, searchtable=None, returncol=’fullpath’, searchcol=’filename’, regex=None, progress=False, orderby=’fullpath’)
database (str) – Optional MySQL database containing the project’s searchtable (default ‘CoNNECT’)
searchtable (str) – Required MySQL table to query
returncol (str) – Optional table column to return (default ‘fullpath’)
searchcol (str) – Optional table column to query (default ‘filepath’)
regex (str) – Required initial search terms
progress (bool) – Optional operate in verbose mode
orderby (str) – Optional column to sort results (default ‘fullpath’)
Error – Any error occurs
All the columns elements from each row where the input column matches the search criteria
Creates the tables for a project whose credentials have been loaded into custom creds class via read_credentials().
sql_create_project_tables(progress=False)
progress (bool) – Optional operate in verbose mode
Error – Any error occurs
None
None
Inserts items into a Project’s table. The project’s credentials must have been loaded into customcreds class via read_credentials().
sql_table_insert(table,item,progress=False)
Removes items into a Project’s table. The project’s credentials must have been loaded into customcreds class via read_credentials().
sql_table_remove(table,item,progress=False)
Creates a connection to the MySQL database.
sql_create_mysql_connection(host_name, user_name, user_password, db_name, progress)
Error – Any error occurs
Pymysql connect object
pymysql.connect