whisper.api / README.md
Ved Gupta
v2
8713eac
|
raw
history blame
2.71 kB

whisper.api

This is a production level project structure for a Python FastAPI project.

Project Structure

whisper.api
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ api
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”‚   β”œβ”€β”€ items.py
β”‚   β”‚   β”‚   └── users.py
β”‚   β”‚   └── models
β”‚   β”‚       β”œβ”€β”€ __init__.py
β”‚   β”‚       β”œβ”€β”€ item.py
β”‚   β”‚       └── user.py
β”‚   β”œβ”€β”€ core
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ config.py
β”‚   β”‚   β”œβ”€β”€ security.py
β”‚   β”‚   └── database.py
β”‚   β”œβ”€β”€ tests
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ conftest.py
β”‚   β”‚   β”œβ”€β”€ test_api
β”‚   β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”‚   β”œβ”€β”€ test_items.py
β”‚   β”‚   β”‚   └── test_users.py
β”‚   β”‚   └── test_core
β”‚   β”‚       β”œβ”€β”€ __init__.py
β”‚   β”‚       β”œβ”€β”€ test_config.py
β”‚   β”‚       β”œβ”€β”€ test_security.py
β”‚   β”‚       └── test_database.py
β”‚   └── main.py
β”œβ”€β”€ .env
β”œβ”€β”€ .gitignore
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── .vscode
    β”œβ”€β”€ settings.json
    └── launch.json

Description

The project structure is organized as follows:

  • app: contains the main application code.
  • app/api: contains the API endpoints.
  • app/api/endpoints: contains the endpoint functions.
  • app/api/models: contains the data models.
  • app/core: contains the core application code.
  • app/core/config.py: contains the application configuration.
  • app/core/security.py: contains the security functions.
  • app/core/database.py: contains the database connection code.
  • app/tests: contains the test code.
  • app/tests/test_api: contains the API endpoint tests.
  • app/tests/test_core: contains the core application tests.
  • app/main.py: contains the main application entry point.
  • .env: contains environment variables.
  • .gitignore: specifies files and directories to ignore in Git.
  • Dockerfile: specifies the Docker image configuration.
  • requirements.txt: specifies the Python dependencies.
  • README.md: this file.
  • .vscode: contains Visual Studio Code configuration files.

Run this Project

uvicorn app.main:app --reload

Run Test

python -m unittest

Upload File

curl -X 'POST' \
  'http://localhost:8000/api/v1/transcribe/' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'audio_file=@ElevenLabs_2023-08-10T13 53 05.000Z_VedVoice_bFrkzQsyKvReo52Q6712.mp3;type=audio/mpeg'