Spaces:
Sleeping
Sleeping
Download debug_alpaca_2.py from janggi3/agent_system: direct link, hf CLI and curl.
- Browser
- Download file 576 Bytes
-
https://huggingface.co/spaces/janggi3/agent_system/resolve/main/debug_alpaca_2.py
- Command line
-
hf download hf://spaces/janggi3/agent_system/debug_alpaca_2.py
-
curl -L -o debug_alpaca_2.py https://huggingface.co/spaces/janggi3/agent_system/resolve/main/debug_alpaca_2.py
576 Bytes
| # file: agent_system/debug_alpaca_2.py | |
| import ccxt | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| def debug(): | |
| api_key = os.getenv("ALPACA_API_KEY") | |
| secret = os.getenv("ALPACA_SECRET") | |
| exchange = ccxt.alpaca({ | |
| 'apiKey': api_key, | |
| 'secret': secret, | |
| }) | |
| if api_key.startswith("PK"): | |
| exchange.set_sandbox_mode(True) | |
| m = exchange.load_markets() | |
| print("Market Keys (First 20):") | |
| for s in list(m.keys())[:20]: | |
| print(f"{s}: {m[s].get('type')} / {m[s].get('spot')}") | |
| if __name__ == "__main__": | |
| debug() | |