Skip to main content

ebook-tree-parser

use ebooklib to parse a tree-like structure from ebooks from the TOC

Usage

from ebooklib import epub
from ebook_tree_parser.toctree import TocTree

file = "../data/frankenstein.epub"
book = epub.read_epub(file, options={'ignore_ncx': False})

estimator = lambda string: len(string)*4
tree = TocTree(book, token_estimator=estimator)

print(tree)

for node in tree3:
    print("----")
    print(f"{node.title}|{node.content_token_count}\n{node.content[:50]}")
    print("----")

Development

  1. Create a virtual environment
  2. pip install -e .
  3. Make sure to update pyproject.toml with the correct dependencies

Metadata

Release files for ebook-tree-parser 0.1.2

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

Source distribution (sdist)

Source distribution for ebook-tree-parser 0.1.2
File Size Uploaded Provenance
ebook_tree_parser-0.1.2.tar.gz 6.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ebook-tree-parser 0.1.2
File Interpreter ABI Platform
ebook_tree_parser-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / ebook_tree_parser-0.1.2.tar.gz

Download URL ebook_tree_parser-0.1.2.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
866443cbb0c6331ec0eaa0078b7465ab1585fc472bcf839c5caba087da674bf9
BLAKE2b-256 checksum
How to use checksums
66dadd0c06c4323059d92f8b45c3162746ecbfac568c96e0b39675090c22cfc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / ebook_tree_parser-0.1.2-py3-none-any.whl

Download URL ebook_tree_parser-0.1.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26643dd1443d34a927c9bfd503a15401afc2ee38f40379ed49fab334339ad970
BLAKE2b-256 checksum
How to use checksums
4cdf21e4c5a0a31975fc09013443d5fb2892fe8581dd4c54ddec4bd097e9afab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Security for ebook-tree-parser 0.1.2

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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

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