# Session

`iota.session`

This method start a new session of Iota. Once the session is loaded,

**Classes**

* [`Session`](#class_session) : class containing session object
* [`Project`](project) : class containing project object
* [`Scenario`](scenario) : class containing scenario object

&#x20;**Variables**

* `projects` (list\[Project]) list of projects in the database

## Methods

### [\_\_init\_\_(username, config\_file)](#iota_session) <a href="#iota_session" id="iota_session"></a>

_Start new session_

**Arguments**

* `username`: (str) username already registered in the database
* `config_file`: (str) file path of the system configuration (e.g **C:/Users/Stephen/ParicleAnalytics/config.ini**)

**Example**

```python
my_session = iota.session(
    'my_username',
    '$HOME/ParicleAnalytics/config.ini'
)
```

### [create\_project(name, \[description\])](#create_project) <a href="#create_project" id="create_project"></a>

_Create a project with a specified name and description_ _See_ [_Project_](project) _for more info_

**Arguments**

* `name`: (str) project name
* `description`: (str) user description of the project (default: '')

**Example**

```python
new_project = session.create_project(
    name = 'mixing optimization',
    description = 'Vary drum speed in the range 2 - 4 RPM'
)
```

### [project\_exists(name)](#project_exists) <a href="#project_exists" id="project_exists"></a>

_Check the existence of a project by name_

**Arguments**

* `name`: (str) project name

**Example**

```python
if session.exists_project(name = 'mixing_optimization'):
    print('project "mixing optimization" exist')
```

### [get\_project(name)](#get_project) <a href="#get_project" id="get_project"></a>

_Return a project, specified by a name_ _See_ [_Project_](project) _for more info_

**Arguments**

* `name`: (str) project name

**Example**

```python
project = session.get_project(
    name = 'mixing optimization'
)
```

### [total\_projects()](#total_projects) <a href="#total_projects" id="total_projects"></a>

_Return the total number of projects for some user_

**Example**

```python
num_projects = session.total_projects()
print('total number of projects in the database is {}'.format(num_projects))
```
