Cow API using FastAPI
Project description
Cow Assignment
Description
This is a simple cow API that allows you to create, read, update, and delete cows using a RESTful API built with FastAPI.
Features
- Fetch all cows or a single cow based on its ID.
- Create a new cow.
- Update the details of an existing cow.
- Delete a cow based on its ID.
- Filter cows based on their attributes.
Installation
Install the package using pip:
pip install cow_api
Alternatively, you can clone the repository and install the requirements using pip:
pip install -r requirements.txt
Usage
After installation, you can run the application using uvicorn:
uvicorn cow_api.main:app --reload
Then navigate to http://localhost:8000/docs in your web browser to access the API.
Testing
Tests are located in the tests directory. To run tests, navigate to the root directory of the application and execute the following command:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.