Coder Social home page Coder Social logo

fastapi-xapi's Introduction

FastAPI-xAPI

FastAPI xAPI Server and Client

This repository provides a demonstration of how to set up a FastAPI server to receive and store xAPI statements in an SQLite database and a Python client to send xAPI statements to the server.

Setup

  1. Clone this repository.
  2. Install required packages:
pip install fastapi[all] uvicorn requests sqlite
  1. Start the FastAPI server:
uvicorn server:app --reload
  1. In a separate terminal, run the client to send an xAPI statement:
python client.py

Explanation

xAPI: The Experience API (xAPI) is a specification for collecting data about learning experiences, predominantly used in e-learning platforms.

FastAPI: A modern, high-performance web framework for building APIs with Python based on standard Python type hints.

server.py

This file contains a FastAPI server set up to accept POST requests with xAPI statements, store them in an SQLite database, and retrieve them via GET requests.

client.py

This script sends a sample xAPI statement to the server and prints the server's response.

Note

This demonstration uses SQLite for persistent storage. For larger-scale production deployments, consider using more scalable database solutions and implementing additional security and performance optimizations.

fastapi-xapi's People

Contributors

ladoger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.