Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (24 loc) · 1.33 KB

README.md

File metadata and controls

40 lines (24 loc) · 1.33 KB

What Is This?

This is the repository for UF Open Source Club's API development group. We meet biweekly and program APIs for personal and public use.

How to Get Started?

For most of our APIs we are using the Python API framework "Fast API." The basic imports are fastapi and uvicorn[standard].

To get a simple, starter API going, simply run pip install fastapi and pip install uvicorn[standard] in your Python environment to get those imports functional. fastapi is the main framework, whereas uvicorn is for testing the API on our localhost.

Include this bit of "Hello world" boilerplate in a main.py file...

from typing import Union

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
    return {"item_id": item_id, "q": q}

And voila! If you run uvicorn main:app --reload in your terminal, it should get a test server up and running on http://127.0.0.1:8000.

How can I contribute?

There are many great ways to contribute. The best way would be to familiarize yourself with FastAPI and come up with a cool API idea, code it up and send a pull request. This set to be a large repository containing numerous different APIs with all different purposes - get creative!