223.3. python3-openpyxl-3.1.5
Read and write xlsx from python — what visidata opens one with
| Version | 3.1.5, release 1 |
| Shelf | python-libs — General-purpose python3-* runtime libraries: text, templating, markup, parsing, config, CLI, system, files, crypto, imaging |
| Phase | 42_graphics (Graphics Stack), 90 of 189 in build order |
| Licence | MIT |
| Homepage | https://foss.heptapod.net/openpyxl/openpyxl |
| Build time | 0.3 SBU |
| Installed size | 2.0 MiB in 403 files |
| Recipe | ports/core/python-libs/python3-openpyxl/kpkgbuild |
About
openpyxl reads and writes Excel 2010 .xlsx and .xlsm workbooks from Python. In KDOS it is there for visidata, which opens an .xlsx file only through openpyxl and refuses the file when the module is missing; sc-im reads the format in C and does not use it.
Why it is in KDOS
The comment above it in script/phases/42_graphics/packages.d/python-libs.txt:
WHAT visidata OPENS AN xlsx WITH. sc-im reads the format in C and needs none of this; visidata asks for openpyxl by name and refuses without it.
Sources
python3-openpyxl-3.1.5.tar.gz(182.1 KiB)
sha256cf0e3cf56142039133628b5acffe8ef0c12bc902d2aadd3e0fe5878dc08d1050
upstream: https://files.pythonhosted.org/packages/source/o/openpyxl/openpyxl-3.1.5.tar.gz
archive copy: sources-4/python-libs--python3-openpyxl-3.1.5.tar.gzpython3-openpyxl-vendor-3.1.5.tar.xz(1.7 MiB)
sha25671bd0c53d978050c61a09ac232516f0894430e53dfa716ef3b61cb898308c0a4
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-4/python-libs--python3-openpyxl-vendor-3.1.5.tar.xz
Dependencies
Depends on: python3, python3-setuptools, python3-pip, python3-lxml, python3-pillow.
Required by (2): pandas, visidata.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install python3-openpyxl'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/python-libs/python3-openpyxl.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/python-libs/python3-openpyxl
echo 'cf0e3cf56142039133628b5acffe8ef0c12bc902d2aadd3e0fe5878dc08d1050 python3-openpyxl-3.1.5.tar.gz' | sha256sum -c -
echo '71bd0c53d978050c61a09ac232516f0894430e53dfa716ef3b61cb898308c0a4 python3-openpyxl-vendor-3.1.5.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/python3-openpyxl
SRC=$SRC_ROOT/python3-openpyxl-3.1.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-openpyxl-3.1.5.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor
pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
--root=$PKG --prefix=/usr et-xmlfile .
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/python3-openpyxl, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf python3-openpyxl-3.1.5-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/python3-openpyxl, and runs the triggers its paths call for.
Contents
Installed directories: /usr/lib/python3.14/site-packages/et_xmlfile, /usr/lib/python3.14/site-packages/et_xmlfile-2.0.0.dist-info, /usr/lib/python3.14/site-packages/openpyxl, /usr/lib/python3.14/site-packages/openpyxl-3.1.5.dist-info, /usr/share/licenses/python3-openpyxl.
Notes
openpyxl’s one dependency that is not a port, et-xmlfile, comes from the vendor bundle that ports/fetch makes from pypackages = et-xmlfile: that one source distribution, downloaded without its dependencies, plus the build backends ports/fetch collects for each source in the bundle. It and openpyxl are installed with --no-deps --no-index from vendor/ alone, and --no-build-isolation builds them with the setuptools of the build root; see The three Python keys.