Skip to main content

# Install

```
pip install bookmd
```

# Usage

```
Usage: bookmd [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.

Commands:
init
query
template
transform
```

## `init`

initialize directory structure.

```
$ mkdir /some/directory
$ cd /some/directory
$ bookmd init
$ ls -al
total 0
drwxr-xr-x 4 haoxun staff 136 Dec 8 21:58 .
drwxr-xr-x 24 haoxun staff 816 Dec 8 21:56 ..
drwxr-xr-x 3 haoxun staff 102 Dec 8 20:35 .bookmd-db
drwxr-xr-x 3 haoxun staff 102 Dec 8 17:50 isbn
```

## `query`

drop one or more ISBN files to the `./isbn`, then run

```
$ bookmd query
```

this command would query douban api for book infos and cache the result to
`./.bookmd-db`.

## `template`

generate markdown template.


```
$ bookmd template list ./template.md
$ bookmd template list --keys='title,rating[average]' ./template.md
$ bookmd template table ./template.md
$ bookmd template table --keys='title,rating[average]' ./template.md
```

example of `list`:

```
* <!-- 算法设计与分析基础 --> {{ isbn="9787302311850" template="[{title}]({alt})" }}
* <!-- 金领简历 --> {{ isbn="9787115279262" template="[{title}]({alt})" }}
* <!-- R语言编程艺术 --> {{ isbn="9787111423140" template="[{title}]({alt})" }}
* <!-- 计算广告 --> {{ isbn="9787115392497" template="[{title}]({alt})" }}
* <!-- Word Power Made Easy --> {{ isbn="9781101873854" template="[{title}]({alt})" }}
```

example of `table`:

```
| title | author | rating |
| --- | --- | --- |
{{ isbn="9787302311850" template="| <!-- 算法设计与分析基础 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9787115279262" template="| <!-- 金领简历 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9787111423140" template="| <!-- R语言编程艺术 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9787115392497" template="| <!-- 计算广告 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9781101873854" template="| <!-- Word Power Made Easy --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
```

## `transform`

render templates.

```
$ bookmd transform ./template.md ./doc.md
```

example of generaeted:

```
* <!-- 算法设计与分析基础 --> [算法设计与分析基础](https://book.douban.com/subject/24708288/)
* <!-- 金领简历 --> [金领简历](https://book.douban.com/subject/10779571/)
* <!-- R语言编程艺术 --> [R语言编程艺术](https://book.douban.com/subject/24699632/)
* <!-- 计算广告 --> [计算广告](https://book.douban.com/subject/26596778/)
* <!-- Word Power Made Easy --> [Word Power Made Easy](https://book.douban.com/subject/25977798/)
```

Metadata

Release files for bookmd 0.1.1

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

Source distribution (sdist)

Source distribution for bookmd 0.1.1
File Size Uploaded
bookmd-0.1.1.tar.gz 8.1 kB Details

Built distribution (wheel)

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

Total release size: 17.2 kB

Release files / bookmd-0.1.1.tar.gz

Download URL bookmd-0.1.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2aef032c46b0a7b82fe191561ae0b11f95527bdea0843fe85fcf4aa5549afdc0
BLAKE2b-256 checksum
How to use checksums
46219598cf52924e366db977d390c938bdd44ebc5ebbf07956efd3b0f777020b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / bookmd-0.1.1-py2.py3-none-any.whl

Download URL bookmd-0.1.1-py2.py3-none-any.whl
Size 9.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c26afd6a5d5720371189955c30ccba336320e843b057159eea66e2a5362a1daa
BLAKE2b-256 checksum
How to use checksums
529a555645f7e0b4b7e40b11fe7d4d6af0daf31c7677416be524b737211d6541
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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