Skip to content

Commit

Permalink
docs: add pandas example
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmethakanbesel committed Oct 3, 2023
1 parent 9957d83 commit 65513f3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ Default email is `[email protected]` and password is `1234567890`.
http://127.0.0.1:8090/api/yahoo/symbol/THYAO.IS?startDate=2023-06-01&endDate=2023-09-30&currency=TRY
```

### Use with Pandas

```python
import pandas as pd

API_URL = 'http://127.0.0.1:8090'

def get_data(symbol, start_date, end_date):
url = f'{API_URL}/api/yahoo/symbol/{symbol}?startDate={start_date}&endDate={end_date}&format=csv'
df = pd.read_csv(url, parse_dates=['Date'])
df.set_index('Date', inplace=True)
return df
```

## Credits

- [Pocketbase](https://github.com/pocketbase/pocketbase)

0 comments on commit 65513f3

Please sign in to comment.