Catalog PyPI
PACKAGE EXPLORERView in registry

abs-organize

PyPI

Organize downloaded audiobooks into Audiobookshelf library layout

audiobooksaudiobookshelfclilibrarymetadata
Versions collected1
Direct dependencies3From release 0.1.1
Last observed20 Oct, 17:38 UTC

README

Version 0.1.1 documentation

abs-organize

CLI to place downloaded audiobooks into an Audiobookshelf library layout from embedded tags (and optional folder-name guesses). Copy is the default; use --move to clear the inbox after a successful run.

Layout: {library}/{Author}/[{Series}/]{TitleFolder}/

Requirements: Python 3.11+

Quick start

pip install abs-organize

# One-off (no config file)
abs-organize ~/Downloads/book.m4b --library ~/Audiobooks --dry-run
abs-organize ~/Downloads/book.m4b --library ~/Audiobooks

# With config (see Configuration)
abs-organize ~/Downloads/inbox/MyBook.m4b

Install

From PyPI (recommended):

pip install abs-organize

From a clone:

pip install -e .

For development and tests, see Development.

Usage

abs-organize INPUT [options]

INPUT — one audio file (.mp3, .m4b, .m4a, .flac, .ogg) or a folder of tracks.

OptionPurpose
--library PATHLibrary root for this run (overrides config and env)
--profile NAMENamed [libraries.*] profile (default profile when omitted)
--dry-runShow library, destination, and planned ops; no writes
--moveMove into the library instead of copy (rename on same FS)
--replaceDelete existing destination title folder, then organize
--allow-guessGuess author/title from folder or file name when tags are missing
--batchOrganize every detected book under INPUT (multi-book inbox)
--continue-on-errorWith --batch, keep going after a failure (apply runs only)
--jsonSuccess payload on stdout (scripting)
-v, --verbosePath sanitization details on stderr

Metadata overrides (single-book runs): --author, --title, --year, --series, --sequence, --narrator. With --batch, --series, --narrator, and --year may gap-fill empty fields per book; --author, --title, and --sequence are rejected.

Preview, copy, and move

abs-organize ~/Downloads/inbox/SomeBook --dry-run --library ~/Audiobooks
abs-organize ~/Downloads/inbox/SomeBook --library ~/Audiobooks
abs-organize ~/Downloads/inbox/SomeBook --library ~/Audiobooks --move

--dry-run uses the same validation as a real run and prints warnings to stderr, but does not create library paths or transfer files.

Batch inbox

If INPUT contains multiple book roots (e.g. several .m4b siblings), a plain run fails with a candidate list. Use --batch to organize all detected books:

abs-organize ~/Downloads/inbox --batch --library ~/Audiobooks --dry-run
abs-organize ~/Downloads/inbox --batch --library ~/Audiobooks --move

Dry-run always reports every book. On apply, batch stops at the first failure unless --continue-on-error is set.

Discovery (summary): each .m4b/.m4a sibling is its own book; .mp3/.flac/.ogg siblings in one folder are one book; Disc/CD/Disk subfolders roll up to one book at the parent.

Metadata and guessing

Tags are read with Mutagen:

Folder segmentTags
Authoralbumartist or artist
Title folderalbum or title (+ optional subtitle via config)
Seriesgrouping; sequence/year/narrator from tags, movement atoms (.m4b/.m4a), or OPF when present

When album or title ends with a trailing narrator clause — (read by …), (narrated by …), or (performed by …) (or the same phrases in square brackets) — that clause is removed from the title folder name. The extracted name becomes narrator only if the composer tag is empty; if composer is set, it wins for the {Narrator} segment and the suffix is still stripped from the title.

Missing author or title tags exit with an error unless --allow-guess is set. Guesses use patterns such as Author - Title or Author - Title (YYYY) on the book folder or file stem; stderr marks them (confidence: low). CLI overrides always win.

Example (series layout):

{library}/Terry Goodkind/Sword of Truth/Vol 1 - 1994 - Wizards First Rule {Sam Tsoutsouvas}/book.m4b

Sidecars (desc.txt, reader.txt, cover images) are copied when present.

Configuration

File: ~/.config/abs-organize/config.toml

include_subtitle_in_folder = false

[libraries.default]
path = "/Users/you/Audiobooks"

[libraries.fiction]
path = "/Users/you/Audiobooks/Fiction"
  • [libraries.default] is required when you omit --library.
  • include_subtitle_in_folder — append - {subtitle} to the title folder name.

Library path precedence

PrioritySource
1--library PATH
2ABS_ORGANIZE_LIBRARY (only when --profile is omitted)
3[libraries.{profile}].path when --profile NAME is set
4[libraries.default].path

Scripting (--json)

On success, stdout is JSON; errors stay on stderr (plain text). Warnings are in the JSON payload, not duplicated on stderr.

Single book:

{
  "destination": "/Users/you/Audiobooks/Jane Author/Book Title/",
  "files": ["book.mp3"],
  "warnings": []
}

Batch:

{
  "books": [
    {
      "source": "/inbox/Book A/",
      "ok": true,
      "destination": "/Audiobooks/Author/Title/",
      "files": ["book.m4b"],
      "warnings": []
    }
  ],
  "summary": { "ok": 1, "failed": 0 }
}

Unknown top-level keys may be added later; ignore fields you do not need.

Exit codes

CodeMeaning
0Success
1User or metadata error (missing tags, invalid paths, config/profile errors)
2I/O error (copy, move, or filesystem failure)

Batch: 0 only if every book succeeded; partial failure uses 1 or 2 if any book hit I/O errors.

Development

Release policy: see docs/RELEASE.md.

CI: GitHub Actions runs pytest on every push and pull request (.github/workflows/ci.yml). Require the CI status check to pass before merging to main (Settings → Branches → Branch protection rules).

PathRole
src/abs_organize/cli.pyArgument parsing and entry point
src/abs_organize/organize.pySingle-book copy/move pipeline
src/abs_organize/batch.pyMulti-book inbox orchestration
src/abs_organize/discovery.pyBook-root detection
src/abs_organize/metadata.pyTag read, validation, overrides
src/abs_organize/naming.pyABS-style path segments
tests/Pytest suite (test_data/ for fixtures)
pip install -e ".[dev]"
pytest
abs-organize --help

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.124 May 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
trevordavies095/abs-organize

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:38 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c37ac708b95906a55fd8b5b88777379d953abf9756ca9e23663c8cb7df6aa858