akjroller / Playing_with_FastAPI

Just me playing with FastAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crypto Price Tracker

Python 3.8 License: MIT

Crypto Price Tracker This application was created for fun and you could just use CoinGecko API directly. Crypto Price Tracker uses CoinGecko API for fetching real-time prices, stores data in SQLite, and exposes an API endpoint to fetch the historical price data. It also provides a Python script to visualize this data using Matplotlib.


✨ Features

  • Real-time cryptocurrency price tracking
  • Data stored in SQLite
  • API endpoint for fetching historical data
  • Visualization of price data over time

πŸ“‹ Prerequisites

  • Python 3.8+
  • Libraries: FastAPI, Uvicorn, Requests, Matplotlib, SQLite

These requirements can be installed by running pip install -r requirements.txt


πŸ“ Project Structure

Here's a brief intro to the main files in this repository:

  • main.py: Contains the FastAPI server and the endpoint that fetches data from the SQLite database.
  • plot.py: Fetches data from the FastAPI server and plots the cryptocurrency price over time.
  • fetch_price.py: Fetches the current price of the cryptocurrency from the CoinGecko API and inserts it into the SQLite database.

πŸš€ Getting Started

1. Start the FastAPI server:

uvicorn main:app --reload

2. Run the script that fetches the current price and inserts it into the database:

python fetch_price.py

3. Run the script that fetches data from the FastAPI server and plots it:

python plot.py

You should see a matplotlib window pop up displaying the plot of the cryptocurrency price over time.

🀝 Contributing:

Contributions, issues, and feature requests are welcome!

πŸ“ License:

This project is MIT licensed.

About

Just me playing with FastAPI

License:MIT License


Languages

Language:Python 100.0%