Metadata-Version: 2.4
Name: trackinsight-data-python
Version: 0.1.1
Summary: Add your description here
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: polars
Requires-Dist: python-dotenv
Requires-Dist: python-dateutil
Requires-Dist: requests
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"

# trackinsight-data-python

## Setup the environment variables

Some variables are read from the environment.
Variables found in local .env file are added to the environment (via the `dotenv` library)

```bash
TRACK_API_KEY=YOUR_KEY_HERE # your API key
TRACK_API_DL_WORKERS=10 # number of parallel threads when downloading data
TRACK_API_STORAGE=trackinsight_data # local folder to use when storing data on disk
```


## Usage

```python
import polars as pl
import trackinsight_data_python as API

# You need to add TRACK_API_KEY and TRACK_API_HOST to .env

ccy='usd'

metadata= API.getMetadata()
stamp = metadata["reportsAsOf"][ccy][-1] # get latest stamp for reports

reports = API.getReports(ccy=ccy,stamp=stamp) # reports is a Polars DataFrame, you can use .to_pandas() if needed

nuclear_etfs = reports.filter(pl.col('class_theme').list.join(';') =='Nuclear Energy')

ids = nuclear_etfs["share_id"].to_list();

usd_timeseries = API.getTimeseries(ids=ids,start='2024-01-01',end=None,ccy=ccy)

holdings = API.getHoldings(ids=ids)


```
