# otp.Source.set_name

#### Source.set_name(new_name)

Sets source name.
It's an internal onetick-py name of the source that is only used
as a part of the resulting .otq file name and as the name of the query inside this file.

This method doesn't set the name of the OneTick graph node.

* **Parameters:**
  **new_name** ([*str*](https://docs.pip.distribution.sol.onetick.com/api/operation/str/root.html.md#onetick.py.Operation.str)) -- 

  New name of the source.

  Only alphanumeric, minus and underscore characters are supported.
  All other characters will be replaced in the resulting query name.

### Examples

```pycon
>>> t = otp.Tick(A=1)
```

By default source has no name and some predefined values are used when generating .otq file:

```pycon
>>> t.to_otq()
'/tmp/test_user/run_20240126_152546_1391/magnificent-wolverine.to_otq.otq::query'
```

Changed name will be used as a part of the resulting .otq file name
and as the name of the query inside this file:

```pycon
>>> t.set_name('main')
>>> t.to_otq()
'/tmp/test_user/run_20240126_152546_1391/dandelion-angelfish.main.to_otq.otq::main'
```

#### SEE ALSO
[`get_name()`](https://docs.pip.distribution.sol.onetick.com/api/source/self/get_name.html.md#onetick.py.Source.get_name)
