Metadata-Version: 2.5
Name: plexer_cli
Version: 0.1.8
Summary: Normalize media files and directories for use with Plex Media Server
Project-URL: Repository, https://github.com/magneticstain/plexer
Project-URL: Documentation, https://github.com/magneticstain/plexer-cli/wiki
Project-URL: Issues, https://github.com/magneticstain/plexer/issues
Author-email: Josh Carlson <837837+magneticstain@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Keywords: catagorization,formatting,media,organization,plex
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Framework :: Hatch
Classifier: Framework :: Pytest
Classifier: Framework :: tox
Classifier: Intended Audience :: System Administrators
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: logzero~=1.7.0
Requires-Dist: prompt-toolkit>=3.0.52
Requires-Dist: python-magic~=0.4.27
Description-Content-Type: text/markdown

# Plexer

<!-- reenable once issue #27 is complete -->
<!-- ![GitHub Release](https://img.shields.io/github/v/release/magneticstain/plexer?include_prereleases) -->
[![PyPI - Version](https://img.shields.io/pypi/v/plexer_cli)](https://pypi.org/project/plexer-cli/)

![GitHub License](https://img.shields.io/github/license/magneticstain/plexer)
![Supported Python Versions](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmagneticstain%2Fplexer%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)

![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/magneticstain/plexer)
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/magneticstain/plexer/total)

[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/magneticstain/plexer-cli/badge)](https://scorecard.dev/viewer/?uri=github.com/magneticstain/plexer-cli)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13659/badge)](https://www.bestpractices.dev/projects/13659)

[![Run Full Suite of Checks and Tests](https://github.com/magneticstain/plexer/actions/workflows/run_full_test_suite.yml/badge.svg)](https://github.com/magneticstain/plexer/actions/workflows/run_full_test_suite.yml)
[![Release](https://github.com/magneticstain/plexer/actions/workflows/release.yml/badge.svg)](https://github.com/magneticstain/plexer/actions/workflows/release.yml)

## Summary

A CLI tool made to make organizing your media for [Plex Media Server](https://www.plex.tv/) easy. Normalize names of media files and directories to match [the hierarchial requirements that Plex requires](https://support.plex.tv/articles/naming-and-organizing-your-movie-media-files/).

## Features

### Support

Currently, Plexer only supports organizing movies and other individual video files.

### Roadmap

- [ ] Support for TV Shows ([#28](https://github.com/magneticstain/plexer/issues/28))
- [X] Docker implementations ([#29](https://github.com/magneticstain/plexer/issues/29))
- [ ] MacOS support ([#30](https://github.com/magneticstain/plexer/issues/30))
- [ ] Windows support ([#31](https://github.com/magneticstain/plexer/issues/31))
- [X] Metadata inference using file/directory info (i.e. analyze the video files to "guess" what the name, year, etc is) ([#32](https://github.com/magneticstain/plexer/issues/32))

## Install

### Docker

The most portable way to install and run Plexer is by using Docker.

#### Via Container Registry

The easiest way to run Plexer in Docker is by using the public containers hosted on container registries. Plexer images are available on both Docker Hub and GitHub Container Registry. See the commands below for how to run Plexer using each registry.

##### Docker Hub

```bash
docker run --rm -it magneticstain/plexer-cli
```

##### Github Container Registry

```bash
docker run --rm -it ghcr.io/magneticstain/plexer-cli
```

#### Via Local Image Build

In the case that container registries are unavailable, there's also the option to build the image locally. To do that, check out the `main` branch of this repo, build the Plexer image, and run it.

```bash
git clone https://github.com/magneticstain/plexer-cli.git
docker build -t plexer_cli .
docker run --rm -it plexer_cli
```

## Requirements

### Linux and MacOS Native Install

If you've installed plexer-cli natively (i.e. outside of a Docker container) on Ubuntu, Devian, Fedora, etc, or MacOS, you will also need to install additional dependencies:

#### Python-Magic

While `python-magic` is imported in the standard fashion (via pip/python requirements), it itself depends on the presence of the libmagic C library. To install this library, follow [the installation instructions provided in the `python-magic` README](https://github.com/ahupp/python-magic?tab=readme-ov-file#installation).

### Media Metadata

The most important requirement before running plexer is to ensure that you've created a `.plexer` file in each of your target directories.

This is a JSON-formatted file that includes the movie metadata required by Plexer to perform its jobs.

## Usage

The source directory is the directory containing the raw media. The destination is where you'd like to save the processed media to.

```text
usage: plexer.py [-h] [-v] [--version] -s SOURCE_DIR -d DESTINATION_DIR

options:
  -h, --help            show this help message and exit
  -v, --verbose         Verbosity (-v, -vv, etc)
  --version             show program's version number and exit
  -s SOURCE_DIR, --source-dir SOURCE_DIR
  -d DESTINATION_DIR, --destination-dir DESTINATION_DIR
```

## Support & Feedback

If you run into issues while using Plexer, think you know a way to make it better, or just need help using it, create a new issue within this project and they will triaged when possible.

## Development

### Software Stack

[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

For developing with Plexer, there are several tools that are in use:

1. Build Backend, Packaging, and Dependency Management:
   1. [Hatch](https://hatch.pypa.io/1.12/)
1. Analysis Tools:
   1. [Ruff](https://docs.astral.sh/ruff/)
1. Testing:
   1. [Pytest](https://docs.pytest.org/en/latest/)
   1. [Tox](https://tox.wiki/en/stable/)

### Coding Standards and Conventions

- Pre-commit hooks are utilized and managed in `.pre-commit-config.yml`
  - For example, `ruff` is run as part of every commit
  - These pre-commit hooks **MUST** be installed and utilized by all developers

#### Testing

- All functions **MUST** have unit tests created for them
- Tests are executed using **VS Code** with the `launch.json` config file in `.vscode`
