180.1. visidata-3.4
Terminal spreadsheet for tabular files
| Version | 3.4, release 1 |
| Shelf | formats — Data-format and serialisation libraries (XML, JSON, YAML, TOML, INI, RDF, protobuf, thrift), plus data query and convert tools |
| Phase | 42_graphics (Graphics Stack), 91 of 189 in build order |
| Licence | GPL-3.0-only |
| Homepage | https://pypi.org/project/visidata/ |
| Build time | 1.5 SBU |
| Installed size | 35.9 MiB in 616 files |
| Recipe | ports/core/formats/visidata/kpkgbuild |
About
VisiData is a terminal spreadsheet: vd opens a CSV, TSV, JSON, Excel, SQLite, HTML or YAML file, or a URL, as a sheet to sort, filter, pivot, chart and edit from the keyboard. In KDOS it is the terminal program a .csv file can open in, beside LibreOffice Calc.
Why it is in KDOS
The comment above it in script/phases/42_graphics/packages.d/formats.txt:
A terminal spreadsheet for any tabular file.
pyrequirements = no: its requirements.txt is the OPTIONAL loader set and reaches pandas and scipy, where its install_requires is python-dateutil.
Sources
visidata-3.4.tar.gz(12.6 MiB)
sha256f5afcdb6823c570760be9692f33d0642a20cd86925b4cab721d108050d0f8201
upstream: https://files.pythonhosted.org/packages/source/v/visidata/visidata-3.4.tar.gz
archive copy: sources-2/formats--visidata-3.4.tar.gzvisidata-vendor-3.4.tar.xz(2.1 MiB)
sha25624ca31e0cfd2b2a4db19ba854edeac46a19c05635b3c52f8cd4798ef6c7ecd66
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-2/formats--visidata-vendor-3.4.tar.xz
Dependencies
Depends on: python3, python3-setuptools, python3-pip, python3-dateutil, python3-six, python3-lxml, python3-openpyxl, python3-yaml, python3-requests.
Required by: no port names it.
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 visidata'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/formats/visidata.
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/formats/visidata
echo 'f5afcdb6823c570760be9692f33d0642a20cd86925b4cab721d108050d0f8201 visidata-3.4.tar.gz' | sha256sum -c -
echo '24ca31e0cfd2b2a4db19ba854edeac46a19c05635b3c52f8cd4798ef6c7ecd66 visidata-vendor-3.4.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/visidata
SRC=$SRC_ROOT/visidata-3.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf visidata-3.4.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 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 \
--root=$PKG --prefix=/usr standard-mailcap .
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/visidata.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Data Sheets
GenericName=Data Explorer
Comment=Open CSV, JSON and spreadsheets as a sheet
Exec=vd %F
Icon=x-office-spreadsheet
Terminal=true
Categories=Office;Spreadsheet;Utility;
MimeType=text/csv;
Keywords=csv;json;data;sheet;table;visidata;
EOF
chmod 644 "$PKG/usr/share/applications/visidata.desktop"
The switches, and why each is set:
--ignore-installed— Writes the packages into$PKGeven when a copy is already in the build root; without it pip would uninstall that copy from the root first (see The three Python keys).--no-deps,--no-index,--find-links=vendor— Installs exactly the two named things,standard-mailcapand VisiData itself, from the vendor directory alone, resolving nothing and reaching no index.
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/visidata, 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 visidata-3.4-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/visidata, and runs the triggers its paths call for.
Contents
Installed programs: vd, vd2to3.vdx, visidata.
Installed directories: /usr/lib/python3.14/site-packages/mailcap, /usr/lib/python3.14/site-packages/standard_mailcap-3.13.0.dist-info, /usr/lib/python3.14/site-packages/visidata, /usr/lib/python3.14/site-packages/visidata-3.4.dist-info, /usr/share/licenses/visidata.
Notes
The vendor bundle, visidata-vendor-<version>.tar.xz, is a Python bundle that ports/fetch makes from the source distribution’s own metadata, as source distributions with their build requirements, and the recipe pins by its sha256 (see Vendoring). pyrequirements = no is what keeps the bundle small: VisiData’s requirements.txt is the optional loader set and reaches pandas, scipy and a Fortran compiler, where its install_requires is python-dateutil, with standard-mailcap on Python 3.13 and later (see The three Python keys).
standard-mailcap is the one run-time module the package takes from the bundle. Python 3.13 removed mailcap from the standard library, it is not a port, and VisiData’s sysopen-mailcap commands, which open a file in the program its mailcap entry names, import it. python-dateutil (the date column type), lxml (HTML and XML), openpyxl (xlsx), PyYAML and requests (a URL as a source) are ports and come in through depends. VisiData imports each loader’s library only when that format is opened, so a missing one costs only that format.
build.sh replaces the desktop entry upstream installs, visidata.desktop, with one of the same name: the same Exec, an icon the shipped icon theme carries, and the text/csv MIME type upstream leaves off. Keeping the name keeps one menu row for the program.