summaryrefslogtreecommitdiff
path: root/cli/src/trading_cli/commands/data.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-02 15:54:55 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-02 15:54:55 +0900
commitbf4afbc0a3cc4e847ef01840365fd6a6ae9c142f (patch)
treec8634b3b21534f550e2d255d98c4a068a1b567d0 /cli/src/trading_cli/commands/data.py
parentec8b6fea5a4a710df4b2ae18f3f399d165c8ffd4 (diff)
style: auto-fix lint violations from enhanced ruff rules
Diffstat (limited to 'cli/src/trading_cli/commands/data.py')
-rw-r--r--cli/src/trading_cli/commands/data.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/src/trading_cli/commands/data.py b/cli/src/trading_cli/commands/data.py
index 8797564..64639cf 100644
--- a/cli/src/trading_cli/commands/data.py
+++ b/cli/src/trading_cli/commands/data.py
@@ -1,5 +1,6 @@
import asyncio
import sys
+from datetime import UTC
from pathlib import Path
import click
@@ -39,14 +40,14 @@ def history(symbol, timeframe, since, limit):
"""Download historical stock market data for a symbol."""
try:
from shared.alpaca_client import AlpacaClient
- from shared.db import Database
from shared.config import Settings
+ from shared.db import Database
except ImportError as e:
click.echo(f"Error: Could not import required modules: {e}", err=True)
sys.exit(1)
async def _fetch():
- from datetime import datetime, timezone
+ from datetime import datetime
settings = Settings()
db = Database(settings.database_url.get_secret_value())
@@ -55,7 +56,7 @@ def history(symbol, timeframe, since, limit):
start = None
if since:
try:
- start = datetime.fromisoformat(since).replace(tzinfo=timezone.utc)
+ start = datetime.fromisoformat(since).replace(tzinfo=UTC)
except ValueError:
click.echo(
f"Error: Invalid date format '{since}'. Use ISO format (e.g. 2024-01-01).",
@@ -97,10 +98,11 @@ def history(symbol, timeframe, since, limit):
def list_():
"""List available data streams and symbols."""
try:
- from shared.db import Database
+ from sqlalchemy import func, select
+
from shared.config import Settings
+ from shared.db import Database
from shared.sa_models import CandleRow
- from sqlalchemy import select, func
except ImportError as e:
click.echo(f"Error: Could not import required modules: {e}", err=True)
sys.exit(1)