Skip to content

Jwolf13/telemetry-ingestor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telemetry Ingestor A FastAPI service for ingesting telemetry data, supporting authentication, CSV file uploads, and JWT token management. Built with Python, following modern API best practices.

Features User Registration & Login (/auth/register and /auth/login)

JWT Authentication

Telemetry Upload via /telemetry/upload (CSV)

Auto-generated Swagger UI & ReDoc documentation

Pytest-based test suite

Requirements Python 3.11+ (project built on 3.11)

pip for dependency management

Setup Clone the repository

bash Copy Edit git clone https://github.com/Jwolf13/telemetry-ingestor.git cd telemetry-ingestor Create a virtual environment

bash Copy Edit python -m venv .venv Activate the environment

Windows (PowerShell)

powershell Copy Edit .venv\Scripts\Activate.ps1 Linux/Mac

bash Copy Edit source .venv/bin/activate Install dependencies

bash Copy Edit pip install -r requirements.txt Running the API From the project root:

bash Copy Edit python scripts/run.py You should see:

nginx Copy Edit Uvicorn running on http://127.0.0.1:8000 Swagger UI → http://127.0.0.1:8000/docs

ReDoc → http://127.0.0.1:8000/redoc

Running Tests bash Copy Edit pytest -q API Endpoints

  1. Register POST /auth/register

json Copy Edit { "username": "jk1914", "password": "123456" } 2. Login (Get JWT Token) POST /auth/login

json Copy Edit { "username": "jk1914", "password": "123456" } Response Example:

json Copy Edit { "access_token": "YOUR_JWT_TOKEN", "token_type": "bearer" } 3. Upload Telemetry Data POST /telemetry/upload

Requires Authorization: Bearer header

Accepts CSV file in multipart/form-data

Example cURL Usage Register bash Copy Edit curl -X POST "http://127.0.0.1:8000/auth/register"
-H "Content-Type: application/json"
-d '{"username": "jk1914", "password": "123456"}' Login bash Copy Edit curl -X POST "http://127.0.0.1:8000/auth/login"
-H "Content-Type: application/json"
-d '{"username": "jk1914", "password": "123456"}' Upload CSV bash Copy Edit curl -X POST "http://127.0.0.1:8000/telemetry/upload"
-H "Authorization: Bearer YOUR_JWT_TOKEN"
-F "file=@data.csv" Project Structure bash Copy Edit ├── scripts/ │ ├── run.py # Start FastAPI server │ ├── print_routes.py # Print available routes ├── src/ │ └── telemetry/ # App code │ ├── main.py # Entry point │ ├── auth.py # Auth logic │ ├── telemetry.py # Telemetry handling ├── tests/ # Pytest test suite ├── requirements.txt └── README.md License MIT License – feel free to use and modify.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages