standardebooks


Namestandardebooks JSON
Version 2.6.4 PyPI version JSON
download
home_pagehttps://standardebooks.org
SummaryThe toolset used to produce Standard Ebooks epub ebooks.
upload_time2024-05-16 21:38:40
maintainerNone
docs_urlNone
authorStandard Ebooks
requires_python<=3.12,>=3.8
licenseNone
keywords ebooks epub
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # About

A collection of tools Standard Ebooks uses to produce its ebooks, including basic setup of ebooks, text processing, and build tools.

Installing this toolset using `pipx` makes the `se` command line executable available. Its various commands are described below, or you can use `se help` to list them.

# Installation

The toolset requires Python >= 3.8 and <= 3.12.

To install the toolset locally for development and debugging, see [Installation for toolset developers](#installation-for-toolset-developers).

Optionally, install [Ace](https://daisy.github.io/ace/) and the `se build --check` command will automatically run it as part of the checking process.

## Ubuntu 20.04 (Trusty) users

```shell
# Install some pre-flight dependencies.
sudo apt install -y calibre default-jre git python3-dev python3-pip python3-venv

# Install pipx.
python3 -m pip install --user pipx
python3 -m pipx ensurepath

# Install the toolset.
pipx install standardebooks
```

### Optional: Install shell completions

```shell
# Install ZSH completions.
sudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/zsh/_se /usr/share/zsh/vendor-completions/_se && hash -rf && compinit

# Install Bash completions.
sudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/bash/se /usr/share/bash-completion/completions/se

# Install Fish completions.
ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/fish/se $HOME/.config/fish/completions/se.fish
```

## Fedora users

```shell
# Install some pre-flight dependencies.
sudo dnf install calibre git java-1.8.0-openjdk python3-devel

# Install pipx.
python3 -m pip install --user pipx
python3 -m pipx ensurepath

# Install the toolset.
pipx install standardebooks
```

### Optional: Install shell completions

```shell
# Install ZSH completions.
sudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/zsh/_se /usr/share/zsh/vendor-completions/_se && hash -rf && compinit

# Install Bash completions.
sudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/bash/se /usr/share/bash-completion/completions/se

# Install Fish completions.
ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/fish/se $HOME/.config/fish/completions/se.fish
```

## macOS users

1. Install the [Homebrew package manager](https://brew.sh). Or, if you already have it installed, make sure it’s up to date:

	```shell
	brew update
	```

2. Install dependencies:

	```shell
	# Install some pre-flight dependencies.
	brew install cairo calibre git openjdk pipx python@3.11
	pipx ensurepath
	sudo ln -sfn $(brew --prefix)/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

	# Install the toolset.
	pipx install --python python3.11 standardebooks

	# Optional: Bash users who have set up bash-completion via brew can install tab completion.
	ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/bash/se $(brew --prefix)/etc/bash_completion.d/se

	# Optional: Fish users can install tab completion.
	ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/fish/se $HOME/.config/fish/completions/se.fish
	```

## OpenBSD 6.6 Users

These instructions were tested on OpenBSD 6.6, but may also work on the 6.5 release as well.

1. Create a text file to feed into ```pkg_add``` called `~/standard-ebooks-packages`. It should contain the following:

	```shell
	py3-pip--
	py3-virtualenv--
	py3-gitdb--
	jdk--%11
	calibre--
	git--
	```

2. Install dependencies using ```doas pkg_add -ivl ~/standard-ebooks-packages```. Follow linking instructions provided by ```pkg_add``` to save keystrokes, unless you want to have multiple python versions and pip versions. In my case, I ran ```doas ln -sf /usr/local/bin/pip3.7 /usr/local/bin/pip```.

3. Add ```~/.local/bin``` to your path.

4. Run ```pip install --user pipx```

5. If you’re using ```ksh``` from base and have already added ```~/.local/bin```, you can skip ```pipx ensurepath``` because this step is for ```bash``` users.

6. The rest of the process is similar to that used on other platforms:

	```shell
	# Install the toolset.
	pipx install standardebooks
	```

## Installation for toolset developers

If you want to work on the toolset source, it’s helpful to tell `pipx` to install the package in “editable” mode. This will allow you to edit the source of the package live and see changes immediately, without having to uninstall and re-install the package.

To do that, follow the general installation instructions above; but instead of doing `pipx install standardebooks`, do the following:

```shell
git clone https://github.com/standardebooks/tools.git
pipx install --editable ./tools
```

Now the `se` binary is in your path, and any edits you make to source files in the `tools/` directory are immediately reflected when executing the binary.

### Running commands on the entire corpus

As a developer, it’s often useful to run an `se` command like `se lint` or `se build` on the entire corpus for testing purposes. This can be very time-consuming in a regular invocation (like `se lint /path/to/ebook/repos/*`), because each argument is processed sequentially. Instead of waiting for a single invocation to process all of its arguments sequentially, use [GNU Parallel](https://www.gnu.org/software/parallel/) to start multiple invocations in parallel, with each one processing a single argument. For example:

```shell
# Slow, each argument is processed in sequence
se lint /path/to/ebook/repos/*

# Fast, multiple invocations each process a single argument in parallel
export COLUMNS; parallel --keep-order se lint ::: /path/to/ebook/repos/*
```

The toolset tries to detect when it’s being invoked from `parallel`, and it adjusts its output to accomodate.

We export `COLUMNS` because `se lint` needs to know the width of the terminal so that it can format its tabular output correctly. We pass the `--keep-order` flag to output results in the order we passed them in, which is useful if comparing the results of multiple runs.

### Linting with `pylint` and `mypy`

Before we can use `pylint` or `mypy` on the toolset source, we have to inject them (and additional typings) into the venv `pipx` created for the `standardebooks` package:

```shell
pipx inject standardebooks pylint==2.17.3 mypy==1.2.0 types-requests==2.28.11.17 types-setuptools==67.7.0.0 types-Pillow==10.2.0.20240331
```

Then make sure to call the `pylint` and `mypy` binaries that `pipx` installed in the `standardebooks` venv, *not* any other globally-installed binaries:

```shell
cd /path/to/tools/repo
$HOME/.local/pipx/venvs/standardebooks/bin/pylint tests/*.py se
```

### Testing with `pytest`

Instructions are found in the testing [README](tests/README.md).

### Code style

- In general we follow a relaxed version of [PEP 8](https://www.python.org/dev/peps/pep-0008/). In particular, we use tabs instead of spaces, and there is no line length limit.

- Always use the `regex` module instead of the `re` module.

# Help wanted

We need volunteers to take the lead on the following goals:

- Add more test cases to the test framework.

- Writing installation instructions for Bash and ZSH completions for MacOS.

- Currently the toolset requires the whole Calibre package, which is very big, but it’s only used to convert epub to azw3. Can we inline Calibre’s azw3 conversion code into our `./vendor/` directory, to avoid having to install the entire Calibre package as a big dependency? If so, how do we keep it updated as Calibre evolves?

- Over the years, `./se/se_epub_build.py` has evolved to become very large and unwieldy. Is there a better, clearer way to organize this code?

# Tool descriptions

-	### `se british2american`

	Try to convert British quote style to American quote style in `DIRECTORY/src/epub/text/`.

	Quotes must already be typogrified using the `se typogrify` tool.

	This script isn’t perfect; proofreading is required, especially near closing quotes near to em-dashes.

-	### `se build`

	Build an ebook from a Standard Ebook source directory.

-	### `se build-ids`

	Change ID attributes for non-sectioning content to their expected values across the entire ebook. IDs must be globally unique and correctly referenced, and the ebook spine must be complete.

-	### `se build-images`

	Build ebook cover and titlepage images in a Standard Ebook source directory and place the output in `DIRECTORY/src/epub/images/`.

-	### `se build-manifest`

	Generate the `<manifest>` element for the given Standard Ebooks source directory and write it to the ebook’s metadata file.

-	### `se build-spine`

	Generate the `<spine>` element for the given Standard Ebooks source directory and write it to the ebook’s metadata file.

-	### `se build-title`

	Generate the title of an XHTML file based on its headings and update the file’s `<title>` element.

-	### `se build-toc`

	Generate the table of contents for the ebook’s source directory and update the ToC file.

-	### `se clean`

	Prettify and canonicalize individual XHTML, SVG, or CSS files, or all XHTML, SVG, or CSS files in a source directory.

-	### `se compare-versions`

	Use Firefox to render and compare XHTML files in an ebook repository. Run on a dirty repository to visually compare the repository’s dirty state with its clean state. If a file renders differently, place screenshots of the new, original, and diff (if available) renderings in the current working directory. A file called diff.html is created to allow for side-by-side comparisons of original and new files.

-	### `se create-draft`

	Create a skeleton of a new Standard Ebook.

-	### `se css-select`

	Print the results of a CSS selector evaluated against a set of XHTML files.

-	### `se dec2roman`

	Convert a decimal number to a Roman numeral.

-	### `se extract-ebook`

	Extract an .epub, .mobi, or .azw3 ebook into `./FILENAME.extracted/` or a target directory.

-	### `se find-mismatched-dashes`

	Find words with mismatched dashes in a set of XHTML files. For example, `extra-physical` in one file and `extraphysical` in another.

-	### `se find-mismatched-diacritics`

	Find words with mismatched diacritics in a set of XHTML files. For example, `cafe` in one file and `café` in another.

-	### `se find-unusual-characters`

	Find characters outside a nominal expected range in a set of XHTML files. This can be useful to find transcription mistakes and mojibake.

-	### `se help`

	List available SE commands.

-	### `se hyphenate`

	Insert soft hyphens at syllable breaks in an XHTML file.

-	### `se interactive-replace`

	Perform an interactive search and replace on a list of files using Python-flavored regex. The view is scrolled using the arrow keys, with alt to scroll by page in any direction. Basic Emacs (default) or Vim style navigation is available. The following actions are possible: (y) Accept replacement. (n) Reject replacement. (a) Accept all remaining replacements in this file. (r) Reject all remaining replacements in this file. (c) Center on match. (q) Save this file and quit.

-	### `se lint`

	Check for various Standard Ebooks style errors.

-	### `se make-url-safe`

	Make a string URL-safe.

-	### `se modernize-spelling`

	Modernize spelling of some archaic words, and replace words that may be archaically compounded with a dash to a more modern spelling. For example, replace `ash-tray` with `ashtray`.

-	### `se prepare-release`

	Calculate work word count, insert release date if not yet set, and update modified date and revision number.

-	### `se recompose-epub`

	Recompose a Standard Ebooks source directory into a single HTML5 file, and print to standard output.

-	### `se renumber-endnotes`

	Renumber all endnotes and noterefs sequentially from the beginning.

-	### `se roman2dec`

	Convert a Roman numeral to a decimal number.

-	### `se semanticate`

	Apply some scriptable semantics rules from the Standard Ebooks semantics manual to a Standard Ebook source directory.

-	### `se shift-endnotes`

	Increment or decrement the specified endnote and all following endnotes by 1 or a specified amount.

-	### `se split-file`

	Split an XHTML file into many files at all instances of `<!--se:split-->`, and include a header template for each file.

-	### `se titlecase`

	Convert a string to titlecase.

-	### `se typogrify`

	Apply some scriptable typography rules from the Standard Ebooks typography manual to a Standard Ebook source directory.

-	### `se unicode-names`

	Display Unicode code points, descriptions, and links to more details for each character in a string. Useful for differentiating between different flavors of spaces, dashes, and invisible characters like word joiners.

-	### `se word-count`

	Count the number of words in an HTML file and optionally categorize by length.

-	### `se xpath`

	Print the results of an xpath expression evaluated against a set of XHTML files. The default namespace is removed.

# What a Standard Ebooks source directory looks like

Many of these tools act on Standard Ebooks source directories. Such directories have a consistent minimal structure:

```
.
|__ images/
|   |__ cover.jpg
|   |__ cover.source.jpg
|   |__ cover.svg
|   |__ titlepage.svg
|
|__ src/
|   |__ META-INF/
|   |   |__ container.xml
|   |
|   |__ epub/
|   |   |__ css/
|   |   |   |__ core.css
|   |   |   |__ local.css
|   |   |   |__ se.css
|   |   |
|   |   |__ images/
|   |   |   |__ cover.svg
|   |   |   |__ logo.svg
|   |   |   |__ titlepage.svg
|   |   |
|   |   |__ text/
|   |   |   |__ colophon.xhtml
|   |   |   |__ imprint.xhtml
|   |   |   |__ titlepage.xhtml
|   |   |   |__ uncopyright.xhtml
|   |   |
|   |   |__ content.opf
|   |   |__ onix.xml
|   |   |__ toc.xhtml
|   |
|   |__ mimetype
|
|__ LICENSE.md
```

`./images/` contains source images for the cover and titlepages, as well as ebook-specific source images. Source images should be in their maximum available resolution, then compressed and placed in `./src/epub/images/` for distribution.

`./src/epub/` contains the actual epub files.
            

Raw data

            {
    "_id": null,
    "home_page": "https://standardebooks.org",
    "name": "standardebooks",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<=3.12,>=3.8",
    "maintainer_email": null,
    "keywords": "ebooks epub",
    "author": "Standard Ebooks",
    "author_email": "admin@standardebooks.org",
    "download_url": "https://files.pythonhosted.org/packages/c9/c5/ecffb03139446c72ead4914d692d969e81b8c0907d972e73075a48caf708/standardebooks-2.6.4.tar.gz",
    "platform": null,
    "description": "# About\n\nA collection of tools Standard Ebooks uses to produce its ebooks, including basic setup of ebooks, text processing, and build tools.\n\nInstalling this toolset using `pipx` makes the `se` command line executable available. Its various commands are described below, or you can use `se help` to list them.\n\n# Installation\n\nThe toolset requires Python >= 3.8 and <= 3.12.\n\nTo install the toolset locally for development and debugging, see [Installation for toolset developers](#installation-for-toolset-developers).\n\nOptionally, install [Ace](https://daisy.github.io/ace/) and the `se build --check` command will automatically run it as part of the checking process.\n\n## Ubuntu 20.04 (Trusty) users\n\n```shell\n# Install some pre-flight dependencies.\nsudo apt install -y calibre default-jre git python3-dev python3-pip python3-venv\n\n# Install pipx.\npython3 -m pip install --user pipx\npython3 -m pipx ensurepath\n\n# Install the toolset.\npipx install standardebooks\n```\n\n### Optional: Install shell completions\n\n```shell\n# Install ZSH completions.\nsudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/zsh/_se /usr/share/zsh/vendor-completions/_se && hash -rf && compinit\n\n# Install Bash completions.\nsudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/bash/se /usr/share/bash-completion/completions/se\n\n# Install Fish completions.\nln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/fish/se $HOME/.config/fish/completions/se.fish\n```\n\n## Fedora users\n\n```shell\n# Install some pre-flight dependencies.\nsudo dnf install calibre git java-1.8.0-openjdk python3-devel\n\n# Install pipx.\npython3 -m pip install --user pipx\npython3 -m pipx ensurepath\n\n# Install the toolset.\npipx install standardebooks\n```\n\n### Optional: Install shell completions\n\n```shell\n# Install ZSH completions.\nsudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/zsh/_se /usr/share/zsh/vendor-completions/_se && hash -rf && compinit\n\n# Install Bash completions.\nsudo ln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/bash/se /usr/share/bash-completion/completions/se\n\n# Install Fish completions.\nln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/fish/se $HOME/.config/fish/completions/se.fish\n```\n\n## macOS users\n\n1. Install the [Homebrew package manager](https://brew.sh). Or, if you already have it installed, make sure it\u2019s up to date:\n\n\t```shell\n\tbrew update\n\t```\n\n2. Install dependencies:\n\n\t```shell\n\t# Install some pre-flight dependencies.\n\tbrew install cairo calibre git openjdk pipx python@3.11\n\tpipx ensurepath\n\tsudo ln -sfn $(brew --prefix)/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk\n\n\t# Install the toolset.\n\tpipx install --python python3.11 standardebooks\n\n\t# Optional: Bash users who have set up bash-completion via brew can install tab completion.\n\tln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/bash/se $(brew --prefix)/etc/bash_completion.d/se\n\n\t# Optional: Fish users can install tab completion.\n\tln -s $HOME/.local/pipx/venvs/standardebooks/lib/python3.*/site-packages/se/completions/fish/se $HOME/.config/fish/completions/se.fish\n\t```\n\n## OpenBSD 6.6 Users\n\nThese instructions were tested on OpenBSD 6.6, but may also work on the 6.5 release as well.\n\n1. Create a text file to feed into ```pkg_add``` called `~/standard-ebooks-packages`. It should contain the following:\n\n\t```shell\n\tpy3-pip--\n\tpy3-virtualenv--\n\tpy3-gitdb--\n\tjdk--%11\n\tcalibre--\n\tgit--\n\t```\n\n2. Install dependencies using ```doas pkg_add -ivl ~/standard-ebooks-packages```. Follow linking instructions provided by ```pkg_add``` to save keystrokes, unless you want to have multiple python versions and pip versions. In my case, I ran ```doas ln -sf /usr/local/bin/pip3.7 /usr/local/bin/pip```.\n\n3. Add ```~/.local/bin``` to your path.\n\n4. Run ```pip install --user pipx```\n\n5. If you\u2019re using ```ksh``` from base and have already added ```~/.local/bin```, you can skip ```pipx ensurepath``` because this step is for ```bash``` users.\n\n6. The rest of the process is similar to that used on other platforms:\n\n\t```shell\n\t# Install the toolset.\n\tpipx install standardebooks\n\t```\n\n## Installation for toolset developers\n\nIf you want to work on the toolset source, it\u2019s helpful to tell `pipx` to install the package in \u201ceditable\u201d mode. This will allow you to edit the source of the package live and see changes immediately, without having to uninstall and re-install the package.\n\nTo do that, follow the general installation instructions above; but instead of doing `pipx install standardebooks`, do the following:\n\n```shell\ngit clone https://github.com/standardebooks/tools.git\npipx install --editable ./tools\n```\n\nNow the `se` binary is in your path, and any edits you make to source files in the `tools/` directory are immediately reflected when executing the binary.\n\n### Running commands on the entire corpus\n\nAs a developer, it\u2019s often useful to run an `se` command like `se lint` or `se build` on the entire corpus for testing purposes. This can be very time-consuming in a regular invocation (like `se lint /path/to/ebook/repos/*`), because each argument is processed sequentially. Instead of waiting for a single invocation to process all of its arguments sequentially, use [GNU Parallel](https://www.gnu.org/software/parallel/) to start multiple invocations in parallel, with each one processing a single argument. For example:\n\n```shell\n# Slow, each argument is processed in sequence\nse lint /path/to/ebook/repos/*\n\n# Fast, multiple invocations each process a single argument in parallel\nexport COLUMNS; parallel --keep-order se lint ::: /path/to/ebook/repos/*\n```\n\nThe toolset tries to detect when it\u2019s being invoked from `parallel`, and it adjusts its output to accomodate.\n\nWe export `COLUMNS` because `se lint` needs to know the width of the terminal so that it can format its tabular output correctly. We pass the `--keep-order` flag to output results in the order we passed them in, which is useful if comparing the results of multiple runs.\n\n### Linting with `pylint` and `mypy`\n\nBefore we can use `pylint` or `mypy` on the toolset source, we have to inject them (and additional typings) into the venv `pipx` created for the `standardebooks` package:\n\n```shell\npipx inject standardebooks pylint==2.17.3 mypy==1.2.0 types-requests==2.28.11.17 types-setuptools==67.7.0.0 types-Pillow==10.2.0.20240331\n```\n\nThen make sure to call the `pylint` and `mypy` binaries that `pipx` installed in the `standardebooks` venv, *not* any other globally-installed binaries:\n\n```shell\ncd /path/to/tools/repo\n$HOME/.local/pipx/venvs/standardebooks/bin/pylint tests/*.py se\n```\n\n### Testing with `pytest`\n\nInstructions are found in the testing [README](tests/README.md).\n\n### Code style\n\n- In general we follow a relaxed version of [PEP 8](https://www.python.org/dev/peps/pep-0008/). In particular, we use tabs instead of spaces, and there is no line length limit.\n\n- Always use the `regex` module instead of the `re` module.\n\n# Help wanted\n\nWe need volunteers to take the lead on the following goals:\n\n- Add more test cases to the test framework.\n\n- Writing installation instructions for Bash and ZSH completions for MacOS.\n\n- Currently the toolset requires the whole Calibre package, which is very big, but it\u2019s only used to convert epub to azw3. Can we inline Calibre\u2019s azw3 conversion code into our `./vendor/` directory, to avoid having to install the entire Calibre package as a big dependency? If so, how do we keep it updated as Calibre evolves?\n\n- Over the years, `./se/se_epub_build.py` has evolved to become very large and unwieldy. Is there a better, clearer way to organize this code?\n\n# Tool descriptions\n\n-\t### `se british2american`\n\n\tTry to convert British quote style to American quote style in `DIRECTORY/src/epub/text/`.\n\n\tQuotes must already be typogrified using the `se typogrify` tool.\n\n\tThis script isn\u2019t perfect; proofreading is required, especially near closing quotes near to em-dashes.\n\n-\t### `se build`\n\n\tBuild an ebook from a Standard Ebook source directory.\n\n-\t### `se build-ids`\n\n\tChange ID attributes for non-sectioning content to their expected values across the entire ebook. IDs must be globally unique and correctly referenced, and the ebook spine must be complete.\n\n-\t### `se build-images`\n\n\tBuild ebook cover and titlepage images in a Standard Ebook source directory and place the output in `DIRECTORY/src/epub/images/`.\n\n-\t### `se build-manifest`\n\n\tGenerate the `<manifest>` element for the given Standard Ebooks source directory and write it to the ebook\u2019s metadata file.\n\n-\t### `se build-spine`\n\n\tGenerate the `<spine>` element for the given Standard Ebooks source directory and write it to the ebook\u2019s metadata file.\n\n-\t### `se build-title`\n\n\tGenerate the title of an XHTML file based on its headings and update the file\u2019s `<title>` element.\n\n-\t### `se build-toc`\n\n\tGenerate the table of contents for the ebook\u2019s source directory and update the ToC file.\n\n-\t### `se clean`\n\n\tPrettify and canonicalize individual XHTML, SVG, or CSS files, or all XHTML, SVG, or CSS files in a source directory.\n\n-\t### `se compare-versions`\n\n\tUse Firefox to render and compare XHTML files in an ebook repository. Run on a dirty repository to visually compare the repository\u2019s dirty state with its clean state. If a file renders differently, place screenshots of the new, original, and diff (if available) renderings in the current working directory. A file called diff.html is created to allow for side-by-side comparisons of original and new files.\n\n-\t### `se create-draft`\n\n\tCreate a skeleton of a new Standard Ebook.\n\n-\t### `se css-select`\n\n\tPrint the results of a CSS selector evaluated against a set of XHTML files.\n\n-\t### `se dec2roman`\n\n\tConvert a decimal number to a Roman numeral.\n\n-\t### `se extract-ebook`\n\n\tExtract an .epub, .mobi, or .azw3 ebook into `./FILENAME.extracted/` or a target directory.\n\n-\t### `se find-mismatched-dashes`\n\n\tFind words with mismatched dashes in a set of XHTML files. For example, `extra-physical` in one file and `extraphysical` in another.\n\n-\t### `se find-mismatched-diacritics`\n\n\tFind words with mismatched diacritics in a set of XHTML files. For example, `cafe` in one file and `caf\u00e9` in another.\n\n-\t### `se find-unusual-characters`\n\n\tFind characters outside a nominal expected range in a set of XHTML files. This can be useful to find transcription mistakes and mojibake.\n\n-\t### `se help`\n\n\tList available SE commands.\n\n-\t### `se hyphenate`\n\n\tInsert soft hyphens at syllable breaks in an XHTML file.\n\n-\t### `se interactive-replace`\n\n\tPerform an interactive search and replace on a list of files using Python-flavored regex. The view is scrolled using the arrow keys, with alt to scroll by page in any direction. Basic Emacs (default) or Vim style navigation is available. The following actions are possible: (y) Accept replacement. (n) Reject replacement. (a) Accept all remaining replacements in this file. (r) Reject all remaining replacements in this file. (c) Center on match. (q) Save this file and quit.\n\n-\t### `se lint`\n\n\tCheck for various Standard Ebooks style errors.\n\n-\t### `se make-url-safe`\n\n\tMake a string URL-safe.\n\n-\t### `se modernize-spelling`\n\n\tModernize spelling of some archaic words, and replace words that may be archaically compounded with a dash to a more modern spelling. For example, replace `ash-tray` with `ashtray`.\n\n-\t### `se prepare-release`\n\n\tCalculate work word count, insert release date if not yet set, and update modified date and revision number.\n\n-\t### `se recompose-epub`\n\n\tRecompose a Standard Ebooks source directory into a single HTML5 file, and print to standard output.\n\n-\t### `se renumber-endnotes`\n\n\tRenumber all endnotes and noterefs sequentially from the beginning.\n\n-\t### `se roman2dec`\n\n\tConvert a Roman numeral to a decimal number.\n\n-\t### `se semanticate`\n\n\tApply some scriptable semantics rules from the Standard Ebooks semantics manual to a Standard Ebook source directory.\n\n-\t### `se shift-endnotes`\n\n\tIncrement or decrement the specified endnote and all following endnotes by 1 or a specified amount.\n\n-\t### `se split-file`\n\n\tSplit an XHTML file into many files at all instances of `<!--se:split-->`, and include a header template for each file.\n\n-\t### `se titlecase`\n\n\tConvert a string to titlecase.\n\n-\t### `se typogrify`\n\n\tApply some scriptable typography rules from the Standard Ebooks typography manual to a Standard Ebook source directory.\n\n-\t### `se unicode-names`\n\n\tDisplay Unicode code points, descriptions, and links to more details for each character in a string. Useful for differentiating between different flavors of spaces, dashes, and invisible characters like word joiners.\n\n-\t### `se word-count`\n\n\tCount the number of words in an HTML file and optionally categorize by length.\n\n-\t### `se xpath`\n\n\tPrint the results of an xpath expression evaluated against a set of XHTML files. The default namespace is removed.\n\n# What a Standard Ebooks source directory looks like\n\nMany of these tools act on Standard Ebooks source directories. Such directories have a consistent minimal structure:\n\n```\n.\n|__ images/\n|   |__ cover.jpg\n|   |__ cover.source.jpg\n|   |__ cover.svg\n|   |__ titlepage.svg\n|\n|__ src/\n|   |__ META-INF/\n|   |   |__ container.xml\n|   |\n|   |__ epub/\n|   |   |__ css/\n|   |   |   |__ core.css\n|   |   |   |__ local.css\n|   |   |   |__ se.css\n|   |   |\n|   |   |__ images/\n|   |   |   |__ cover.svg\n|   |   |   |__ logo.svg\n|   |   |   |__ titlepage.svg\n|   |   |\n|   |   |__ text/\n|   |   |   |__ colophon.xhtml\n|   |   |   |__ imprint.xhtml\n|   |   |   |__ titlepage.xhtml\n|   |   |   |__ uncopyright.xhtml\n|   |   |\n|   |   |__ content.opf\n|   |   |__ onix.xml\n|   |   |__ toc.xhtml\n|   |\n|   |__ mimetype\n|\n|__ LICENSE.md\n```\n\n`./images/` contains source images for the cover and titlepages, as well as ebook-specific source images. Source images should be in their maximum available resolution, then compressed and placed in `./src/epub/images/` for distribution.\n\n`./src/epub/` contains the actual epub files.",
    "bugtrack_url": null,
    "license": null,
    "summary": "The toolset used to produce Standard Ebooks epub ebooks.",
    "version": "2.6.4",
    "project_urls": {
        "Homepage": "https://standardebooks.org",
        "Source": "https://standardebooks.org/tools"
    },
    "split_keywords": [
        "ebooks",
        "epub"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9c5ecffb03139446c72ead4914d692d969e81b8c0907d972e73075a48caf708",
                "md5": "f9f95276d26ecc92df577a1a9a9c7768",
                "sha256": "387794de7030ee4be92cc5a749cd220567f2f368e5fc4f59b2d57dbfedda7758"
            },
            "downloads": -1,
            "filename": "standardebooks-2.6.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f9f95276d26ecc92df577a1a9a9c7768",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<=3.12,>=3.8",
            "size": 67424037,
            "upload_time": "2024-05-16T21:38:40",
            "upload_time_iso_8601": "2024-05-16T21:38:40.515748Z",
            "url": "https://files.pythonhosted.org/packages/c9/c5/ecffb03139446c72ead4914d692d969e81b8c0907d972e73075a48caf708/standardebooks-2.6.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-16 21:38:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "standardebooks"
}
        
Elapsed time: 0.24732s