Skip to main content

Flumes

Scan and index your media files

PyPI version GitHub release (latest by date) Maintenance GitHub pull requests ci cd License Website


Table of Contents

About The Project

Flumes is a tool that allows you to select a folder and detect existing media files automatically. These media files are scanned and all relevant information is stored in a database. In addition, you can trigger a scan manually anytime to update your database.

Features

  • Scan media files in a selected directory
  • Automatically rescan selected media directory when changes are detected
  • Stores the GstDiscoveryStream information and the GstCaps structure fields in a database
  • Trigger directory rescan manually

Getting Started

System requirements

Installation

For a successful and complete installation, you can choose between the Poetry packaging and dependency management tool or just use Docker.

  1. If you select via Poetry:

Make sure you are on the root path of the project before running these commands.

  • Install poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
  • Install dependencies
poetry install
  • Link the database to the folder where you want to monitor your media files:
poetry run flumes-discovery -i sqlite:///flumes.db -d <media content directory>  
  1. In case you prefer an alternative to poetry for installation, you can use it via Docker:
docker-compose -f docker-compose-dev.yml up --build

Troubleshooting

  • gi module:

If error ModuleNotFoundError: No module named 'gi'" , check your installation:

sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0
pip3 install pycairo
pip3 install PyGObject
  • Sometimes there could be differences between the version of python in your virtual environment and the version to install during setup. In this case, check that both versions match.
sudo apt-get install python<version>-dev

Usage

Querying the database

SQLite is the database engine used to store all the information collected in the scanning process through discovery. You can see how this database is created in the schema.py file and implemented through its migrations. sqlite3 will allow you to manually enter and execute SQL queries against your SQLite database as follows:

sqlite3 flumes-dev.db 

Now you can make any query to your media files indexed in the database.

Trigger rescan

You can trigger discovery to rescan all files at run time. Either locally or using poetry you can look up the PID and send the corresponding signal:

  • Select the PID where flumes-discovery is running
ps aux | grep flumes-discovery
  • Send the signal to rescan
kill -USR1 <PID>

Also this feature is available to use through docker:

  • Find the running container's ID:
docker ps
  • Check the Process ID (PID):
docker exec -it <container ID> ps -aux
  • Now, you can send various signals to trigger the rescan:
docker exec -t -i <container ID> /bin/sh -c 'kill -USR1 <PID>'

Development

Required dependencies

The installation via poetry and docker will install all the required dependencies by default but in case you do not use any of these options the installation will not be completed. To successfully guarantee your development process, check that you have the following dependencies installed:

  • python-dateutil = ^2.8.2
  • SQLAlchemy = ^1.4.26
  • alembic = ^1.7.5
  • packaging = ^21.3
  • pytest = ^5.2
  • pre-commit = ^2.15.0
  • black = ^21.9b0
  • isort = ^5.9.3
  • tox = ^3.24.4
  • yamllint = ^1.26.3

Git hook

You can detect any issue before commit using pre-commit hooks.

  • Install pre-commit hooks
poetry run pre-commit install

New releases

To generate a new release you must update the version number. The following files will need to be updated:

  • init file
  • tests/test_flumes.py
  • pyproject.toml

Once it is merged, tagging must be done in order to distribute the new version correctly.

Tagging

git tag -a <version> -m "Release <version>"
git push origin --tags

Database

You must use alembic for database migration. First, make the necessary changes to the schema.py file and then proceed with the steps to successfully perform the migration.

alembic revision --autogenerate
alembic upgrade head
alembic stamp head

Testing

All tests are located in the tests folder. The framework used is pytest. You can run the tests locally using the following command under the same path for example:

poetry run pytest

License

See LICENSE.LGPL for more information.

Metadata

Release files for flumes 0.1.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flumes 0.1.23
File Size Uploaded Provenance Actions
flumes-0.1.23.tar.gz 25.7 kB Without provenance Details for flumes-0.1.23.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flumes 0.1.23
File Interpreter ABI Platform Actions
flumes-0.1.23-py3-none-any.whl Python 3 none any Details for flumes-0.1.23-py3-none-any.whl

Total release size: 52.4 kB

Release files / flumes-0.1.23.tar.gz

Download URL flumes-0.1.23.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f89281a0174e6cb4a677748c1f8b42d841c2f21b63af067c558d6ffa467b6cdf
BLAKE2b-256 checksum
How to use checksums
8b451c80d117658fd2107c3406bcfea3fcf4c92026fb671f27e7b680facb546e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1023-azure

Release files / flumes-0.1.23-py3-none-any.whl

Download URL flumes-0.1.23-py3-none-any.whl
Size 26.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6de0bc068e1fd14afbe8944a3e14ec598e3e798425bab47a6e896e47e0a0743
BLAKE2b-256 checksum
How to use checksums
1199f4e5b8f20b00958d935c690bd4e6728971350a2bd2137963bc7d82011860
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1023-azure

Security for flumes 0.1.23

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page