MediaCatalog
A program to catalog media files. I would like to use Python and my idea is to divide the project into several parts. 1. one part searches the hard disk for media files and reports found files to an API. 2. a backend with API which is responsible for the data management. 3. free end for searching the data and eventual analysis.
- List and manage media items (e.g., movies, music, books)
- Search and filter media
- Add, edit, and delete media entries
- User authentication (optional)
- Responsive user interface
- Platform: Windows
- Programming Language(s): Python
- Frameworks/Libraries: FastApi, SqlAlchemy, Pydantic, Streamlit
- Database: media_data.db
- Integration with external APIs
- Advanced filtering and recommendations
Prompt:
Create a new project called “MediaCatalog”. Create three subfolders: “scanner”, ‘api_backend’ and “frontend”. Initialize a separate Python module with the appropriate main.py
in each subfolder.
Prompt: In the “scanner” folder: Create a Python script that recursively searches a directory for media files (.mp3, .mp4, .jpg, .mkv). Extract file names, path and, if possible, metadata (duration, resolution, etc.). Send the data as JSON objects via POST to an API at http://localhost:8000/media.
Prompt:
In the folder “api_backend”: Create a FastAPI project with SQLite database. Create endpoints for adding (POST /media
), retrieving (GET /media
) and deleting (DELETE /media/{id}
) media files. Save file name, path, file type and metadata. Use Pydantic models and SQLAlchemy.
Prompt: In the “frontend” folder: Create a Streamlit app that queries the media data from the API and displays it in a table. Add filter options by file type, search field by file name and a preview for images.
Prompt: Add unit tests for the API module with pytest to make sure the endpoints work correctly Create a test for adding and retrieving media files.
Prompt:
Create a makefile
or run_all.sh
that:
- starts the backend,
- runs the scanner to report sample files,
- starts the frontend.
Use subprocess or
os.system
calls.