Welcome to ebook_homebrew’s documentation!

ebook_homebrew is command line interface which change file name to only digit name like 001.jpg and make e-book format files.

_images/logo.png

Badges:

http://img.shields.io/badge/license-MIT-blue.svg?style=flat https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square https://travis-ci.org/tubone24/ebook_homebrew.svg?branch=master https://codecov.io/gh/tubone24/ebook_homebrew/branch/master/graph/badge.svg Maintainability Test Coverage https://img.shields.io/codeclimate/tech-debt/tubone24/ebook_homebrew.svg?style=flat https://scrutinizer-ci.com/g/tubone24/ebook_homebrew/badges/quality-score.png?b=master https://scrutinizer-ci.com/g/tubone24/ebook_homebrew/badges/code-intelligence.svg?b=master https://ci.appveyor.com/api/projects/status/mx93pu69tqkngjxv?svg=true https://img.shields.io/appveyor/tests/tubone24/ebook-homebrew.svg?style=flat https://dev.azure.com/meitantei-conan/ebook_homebrew/_apis/build/status/tubone24.ebook_homebrew?branchName=master https://img.shields.io/azure-devops/tests/meitantei-conan/ebook_homebrew/1.svg?compact_message&style=flat https://api.shippable.com/projects/5c64353c33944406008b4ae8/badge?branch=master https://circleci.com/gh/tubone24/ebook_homebrew.svg?style=svg https://img.shields.io/lgtm/alerts/g/tubone24/ebook_homebrew.svg?logo=lgtm&logoWidth=18 https://img.shields.io/lgtm/grade/python/g/tubone24/ebook_homebrew.svg?logo=lgtm&logoWidth=18 https://snyk.io/test/github/tubone24/ebook_homebrew/badge.svg?targetFile=requirements.txt Documentation Status https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/pypi/dm/ebook-homebrew.svg Latest PyPI version https://img.shields.io/pypi/pyversions/ebook-homebrew.svg https://img.shields.io/pypi/format/ebook-homebrew.svg https://img.shields.io/gitter/room/tubone24/ebook_homebrew.svg https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg https://beerpay.io/tubone24/ebook_homebrew/badge.svg https://dply.me/yv0jty/button/small dockerhub

Installation

Warnings

Warning

Ebook_homebrew Only compatible Python 3.6 and 3.7 now.

Basic Installation

Note

The following instructions will install ebook_homebrew.

Install ebook_homebrew with pip:

$ pip install ebook-homebrew

Windows Installation

We provide ebook_homebrew binaries for Windows compiled for the matrix of supported Pythons in both 32 and 64-bit versions in wheel, egg, and executable installers.

> pip install ebook-homebrew

macOS Installation

We provide binaries for macOS for each of the supported Python 3.5 and 3.6 in the wheel format.

$ pip install ebook-homebrew

Linux Installation

We provide binaries for Linux for each of the supported Python versions in the manylinux wheel format.

$ pip install ebook-homebrew

Building From Source

Download and extract the `Github.com`_ .

If you want to compile from source, use python setup.py install

$ python setup.py install

Overview

The Ebook HomeBrew provides you functional Command-line interface (CLI) which change file name to only digit name like 001.jpg and make e-book format files. And also you can import this modules and use your python codes.

Changing filename only to digit

Change file name contains digit like foo001bar.txt to only digit file name like 001.txt.

Also provides you to duplicate file name change manually and add specify string before or after file name after using above method.

Making PDF by digit image files

Make pdf file which you use e-books by take in some image files such as jpeg, png and gif.

Making Zip by digit files

Make zip file for files which you choose extension.

Provides Rest API

Provides Rest API interfaces.

How to use

After installation, you can use command line ebookhomebrew

Show help

Command option -h shows helps.

$ ebookhomebrew -h

ebookhomebrew command line interfaces provides subcommand.

Choose subcommands. Usually choose "auto"

{auto,api,makezip}
 auto      Make only digit file name, convert e-book file such as PDF
 api               Provides Rest API interfaces
 makezip           Make zip file for adding specify extension files.

Also provides Options auto.

-h, --help            show this help message and exit
-s SRC_DIR, --src_dir SRC_DIR
                      Source directory which put original image files.
--dst_dir DST_DIR     Destination directory which put e-book file.
-d N,N, --digit N,N   Serial number digits you remain file name
-e EXT, --extension EXT
                      Destination directory which put e-book file.
-f FILENAME, --filename FILENAME
                      Destination directory which put e-book file.
-m, --manual          Duplicate file name, solving manually.
-r, --remove          Remove original image file.
-y, --assume_yes      no verify users.

Also provides Options api.

-h, --help            show this help message and exit
-p PORT, --port PORT  API Server Port

Auto command

Rename image file to only digit and Create PDF file.

$ ebookhomebrew auto -s ./tests -d 3,4 -e jpg -f test.pdf

API command

Run API Server.

$ ebookhomebrew api -p 8080

Rest API Reference

API Reference

GET /status

Get Status

Status Codes
GET /data/upload/list

Get file list

Status Codes
POST /data/upload

Base64 encoded Images

Status Codes
POST /convert/pdf

Upload Id witch get upload images and ContentType

Status Codes
POST /convert/pdf/download

Upload Id witch get upload images

Status Codes

Client

Example Client App

You can use Ebook Homebrew Rest API for example client app.

Note

Examples App use ebook-homebrew demo heroku endpoint. If you use your own server, fork the code and change the backend URL.

Git clone Example app with :command:`git clone `:

$ git clone https://github.com/tubone24/ebook_homebrew.git
$ git submodule update --init --recursive

Stand Alone Web GUI

The basic WEB app which create PDF from your images built in the ebook-homebrew.

Install Flask and Execute commands below.

$ cd examples/web_gui/
$ pip install requirements.txt
$ cd src
$ python application.py

And Access localhost:8080

You can see The TOP page like blow. Click GO DEMO APP

_images/standalone-top.png

Choose Files, digits and extension. Click Create! and Downloading result.pdf

_images/standalone-choose-img.png

Command Line Tools with using Rest API

Client App with ebook-homebrew’s rest API interface. Install requests and docopt and Execute.

$ cd examples/use_rest_api/
$ pip install requirements.txt
$ cd src
$ python main.py -h

You can see the CLI’s Usage.

Android App

Warning

This app is created flutter, so you can build an Android app and an iOS app,

but I don’t try to build ios app, because I don’t have ios.

Demo client Native App for using ebook-homebrew.

Install Flutter SDK and Build App:

$ cd examples/ebook-homebrew-android-app
$ git clone -b beta https://github.com/flutter/flutter.git ~/flutter
$ cat YOUR_APP_KEY > android/app/apk_key.jks
$ cat YOUR_APP_PROPS > android/key.properties
$ ~/flutter/bin/flutter build apk --release --split-per-abi
Try it on your device via DeployGate

Or Download Google Play

Run App and Enjoy!

_images/flutter-android.gif

Web Front App (Vue.js)

Warning

ebook-homebrew-vue-client is Deprecated instead of ebook-homebrew-vue-typescript-client

If you want to use Web Front App, you can make reference of Example app building for Vue.js.

You can see 2 examples, Vue.js with Javascript or Vue.js with Typescript

Vue.js with Javascript

Vue.js with Typescript

Install Node.js and NPM and Execute it:

$ cd examples/ebook-homebrew-vue-typescript-client
$ npm install
$ npm run serve

Run App and Enjoy!

_images/vue-sample.gif

Command Line Tool using Rust

If you want to use more speedy CLI, Use Rust CLI

Install Rust and Execute commands below.

$ cd examples/ebook-homebrew-rust-client/
$ cargo run
$ cd target/debug
$ ./ebook-homebrew-rust-client -h

ebook_homebrew_rust_client 0.1.0
tubone24 <tubo.yyyuuu@gmail.com>
Ebook-homebrew Command Line Tools

USAGE:
    ebook-homebrew-rust-client.exe [SUBCOMMAND]

FLAGS:
    -v, --version    CLI version
    -h, --help       Prints help information

SUBCOMMANDS:
    status      check server status
    upload      upload image files
    convert     convert image files to PDF
    download    download converted PDF file
    help        Prints this message or the help of the given subcommand(s)

Deploy to Heroku

Deploy for CLI

Note

Before push heroku button, create your Heroku account.

Install Heroku for CLI

$ heroku create <app name>
$ heroku stack:set container
$ git push heroku master
$ heroku open

Deploy Heroku button

Or Push a Heroku button below

Release Notes

Note

Contributors please include release notes as needed or appropriate with your bug fixes, feature additions and tests.

1.0.0

First release

First release.

1.1.0

Async rename

  • Rename to digit filename a little bit speedy for using asyncio

  • More Testcase(Windows)

2.0.0

API Server

  • REST API Server interface

2.1.0

Sqlite3

  • Use Sqlite3 and save uploadID

  • Typescript Demo app

Indices and tables