Automated Action 3a29a346a9 Initial implementation of cryptocurrency data API service using CoinCap API
* Created FastAPI application structure
* Added database models for assets, exchanges, markets, and rates
* Integrated with CoinCap API
* Implemented REST API endpoints
* Setup SQLite persistence with Alembic migrations
* Added comprehensive documentation

Generated with BackendIM... (backend.im)
2025-05-14 12:18:27 +00:00

24 lines
800 B
Python

from sqlalchemy import Column, String, Float, Integer, Boolean, DateTime
from datetime import datetime
from app.core.database import Base
class Exchange(Base):
__tablename__ = "exchanges"
exchange_id = Column(String, primary_key=True, index=True)
name = Column(String, index=True)
rank = Column(Integer)
percent_total_volume = Column(Float, nullable=True)
volume_usd = Column(Float, nullable=True)
trading_pairs = Column(Integer)
socket = Column(Boolean, nullable=True)
exchange_url = Column(String, nullable=True)
updated_timestamp = Column(Integer, nullable=True)
# Last updated in our database
last_updated = Column(DateTime, default=datetime.utcnow)
def __repr__(self):
return f"<Exchange {self.exchange_id}: {self.name}>"