A small package for working with FB2 files
Project description
FB2
Python package for working with FictionBook2
Usage example
from FB2 import FictionBook2, Author
from urllib import request
book = FictionBook2()
book.titleInfo.title = "Example book"
book.titleInfo.annotation = "Small test book. Shows basics of FB2 library"
book.titleInfo.authors = [Author(firstName="Alex",
middleName="Unknown",
nickname="Ae_Mc",
emails=["ae_mc@mail.ru"],
homePages=["ae-mc.ru"])]
book.titleInfo.genres = ["sf", "sf_fantasy", "shortstory"]
book.titleInfo.coverPageImages = [
request.urlopen("https://picsum.photos/1080/1920").read()]
book.titleInfo.sequences = [("Example books", 2)]
book.documentInfo.authors = ["Ae Mc"]
book.documentInfo.version = "1.1"
book.chapters = [
("Introduction", [
"Introduction chapter first paragraph",
"Introduction chapter second paragraph"]),
("1. Chapter one. FB2 format history", [
"Introduction chapter first paragraph",
"Introduction chapter second paragraph"])]
book.chapters.append(("2. Chapter two. Empty", []))
book.write("ExampleBook.fb2")
Requirements
- iso-639 package
Installation
- From pip:
pip install fb2
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
FB2-0.1.7.tar.gz
(7.2 kB
view details)
Built Distribution
FB2-0.1.7-py3-none-any.whl
(15.7 kB
view details)
File details
Details for the file FB2-0.1.7.tar.gz
.
File metadata
- Download URL: FB2-0.1.7.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb24ddd53d595058b41ef0ea95fba1486f7b55104f58363f55cdec6062364d8e |
|
MD5 | cb93708235f9e53f8be732351d50a29a |
|
BLAKE2b-256 | c6e13ed869f93b2cd8e0d0ecd581e54d5b36d343e8352b778c3fdf778e9cc648 |
File details
Details for the file FB2-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: FB2-0.1.7-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 366f193c63dbbed3036301f5a793453d7df7bd97a76fd24fb7ebc9eddf3c025e |
|
MD5 | 71721e7b910ad992613472d2fa890c86 |
|
BLAKE2b-256 | 98f1415daaca4c71008fc49b2f7ef936f7a7667f0406b23d905c85f870f6985a |