Skip to main content

# leanpub cli

Build leanpub books locally from the command line.

> Note/Disclaimer: This is not an official Leanpub product, it simply uses > pandoc to build a pdf from markdown in a similar way to Leanpub. Currently > the output from leanpub is different in style (and this will probably > always be the case), however I find that it massively speeds up the iteration > process to be able to build a pdf which looks “similar enough” to Leanpub.

This implements a simple cli for building ebooks locally. Rather than having upload your new change-set to Dropbox and then trigger leanpub build on their site - do it all locally.

## Usage

To build the Book (this requires a Book.txt):

`sh $ leanpub book `

To build the Sample (this requires a Sample.txt):

`sh $ leanpub sample `

To build both:

`sh $ leanpub all `

You can also “watch” for changes in any of the markdown files you are using to build the book i.e. when a markdown file is saved:

`sh $ leanpub watch `

You can get help via the command line with:

`sh $ leanpub --help `

## Installation

Install via [pip](https://pip.pypa.io/en/latest/installing.html):

`sh $ pip install leanpub `

Note: if you don’t have python installed I recommend [miniconda](http://conda.pydata.org/miniconda.html); no-admin access required.

This requires that pandoc is installed, if it’s not install it [here](http://pandoc.org/installing.html).

## Issues / troubleshooting / requests

Please post an [issue on github](https://github.com/hayd/leanpub).

### Going forward

I would like to improve the output to better match leanpub. Any help it that direction (e.g. css, or prepending the title page) would be great!

Metadata

Release files for leanpub 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leanpub 0.2.0
File Size Uploaded Provenance
leanpub-0.2.0.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for leanpub 0.2.0
File Interpreter ABI Platform
leanpub-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 9.9 kB

Release files / leanpub-0.2.0.tar.gz

Download URL leanpub-0.2.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c20dbe46db31d28fd45b511f57748af4c0a35fa7f16a8873ddaf7056389d9f57
BLAKE2b-256 checksum
How to use checksums
cb2f65d6b6bce2bb8e50e49a98289d59a4ae7d2facde7242294d0c139efe20f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release files / leanpub-0.2.0-py2.py3-none-any.whl

Download URL leanpub-0.2.0-py2.py3-none-any.whl
Size 4.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c2b831b4bf602c0db859b099b6bfdf725eb7e8fdf801d259eeb0a902833ec4de
BLAKE2b-256 checksum
How to use checksums
645ea1d438adb2ca36b18a66454cfe730f4e94acd747e4fa8f8793b58414cdce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Security for leanpub 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page