Skip to main content

Youtube Autonomous FastAPI Docker API Module

Project description

Youtube Autonomous FastAPI Docker API Module

The module that is handled by a docker container to isolate the environment we need for each purpose, exposed by a FastAPI that allows asking for the specific resources.

This project is using poetry to handle the dependencies and the virtual environment, and docker to manage the specific python version and all the code with the app to be executed.

This is the entry point API for all the functionality our Youtube Autonomous system is providing. This API will delegate in other API-containers to get what is needed.

The module that is providing the functionality related to the Youtube platform (downloading, getting metadata, etc.) through a FastAPI that is included and isolated in a Docker container but exposed to the internal and general FastAPI.

Endpoints

Youtube

GET

  • /youtube/videos/{id_video}
  • /youtube/videos/{id_video}/data
  • /youtube/videos/{id_video}/download-best-quality
  • /youtube/videos/{id_video}/download-lowest-quality
  • /youtube/videos/{id_video}/download-1080

You can replace the {id_video} with this id e_YBmIxeyUg for testing.

POST

No hay endpoints por el momento

Ollama

GET

No hay endpoints por el momento

POST

No hay endpoints por el momento


Other Instructions

Generate the image

We need to generate the docker image with all the things we need to be able to run the app inside.

  • Use the $ docker build --no-cache -t {LIBRARY_NAME} . command to generate the Docker image by using the dockerfile file and ignoring the caché. This will download the python 3.12.x version, install the dependencies and copy the code. Use this if any dependency has changed since the last time. If you are just updating the code, you can use the following instead.
  • Use the $ docker build -t {LIBRARY_NAME} . command to generate the Docker image by using the dockerfile file. It will download the python 3.12.x version, install the dependencies and copy the code, each of these steps only if needed (the cache will make it be ignore if it didn't change).

Run the container

We need to run the container, so it will be mounted and the app will be runing and ready to use.

  • Use the command $ docker rm -f {LIBRARY_NAME} 2>nul to remove the previous container if existing, so we are able to mount it again from zero.
  • Use the command $ docker run -d -p "%port%":8000 --name {LIBRARY_NAME} {LIBRARY_NAME} to run and mount the container and make the app be ready to use.

You can also execute the run_server_docker.bat to do all together using the caché (faster).


The docker will run uvicorn in the port 8000 internally, but our navigator will redirect the 8001 to that one, so we can have different docker containers working at the same time to provide different services using the same base (uvicorn + fastapi).

Other details

  • To run the project locally, execute the run_server.bat file or use $ poetry run uvicorn yta_fastapi_docker_base.app.main:app --reload directly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yta_fastapi_docker_api-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yta_fastapi_docker_api-0.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file yta_fastapi_docker_api-0.0.1.tar.gz.

File metadata

  • Download URL: yta_fastapi_docker_api-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10

File hashes

Hashes for yta_fastapi_docker_api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6f67ab7993b091498a489d01d71bdd951b2be823e36f4f7bb09cc9ec0b239d27
MD5 d0cc6e3673d60c3e8e3673c8b36f9d63
BLAKE2b-256 f04699725978ace1dea8f40eaf57e05d9e4f0ad21db2a43bea50871bd2fedd46

See more details on using hashes here.

File details

Details for the file yta_fastapi_docker_api-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for yta_fastapi_docker_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18a022ae542740e05190ee4dd9f42933259f26c1210f54f8446643de9014cfa3
MD5 781c6d5d7d46af55110c6fc0ac66e399
BLAKE2b-256 edad300ab80e4521ff109897c899f45baa5ca2b45a1867d55089d5604ca28e87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page