# Session

`iota.session`

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

**Classes**

* [`Session`](/iota-python-api/iota/session.md#class_session) : class containing session object
* [`Project`](/iota-python-api/iota/project.md) : class containing project object
* [`Scenario`](/iota-python-api/iota/scenario.md) : class containing scenario object

&#x20;**Variables**

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

## Methods

### [\_\_init\_\_(username, config\_file)](/iota-python-api/iota/session.md#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\])](/iota-python-api/iota/session.md#create_project) <a href="#create_project" id="create_project"></a>

*Create a project with a specified name and description* *See* [*Project*](/iota-python-api/iota/project.md) *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)](/iota-python-api/iota/session.md#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)](/iota-python-api/iota/session.md#get_project) <a href="#get_project" id="get_project"></a>

*Return a project, specified by a name* *See* [*Project*](/iota-python-api/iota/project.md) *for more info*

**Arguments**

* `name`: (str) project name

**Example**

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

### [total\_projects()](/iota-python-api/iota/session.md#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))
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://particle-analytics-1.gitbook.io/iota-python-api/iota/session.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
