🔬 SVS edit
Editing SVS files (headers) using python module tifftools.
📀 Installation
Create a Python virtual environment (to isolate dependencies from other Python packages you may be using), activate it, and then install it. Typically:
$ python3.13 -m venv svs
$ cd svs
$ source bin/activate # Or source bin/activate.csh for csh/tcsh users
(venv) $ pip install labcas-svsedit
This makes the svs-edit command-line tool available; run:
svs-edit --help
To see the options. For example, to replace the Filename field with the text deid in input.svs and write to output.svs, run:
svs-edit --edit-desc Filename=deid input.svs output.svs
You can run on batches of files by wrapping the svs-edit invocation in a loop. For example, to replace the Filename field with the basename (without extension) of the SVS's file's name:
$ for f in *.svs; do
> svs-edit --edit-desc Filename=$(basename $f .svs) $f subdir/$f
> done
Or in csh/tcsh:
% foreach f (*.svs)
foreach? svs-edit. --edit-desc Filename=$f:r $f subdir/$f
foreach? end
By default the above replaces only those components which have the corresponding tag.
Changes can be tested by dumping the header of the newly written file using:
tifftools dump subdir/svsfile.svs
🛠️ Development
To develop and debug this software, clone this repository and install the source code into a Python virtual environment in editable mode:
$ git clone https://github.com/jpl-labcas/svs_edit.git
$ cs svs_edit
$ python3.13 -m venv .venv
$ source .venv/bin/activate # Or source .venv/bin/activate.csh for csh/tcsh users
(venv) $ pip install --editable .
The svs-edit command now uses the source code under src/jpl/labacs/svs and changes made to Python files take effect when the command is next run.
🥧 Making Releases
To release the software to the Python Package Index use build and twine:
$ pip install build twine
$ .venv/bin/python3 -m build .
$ twine upload dist/*
👥 Contributing
Within the JPL Informatics Center, we value the health of our community as much as the code, and that includes participation in creating and refining this software. Towards that end, we ask that you read and practice what's described in these documents:
- Our contributor's guide delineates the kinds of contributions we accept.
- Our code of conduct outlines the standards of behavior we practice and expect by everyone who participates with our software.
🔢 Versioning
We use the SemVer philosophy for versioning this software.
📃 License
The project is licensed under the Apache version 2 license.
Metadata
Release files for labcas-svsedit 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| labcas_svsedit-0.0.1.tar.gz | 12.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| labcas_svsedit-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.1 kB
Release files / labcas_svsedit-0.0.1.tar.gz
| Download URL | labcas_svsedit-0.0.1.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4fb369827796c0d67ea4f29ff32fb41af8bc94e447e4e607f965e0ec5c1b87a
|
|
BLAKE2b-256 checksum How to use checksums |
960a88afa0f55a513708d5fb129cc61b45089e51fdfaa94bd7b2bcc4187de9fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / labcas_svsedit-0.0.1-py3-none-any.whl
| Download URL | labcas_svsedit-0.0.1-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
575a609415981fc334676c0eacf8c31a7dc4c491d6e51cce3b229883ab2e0975
|
|
BLAKE2b-256 checksum How to use checksums |
369cfa9658bf31b495181c1acfb6d11a22dde3b5f668329acda5e50be7b7eee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|