Skip to main content

Organize your digital media files

Project description

media-file-tools

Description

Media File Tools is a Python package designed to automate some of the tedious tasks of organizing your media files.

Features

  • Bulk rename TV series episodes that have undescriptive names.
  • Create a TV show database with episode title, air date and plot summary.
  • Create a movies database organized alphabetically or by folder.
  • Find duplicate music files.
  • Uses BeautifulSoup4 to scrape data from IMDB and TMDB.

Installation

You can install media-file-tools using pip:

pip install media-file-tools

How to use

To create a csv file with the seasons, titles and plot summaries of a TV series:

from mediafiletools import make_seriesdb

# Search using the name of the series (with optional `year` param for accuracy)
make_seriesdb(series='seinfeld', year='1989')

# Search using the IMDB ID of the show. 
make_seriesdb(imdb_id='tt0098904')

# Search using the TMDB (Movie Database) ID of the show
make_seriesdb(series_id='1400')

To overwrite the old file names of the show on your disc with the ones one the csv file:

from mediafiletools import rename_episodes

rename_episodes('C:\Users\user\Videos\Seinfeld', csv_path='C:\Users\user\episodes.csv')

Use caution with this command. Right now, this only looks for folders titled 'Season 1', 'Season 2', 'Season 3' etc. Any folders not following this naming convention will be skipped. The names of the files before and after they're renamed are recorded in a log.

To get the episodes and write the file names in one command, pass the imdb_id or the series_id as a keyword to rename_episodes:

# Using the IMDB ID
rename_episodes('C:\Users\user\Videos\Seinfeld', imdb_id='tt0098904')

# Using the TMDB (Movie Database) ID
rename_episodes('C:\Users\user\Videos\Seinfeld', series_id='1400')

Sometimes the episodes on IMDB are in a different order or have episode 0/unaired pilots not on a DVD or BlueRay. Make sure the episodes list lines up perfectly with the ones on your disc.

To specify which season(s) to get, pass the season numbers as the start and end keywords:

make_seriesdb(imdb_id='tt0098904', start=3, end=6)

To create an organized movie database from every movie file in the directory:

from mediafiletools import make_moviedb

make_moviedb('C:\Users\user\Movies')

Calling with no arguments will sort the movies alphabetically by default. To organize movies by folder instead, use the sort_type keyword:

make_moviedb('C:\Users\user\Movies', sort_type='folder')

To clean up the filenames, use the strip keyword:

make_moviedb('C:\Users\user\Movies', sort_type='folder', strip=True)

This will remove extraneous text from the filename. e.g. Double.Down.2005.DVDRip.x264.mkv will be written as: Double Down 2005

To find duplicate music files:

from mediafiletools import find_music_dupes

find_music_dupes(r'C:/Users/user/Music')

To output to the console or a text file instead of a csv, use the output_type keyword:

make_moviedb('C:\Users\user\Movies', output_type='txt')

Supported keywords are csv, txt and console.

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

media_file_tools-2.1.0.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

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

media_file_tools-2.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file media_file_tools-2.1.0.tar.gz.

File metadata

  • Download URL: media_file_tools-2.1.0.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for media_file_tools-2.1.0.tar.gz
Algorithm Hash digest
SHA256 3f42c8d553b5867ae396c1f9c3bfc2359e5f15e72094cc2c514d70ac6b4a409d
MD5 b52b5dfefbaf3905092cc61818a18fb9
BLAKE2b-256 18c72868c874f1c60fd364086b8fc12f938eb30534b935a3617734a22ccad4e5

See more details on using hashes here.

File details

Details for the file media_file_tools-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for media_file_tools-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61d5874d0caf6ae33a7f36165cd0f12782cea7540d0aa63687c406597b0d517c
MD5 567e428a6a307eb42aa578cfd7d09d38
BLAKE2b-256 dc7c289309065d80b2f81a447107c80ec70ba157f4eb768b5bae90abda59a513

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