{"id":13586857,"url":"https://github.com/agilecreativity/ebook_renamer","last_synced_at":"2026-02-28T22:31:55.730Z","repository":{"id":15701997,"uuid":"18439855","full_name":"agilecreativity/ebook_renamer","owner":"agilecreativity","description":"Rename multiple ebooks (pdf, epub, mobi) based on embedded meta-data.","archived":false,"fork":false,"pushed_at":"2021-05-08T14:53:01.000Z","size":838,"stargazers_count":42,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-01T04:54:48.532Z","etag":null,"topics":["automation","calibre","calibre-cli","command-line","linux","rename-files","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agilecreativity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-04T13:30:32.000Z","updated_at":"2025-11-18T17:46:41.000Z","dependencies_parsed_at":"2022-08-25T08:41:35.097Z","dependency_job_id":null,"html_url":"https://github.com/agilecreativity/ebook_renamer","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/agilecreativity/ebook_renamer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Febook_renamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Febook_renamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Febook_renamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Febook_renamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilecreativity","download_url":"https://codeload.github.com/agilecreativity/ebook_renamer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Febook_renamer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29953287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","calibre","calibre-cli","command-line","linux","rename-files","ruby"],"created_at":"2024-08-01T15:05:51.717Z","updated_at":"2026-02-28T22:31:55.695Z","avatar_url":"https://github.com/agilecreativity.png","language":"Ruby","readme":"ebook_renamer\n=============\n\n[![Gem Version](https://badge.fury.io/rb/ebook_renamer.svg)][gem]\n[![Dependency Status](https://gemnasium.com/agilecreativity/ebook_renamer.png)][gemnasium]\n[![Code Climate](https://codeclimate.com/github/agilecreativity/ebook_renamer.png)][codeclimate]\n\n[gem]: http://badge.fury.io/rb/ebook_renamer\n[gemnasium]: https://gemnasium.com/agilecreativity/ebook_renamer\n[codeclimate]: https://codeclimate.com/github/agilecreativity/ebook_renamer\n\nBulk rename of ebook files (epub,mobi,pdf) using embedded meta-data (title, author(s)).\nThis version depends on the opensource software called [Calibre][] that comes\nwith [Calibre CLI][] which is very easy to install on OSX or Linux system.\n\nRelease based on [Semantic Versioning][] version.\n\n### How the file is renamed\n\nThe file will be renamed using the following format `\u003ctitle\u003e.by.\u003cauthor(s)\u003e`.`\u003cextension\u003e`\n\nAlso the final file name will be sanitized e.g. any multiple occurence of special characters will be\nreplace by given separator char (default to dot) .\n\nFor example if the ebook contain the title `Start with Why: How Grate Leader Inspire Everyone to Take Action`\nand the author is `Simon Sinek` then the default output will be\n`Start.with.Why.How.Great.Leader.Inspire.Everyone.to.Take.Action.by.Simon.Sinek.pdf`\nNote that the `:` and one space before the word `How` is replaced by one dot string.\n\nIf the `--sep-string _` is used then the above output will be\n`Start_with_Why_How_Great_Leader_Inspire_Everyone_to_Take_Action_by_Simon_Sinek.pdf`.\n\n### What you will need\n\n- You will need to install [Calibre][] and\n  [Calibre CLI][] on your OS. Please download Calibre binary from [http://calibre-ebook.com/download][]\n\nAlternatively if you are using Ubuntu try:\n\n```shell\nsudo apt-get install calibre calibre-bin\n\n# check your installation\nwhich ebook-meta #=\u003e /usr/bin/ebook-meta\n```\n\nIn particular the gem is looking for the `ebook-meta` binary in a path.\nIf this is not installed the error will be raised.\n\n#### Tips for OSX installation\n\nIf you install using the binary above you will need to create a symlink to the\n`ebook-meta` binary like the following:\n\n```shell\n# Assume that /usr/local/bin is in your $PATH varaiable\ncd /usr/local/bin\nsudo ln -fs /Applications/calibre.app/Contents/MacOS/ebook-meta /usr/local/bin/ebook-meta\nsource ~/.zshrc # or source ~/.bashrc\nwhich ebook-meta\n```\n\n### Installation and Usage:\n\n```sh\ngem install ebook_renamer\n\n# Show the list of options\nebook_renamer\n```\n\n### Usage/Synopsis\n\n```\nUsage:\n  ebook_renamer\n\nOptions:\n  -b, [--base-dir=BASE_DIR]              # Base directory\n                                         # Default: . (current directory)\n  -r, [--recursive], [--no-recursive]    # Search for files recursively\n                                         # Default: --recursive\n  -s, [--sep-string=SEP_STRING]          # Separator string between each word in output filename\n                                         # Default: '_' (underscore)\n  -d, [--downcase], [--no-downcase]      # Convert each word in the output filename to lowercase\n                                         # Default: --no-downcase\n  -t, [--capitalize], [--no-capitalize]  # Capitalize each word in the output filename\n                                         # Default: --no-capitalize\n  -c, [--commit], [--no-commit]          # Make your changes permanent\n                                         # Default: --no-commit\n  -v, [--version], [--no-version]        # Display version information\n\nRename multiple ebook files (pdf,epub,mobi) from a given directory\n```\n\n### Quick Usage\n\nThe shortest command that you can run to rename files is\n\n```sh\n# This will rename any ebook files under the directory `~/Dropbox/ebooks`\n# and any sub-directory for (*.epub, *.pdf, *.mobi) using the default settings\ncd ~/Dropbox/ebooks\nebook_renamer --commit\n```\n\nTo see what the result would be like without making any changes (dry-run)\n\n```sh\ncd ~/Dropbox/ebooks/\nebook_renamer --base-dir .\n```\n\nShould see the result like\n\n```\n-----------------------------------------------------------\n FYI: no changes as this is a dry-run, please use --commit\n-----------------------------------------------------------\n1 of 4 old name : ./demo1.pdf\n1 of 4 new name : ./Fearless.Refactoring.by.Andrzej.Krzywda.pdf\n2 of 4 old name : ./demo2.epub\n2 of 4 new name : ./EPUB.3.0.Specification.by.EPUB.3.Working.Group.epub\n3 of 4 old name : ./subdir/demo3.pdf\n3 of 4 new name : ./subdir/Reliably.Deploying.Rails.Applications.by.Ben.Dixon.pdf\n4 of 4 old name : ./subdir/demo4.epub\n4 of 4 new name : ./subdir/EPUB.3.0.Specification.by.EPUB.3.Working.Group.epub\n```\n\nwith `--sep-string` option\n\n```sh\ncd ~/Dropbox/ebooks/\nebook_renamer --base-dir . --sep-string _\n```\n\nshould result in something like\n\n```\n-----------------------------------------------------------\n FYI: no changes as this is a dry-run, please use --commit\n-----------------------------------------------------------\n1 of 4 old name : ./demo1.pdf\n1 of 4 new name : ./Fearless_Refactoring_by_Andrzej_Krzywda.pdf\n2 of 4 old name : ./demo2.epub\n2 of 4 new name : ./EPUB_3_0_Specification_by_EPUB_3_Working_Group.epub\n3 of 4 old name : ./subdir/demo3.pdf\n3 of 4 new name : ./subdir/Reliably_Deploying_Rails_Applications_by_Ben_Dixon.pdf\n4 of 4 old name : ./subdir/demo4.epub\n4 of 4 new name : ./subdir/EPUB_3_0_Specification_by_EPUB_3_Working_Group.epub\n```\n\n### Detail Usage\n\nRun the following command from the directory that contain the file(s) that\nyou want to rename.\n\n```sh\n# Cd to the directory containing the file(s) you like to rename\ncd ~/Dropbox/ebooks/\n\n# Or specify the directory as an option from any where if you set appropriate\n# version of ruby (e.g. rbenv local 2.1.1 or rvm use 2.1.1)\nebook_renamer --base-dir ~/Dropbox/ebooks/samples\n\n# Run the command without making any changes to the files (dry-run) in the current directory\nebook_renamer --base-dir . --recursive\n\n# Once you are happy with the result then\nebook_renamer --base-dir . --recursive --commit\n\n# Or using the short version\nebook_renamer -b . -r -c\n```\n\n### Misc Options\n\nIn addition to the above usage, you can also use the two new flags `--downcase` or\n`--capitalize`\n\n```shell\n# Lowercase each word in the result filename\nebook_renamer --base-dir . --sep-string '_' --recursive --downcase --commit\n```\n\nwill produce the result filename like `start_with_why_how_great_leader_inspire_everyone_to_take_action_by_simon_sinek.pdf`.\n\n```shell\n# Capitalize each word in the result filename\nebook_renamer --base-dir . --sep-string '_' --recursive --capitalize --commit\n```\n\nwill produce the result filename like `Start_With_Why_How_Great_Leader_Inspire_Everyone_To_Take_Action_by_Simon_Sinek.pdf`.\n\n### Alternative\n\n- Check out my other gem called [ebooks_renamer][] which provides similar functionality but implemented in pure ruby.\n- [ebooks_renamer][] does not rely on the external software like [Calibre CLI][] to be install before use!\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Make sure that you add the tests and ensure that all tests are passed\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n\n[Calibre]: http://www.calibre-ebook.com/\n[Calibre CLI]: http://manual.calibre-ebook.com/cli/cli-index.html\n[http://calibre-ebook.com/download]: http://calibre-ebook.com/download\n[ebooks_renamer]: http://rubygems.org/gems/ebooks_renamer\n[Semantic Versioning]: http://semver.org\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Febook_renamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilecreativity%2Febook_renamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Febook_renamer/lists"}