librarian: Move/rename according a set of rules

[ data, library, program ] [ Propose Tags ] [ Report a vulnerability ]

Move/rename according a set of rules.


[Skip to Readme]

Modules

  • Librarian

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log changelog.md
Dependencies base (>=4 && <5), containers, dhall (>=1 && <2), directory, easy-file, either (>=5 && <6), Glob, librarian, optparse-applicative, pretty-show, regexpr, text, time [details]
Tested with ghc ==9.2.8
License ISC
Author Gautier DI FOLCO
Maintainer gautier.difolco@gmail.com
Category Data
Home page http://github.com/blackheaven/librarian
Uploaded by gdifolco at 2024-09-25T18:20:40Z
Distributions
Executables librarian-exe
Downloads 110 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2024-09-25 [all 2 reports]

Readme for librarian-0.1.0.1

[back to package description]

Librarian

Move/rename according a set of rules.

Example

With example/cctv.dhall:

let L = ../format.dhall

in  [ L.Rule::{
      , name = "All footages"
      , match = "CCTV/**/*.*m*"
      , actions =
        [ L.Action.Type.Move
            { inputPattern = "CCTV/(.*)/(\\d+)\\.mp4"
            , newName = "sorted/\\2/\\1.mp4"
            }
        ]
      }
    ]
$ librarian -r examples/cctv.dhall
Move [All footages] './CCTV/garage/220520.mp4' -> './sorted/220520/garage.mp4'
Move [All footages] './CCTV/garage/220521.mp4' -> './sorted/220521/garage.mp4'
Move [All footages] './CCTV/garage/220522.mp4' -> './sorted/220522/garage.mp4'
Move [All footages] './CCTV/garage/220523.mp4' -> './sorted/220523/garage.mp4'
Move [All footages] './CCTV/garden/220520.mp4' -> './sorted/220520/garden.mp4'
Move [All footages] './CCTV/garden/220521.mp4' -> './sorted/220521/garden.mp4'
Move [All footages] './CCTV/garden/220522.mp4' -> './sorted/220522/garden.mp4'
Move [All footages] './CCTV/garden/220523.mp4' -> './sorted/220523/garden.mp4'
Perform? (y/n)