# 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`](https://particle-analytics-1.gitbook.io/iota-python-api/iota/project) : class containing project object
* [`Scenario`](https://particle-analytics-1.gitbook.io/iota-python-api/iota/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*](https://particle-analytics-1.gitbook.io/iota-python-api/iota/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*](https://particle-analytics-1.gitbook.io/iota-python-api/iota/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))
```
