DomainsDictionary
A DomainsDictionary is used to map an entire database from an arbitrary schema to a PhenEx internal representation.
Attributes:
Name | Type | Description |
---|---|---|
domains_dict |
Dict[str, class]
|
A dictionary where keys are domain names and values are uninstantiated PhenexTable class objects. |
Methods:
Name | Description |
---|---|
get_mapped_tables |
Get all tables mapped to PhenEx representation using the given connection. |
set_mapped_tables |
Create a view for all mapped tables in the destination database. |
Source code in phenex/mappers.py
get_mapped_tables(con)
Get all tables mapped to PhenEx representation using the given connection.
If a database is not provided, the current database of the connection is used to find the tables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
con
|
The connection to the database. |
required | |
database
|
Optional[str]
|
The name of the database. Defaults to the current database of the connection. |
required |
Returns:
Type | Description |
---|---|
Dict[str, PhenexTable]
|
Dict[str, PhenexTable]: A dictionary where keys are domain names and values are mapped tables. |
Source code in phenex/mappers.py
set_mapped_tables(con, overwrite=False)
Get all tables mapped to PhenEx representation using the given connection.
If a database is not provided, the current database of the connection is used to find the tables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
con
|
The connection to the database. |
required | |
database
|
Optional[str]
|
The name of the database. Defaults to the current database of the connection. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Table]
|
Dict[str, Table]: A dictionary where keys are domain names and values are mapped tables. |