---
description: Efficient conversion of financial symbols between different identifiers.
---

# ID Converter

The `Symbol` class provides a method to convert financial symbol identifiers from one format to another based on API responses. This functionality is essential for maintaining consistent identifier formats across various data sources and systems.

### **Usage**

```python
from finter.data import Symbol
Symbol.convert('id', 'short_code', list(stock_columns))
```

### Symbol Class

A class to handle the conversion of financial symbols between different identifiers using the `SymbolApi`.

**Methods:**

* **convert(\_from: str, to: str, source: Union\[str, list], date: Optional\[str] = None, universe: Optional\[int] = None) -> Result\[dict]**: Converts financial symbols from one identifier format to another.

**Attributes:**

* **\_from (str)**: The source identifier type (e.g., 'id').
* **to (str)**: The target identifier type (e.g., 'entity\_name').
* **source (Union\[str, list])**: The actual identifier(s) to be converted. Can be a single identifier or a list of identifiers.
* **date (Optional\[str])**: The date for which the conversion is applicable (default is None, implying the current date).
* **universe (Optional\[int])**: An optional parameter to specify the universe of the identifiers (default is None).

**Returns:**

* **dict**: A dictionary where each key is a symbol provided in the **\_from** parameter, and the corresponding value is the converted symbol in the **to** format. The length of the dictionary matches the length of the **source** list or the number of keys in the **source** string when multiple keys are provided separated by commas.



**Possible Mappings:**

|                  | **id** | **isin** | **short\_code** | **entity\_name** |
| ---------------- | ------ | -------- | --------------- | ---------------- |
| **id**           | N/A    | ✔️       | ✔️              | ✔️               |
| **isin**         | ✔️     | N/A      | ✔️              | ✔️               |
| **short\_code**  | ✔️     | ✔️       | N/A             | X                |
| **entity\_name** | X      | X        | X               | N/A              |

