This release is a pre-release and may not be stable for production use.
PageSequence
A page sequence is a short string that says which labels are printed on each page of a
document, such as a PDF. With it, a reference written in the labels printed in the publication,
such as "20-21", is turned into the right pages of the document.
pip install pagesequence
from pagesequence import PageSequence
# An unnumbered cover, roman front matter, then pages 1 to 48: 53 pages in all.
seq = PageSequence('"Omslag", i-iv, 1-48', 53)
seq.get_index_list("20-21") # [24, 25]: the document pages, counted from 0
seq.format_at(1) # "i"
Invalid input raises a PageSequenceError with kind and position; PageSequence.create
returns None instead. normalize, clean and equals work on sequence strings.
The plugin systems are imported from their own modules and passed in each call:
from pagesequence import normalize
from pagesequence.plugins.roman_additive import roman_additive
normalize("I, II, III, IIII, V", plugins=[roman_additive]) # "I-V/roman_additive"
The plugins are roman_additive, latin_sv, greek and hebrew. The package has no
dependencies and needs Python 3.11 or later.
The notation and the API are in the specification. PageSequence is part of publication-md. The code is under the MIT licence.
Metadata
Release files for pagesequence 2.0.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pagesequence-2.0.0rc1.tar.gz | 13.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pagesequence-2.0.0rc1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.3 kB
Release files / pagesequence-2.0.0rc1.tar.gz
| Download URL | pagesequence-2.0.0rc1.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63ae75df1ab44145afb7bc588f11bdb9cae7803e4069af7e67421963e5e4707c
|
|
BLAKE2b-256 checksum How to use checksums |
0210650ebf03a4af3eb9328882c73142f48679f2f40dce8c4494f5f1b49a0c16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pagesequence-2.0.0rc1-py3-none-any.whl
| Download URL | pagesequence-2.0.0rc1-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6f8171b0892d71f37749dfa7cfe3f255b37bb8cdfd722f5fd0cec7ba4336e2a
|
|
BLAKE2b-256 checksum How to use checksums |
68a27923420132e94af661fb79e408c2adf5474d95aeefd1e500f24c19d040c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|