This project demonstrates a FastAPI application that checks an S3 bucket every minute and lists any new items on the console.
Before running the application, make sure you have the following prerequisites:
- Python 3.x installed
- Poetry installed
- AWS access key and secret access key set as environment variables (
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
)
-
Clone the repository:
git clone https://github.com/your-username/my_fastapi_project.git
-
Navigate to the project directory:
cd my_fastapi_project
-
Initialize a new Poetry project:
poetry init
-
Open the
pyproject.toml
file and add the required dependencies to the[tool.poetry.dependencies]
section. For example, to add FastAPI and boto3, you can add the following lines:[tool.poetry.dependencies] fastapi = "^0.73.0" boto3 = "^1.21.1"
-
Save the
pyproject.toml
file and install the dependencies:poetry install
-
Set the AWS access key and secret access key as environment variables (
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
). -
Run the application using Poetry:
poetry run uvicorn main:app --reload
-
Access the application at
http://localhost:8000
.
- Checks an S3 bucket every minute and lists any new items on the console.
- Uses the FastAPI framework for building the API.
- Uses the boto3 library for interacting with AWS S3.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
Feel free to modify and use this project according to your needs.