# API Reference v10.3.1 (Python)

## Library (class)

Module: zaber_motion

Access class to general library information and configuration.

To use this type, add `from zaber_motion import Library` to the top of your source code.

Related Guides:

- [Device database](https://software.zaber.com/motion-library/docs/guides/advanced/device_db.md)
- [Logging](https://software.zaber.com/motion-library/docs/guides/advanced/logging.md)

### Methods

(static)

#### `check_version()`

Obsolete: Calling this function is no longer necessary as the check happens automatically.

`Library.check_version()`

Throws an error if the version of the loaded shared library does not match the caller's version.

(static)

#### `clear_device_db_store()` (async available)

`Library.clear_device_db_store()`

Clears the Device DB store on the local filesystem. Note: If the device DB was enabled with a custom store location, store files will be removed in that location.

(static)

#### `disable_device_db_store()`

`Library.disable_device_db_store()`

Disables Device DB store.

(static)

#### `enable_device_db_store()`

`Library.enable_device_db_store(store_location = None)`

Enables Device DB store. The store uses filesystem to save information obtained from the Device DB. The stored data are later used instead of the Device DB.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `store_location` | `Optional[str]` | Specifies relative or absolute path of the folder used by the store. If left empty defaults to a folder in user home directory. Must be accessible by the process. |

(static)

#### `set_device_db_source()`

`Library.set_device_db_source(source_type, url_or_file_path = None)`

Sets source of Device DB data. Allows selection of a web service or a local file.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `source_type` | [`DeviceDbSourceType`](https://software.zaber.com/motion-library/api/py/root/devicedbsourcetype.md) | Source type. |
| `url_or_file_path` | `Optional[str]` | URL of the web service or path to the local file. Leave empty for the default URL of Zaber web service. |

(static)

#### `set_device_db_sources()`

`Library.set_device_db_sources(*sources)`

Sets a sequence of sources. When the library needs device information, it will try each source in the order they are provided.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `*sources` | [`DeviceDbSource`](https://software.zaber.com/motion-library/api/py/root/devicedbsource.md) | The list of sources the library will access data from. |

(static)

#### `set_log_output()`

`Library.set_log_output(mode, file_path = None)`

Sets library logging output.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `mode` | [`LogOutputMode`](https://software.zaber.com/motion-library/api/py/root/logoutputmode.md) | Logging output mode. |
| `file_path` | `Optional[str]` | Path of the file to open. |
