Skip to content

acstein/API_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parser API Project

A simple FastAPI project that provides:

  • A /hello endpoint (basic GET test).
  • An /echo endpoint (POST endpoint that returns the text you send it).
  • Error handling (rejects empty or whitespace-only text).
  • Unit tests with pytest (no need for a live server).

This project was created as part of a month-long learning sprint to explore backend development with Python.


Features

  • FastAPI framework with automatic interactive docs (/docs).
  • Error handling using HTTPException.
  • Unit tests using FastAPI's TestClient and pytest.
  • Ready for extension (e.g., adding parsers, databases, or more endpoints).

Installation & Setup

1. Clone the repository

git clone https://github.com/acstein/API_Project

2. Create a venv

python3 -m venv venv source venv/bin/activate # On Linux/Mac venv\Scripts\activate # On Windows

3. install dependencies

pip install -r requirements.txt

Running the App

Start the FastAPI server: uvicorn my_first_api:app --reload fastapi dev my_first_api.py

Visit:

Running Tests

Run all tests: pytest -v

You should see: test_.py::test_hello PASSED test_.py::test_echo_valid PASSED test_.py::test_echo_empty PASSED

About

Project to learn and explore parsing and rest api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages