Installation Guide For Users - panuozzo77/StreamingCommunity GitHub Wiki
This guide walks you through installing the StreamingCommunity package using pip, and setting up a virtual environment to manage dependencies.
-
Python: Ensure you have Python 3.8 or higher installed. You can check your Python version by running
python --versionorpython3 --versionin your terminal. -
pip:
pipshould come with your Python installation. You can check ifpipis installed by runningpip --versionin your terminal. If not, you may need to install it separately.
Using a virtual environment is highly recommended to isolate project dependencies.
- Create the environment:
python3 -m venv .venvThis command creates a new virtual environment in a directory named .venv in your project directory.
- Activate the environment:
- On Linux/macOS:
source .venv/bin/activate- On Windows:
.venv\Scripts\activateOnce activated, your terminal prompt will change to show the environment name (e.g., (.venv)).
- Install from PyPI:
pip install StreamingCommunityThis command downloads and installs the latest version of the StreamingCommunity package and its dependencies from the Python Package Index (PyPI).
- Upgrade to the latest version (optional):
pip install --upgrade StreamingCommunityUse this command to update to the newest version of the package.
- Create a Python script:
Create a file named run_streaming.py (or any name you prefer) and add the following code:
from StreamingCommunity.run import main
if __name__ == "__main__":
main()- Run the script:
python run_streaming.pyWhen you are done working with the StreamingCommunity project, you can deactivate the virtual environment:
deactivateThis will return your terminal to its normal state.
This guide explains how to set up and run the StreamingCommunity application using Docker, including building the Docker image and configuring the container.
-
Docker: Ensure Docker is installed and running on your system. You can download it from the Docker website.
-
Make (optional): Install
makeif you want to use the quick setup commands provided in theMakefile.
You can run the script in a docker container, to build the image just run:
docker build -t streaming-community-api .and to run it use
docker run -it -p 8000:8000 streaming-community-apiBy default the videos will be saved in /app/Video inside the container, if you want to to save them in your machine instead of the container just run
docker run -it -p 8000:8000 -v /path/to/download:/app/Video streaming-community-apiInside the Makefile (install make) are already configured two commands to build and run the container:
make build-container
# set your download directory as ENV variable
make LOCAL_DIR=/path/to/download run-containerThe run-container command mounts also the config.json file, so any change to the configuration file is reflected immediately without having to rebuild the image.