> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sumtyme.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Track Causal Chains

`map_causal_chains` maps the trajectory of directional signals as they emerge at the microscale and propagate through a hierarchy of increasing timeframes. By identifying the origin of a change, it constructs causal chains to quantify how micro-scale shifts evolve into structural change across expanding time scales.

***

#### Function Parameters

| Parameter   | Type          | Required | Description                                                                                                                    |
| :---------- | :------------ | :------- | :----------------------------------------------------------------------------------------------------------------------------- |
| data\_input | `list[tuple]` | True     | A list of tuples containing the source (URL or local path) and the associated timeframe label e.g. ('path/to/file.csv', '1m'). |

#### Supported Time Resolutions

| Unit            | Symbol | Seconds ($s$)          |
| :-------------- | :----- | :--------------------- |
| **Planck Time** | `pt`   | $5.39 \times 10^{-44}$ |
| **Yoctosecond** | `ys`   | $10^{-24}$             |
| **Zeptosecond** | `zs`   | $10^{-21}$             |
| **Attosecond**  | `as`   | $10^{-18}$             |
| **Femtosecond** | `fs`   | $10^{-15}$             |
| **Picosecond**  | `ps`   | $10^{-12}$             |
| **Nanosecond**  | `ns`   | $10^{-9}$              |
| **Microsecond** | `us`   | $10^{-6}$              |
| **Millisecond** | `ms`   | $10^{-3}$              |
| **Second**      | `s`    | $1$                    |
| **Minute**      | `m`    | $60$                   |
| **Hour**        | `h`    | $3,600$                |
| **Day**         | `d`    | $86,400$               |
| **Week**        | `w`    | $604,800$              |

***

#### Python Code Example

```python theme={null}
import sumtyme 

# Initialise the sumtyme client with the provided API key from your dashboard
client = sumtyme.client(apikey='your-api-key-here')

# Ensure API outputs start from the same timestamp
api_outputs = [
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_1s_reactive_outputs.csv", '1s'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_5s_reactive_outputs.csv", '5s'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_15s_reactive_outputs.csv", '15s'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_30s_reactive_outputs.csv", '30s'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_1m_reactive_outputs.csv", '1m'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_2m_reactive_outputs.csv", '2m'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_5m_reactive_outputs.csv", '5m'),
    ("https://raw.githubusercontent.com/sumteam/data_store/main/GLD/api_outputs/GLD_10m_reactive_outputs.csv", '10m'),
]


# Execute Causal Mapping
# initial_chain_starts (dataframe): Specific datetime where a chain first starts based on observed timeframes
# causal_chain_details (dataframe): A detailed breakdown of how the signal moved across different timeframes.
initial_chain_starts, causal_chain_details = client.map_causal_chains(api_outputs=api_outputs)

# Output results for review
print("--- Chain Inception Points ---")
print(initial_chain_starts)

print("\n--- Detailed Causal Path Analysis ---")
print(causal_chain_details)


```
