## omero_data.OmeroConnection


Provide a connection to OMERO.


Usage

``` python
omero_data.OmeroConnection()
```


Connection settings come from the environment and the user config; the password from the environment, the keychain or a password file (see `omero_screen.settings`). They are resolved when connecting.


## Methods

| Name | Description |
|----|----|
| [close()](#close) | Close the current connection. |
| [create_conn()](#create_conn) | Create a new connection to OMERO. |
| [get_conn()](#get_conn) | Get the current connection to OMERO, creating one if required. |

------------------------------------------------------------------------


#### close()


Close the current connection.


Usage

``` python
close(hard=True)
```


##### Parameters


`hard: bool = ``True`  
If true perform a hard close.


------------------------------------------------------------------------


#### create_conn()


Create a new connection to OMERO.


Usage

``` python
create_conn()
```


##### Returns


`BlitzGateway`  
OMERO connection


##### Raises


`RuntimeError`  
if a connection cannot be opened.


------------------------------------------------------------------------


#### get_conn()


Get the current connection to OMERO, creating one if required.


Usage

``` python
get_conn()
```


The connection is stored for reuse.


##### Returns


`BlitzGateway`  
OMERO connection


##### Raises


`RuntimeError`  
if a required connection cannot be opened.
