Command-line to convert IVOA VOTables in XML, JSON, YAML and TOML
Project description
votable-cli
or VOTCli
A command-line to read and convert VOTables from/to XML, JSON, TOML and YAML.
Status
The library this CLI is based on is in an early stage of development. We are (reasonably) open to changes in the various format, e.g.:
- we could flag attributes with a '@' prefix
- we could use upper case elements tag names
- we could remove the 's' suffix in elements arrays
- we could change the
pos_infos
name for something else - ...
More testing is required, especially the bit type and arrays. Please, provide us with VOTable examples!
To-Do list
- Support
CDATA
inTD
tags - Use the iterator to implement streaming transformations between DATATABLE/BINARY/BINARY2.
- Also implement streaming conversion to CSV
Install
From pypi for python users
VOTable cli is available in pypi,
you can thus install the vot
executable using pip
:
pip install votable-cli
vot --help
Debian package
Download the last votable-cli_vxx_yyy.deb
corresponding to your architecture
(x86_64_musl
has the most chances to fit your needs)
from the github release page.
Install the .deb
by clicking on it or using the command line:
sudo dpkg -i votable-cli_vxx_yyy.deb
sudo apt-get install -f
Then you can use the tool:
vot
man vot
You can uninstall using, e.g.:
sudo dpkg -r $(dpkg -f votable-cli_vxx_yyy.deb Package)
Pre-compile binaries for MacOS, Linux and Windows
Download the last vot-vxx_yyy.tar.gz
corresponding to your architecture
from the github release page.
You probably want ot use:
- Linux:
vot-vxx-x86_64-unknown-linux-musl.tar.gz
- MacOS:
vot-vxx-x86_64-apple-darwin.tar.gz
- Windows:
vot-vxx-.zip
WARNING: for linux, use musl
instead of gnu
(high chances of uncompatibility in the latter case)
The tar contains a single executable binary file.
tar xzvf vot-vxx-yyy.tar.gz
./vot
Compile from source code
Install rust
(and check that ~/.cargo/bin/
is in your path),
or update the Rust compiler with:
rustup update
Clone the votable lib rust project:
git clone https://github.com/cds-astro/cds-votable-rust
Install from using cargo
:
cargo install --path crates/cli
Help message
> vot --help
Command-line to convert IVOA VOTables in XML, JSON, YAML and TOML
Usage: vot [OPTIONS] <INPUT_FMT> <OUTPUT_FMT>
Arguments:
<INPUT_FMT> Format of the input document ('xml', 'json', 'yaml' or 'toml')
<OUTPUT_FMT> Format of the output document ('xml', 'xml-td', 'xml-bin', 'xml-bin2', 'json', 'yaml' or 'toml')
Options:
-i, --input <FILE> Input file (else read from stdin)
-o, --output <FILE> Output file (else write to stdout)
-p, --pretty Pretty print (for JSON and TOML)
-h, --help Print help
-V, --version Print version
Example
> time vot xml xml -i VII.vot > xml.1.vot
real 0m0,009s
user 0m0,001s
sys 0m0,009s
> time vot xml toml --pretty -i VII.vot | vot toml json | vot json xml > xml.2.vot
real 0m0,022s
user 0m0,018s
sys 0m0,012s
> diff xml.1.vot xml.2.vot
Log messages
You can adapt the level
of log messages using
the environement variable RUST_LOG
with one of the following value:
error
, warn
, info
, debug
, trace
and off
.
E.g.:
RUST_LOG="trace" vot xml xml --input VII.vot
See env_logger for more details.
License
Like most projects in Rust, this project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for votable_cli-0.4.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d29fcfad7352a3429894f3396cfcbf5072d6bf5d208be0aa90506c6148a40df |
|
MD5 | 50c955d110029104ff7486cf9cfb8e44 |
|
BLAKE2b-256 | 961d5b174e2b1d0081d2da1c46e5293458845efb2d6179da18edc44e28eade3e |
Hashes for votable_cli-0.4.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97e7c33b8692c89cbacfb980b2025df7e9eba76599225ea86c3f45b04948b038 |
|
MD5 | 6149f1d1f15cebdbb5e0cc5cee196e32 |
|
BLAKE2b-256 | fbf81e56513dda375c74d555edab3ede4df90e39b76b792ac46edd79549fe815 |
Hashes for votable_cli-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f491780a963319509f7a51e9df2de33be91b4b532d7b800ed278f1aacae5cb2 |
|
MD5 | c85701e382970ecd9641ceac7737aeca |
|
BLAKE2b-256 | d3375508b7f4bf788617a29d889319f8149b1a57ef7bd53091a4ec6b5d0edf2f |
Hashes for votable_cli-0.4.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8b6de90215da5e0d64051e2f29287a6c3d010c06020c257ad638b282c66d1e4 |
|
MD5 | 84797b5e080d6fb36d6cf76ca86960d7 |
|
BLAKE2b-256 | 16752d883ac9e244f73112bafcb3b059358cbe23ce416eb011f315cd6990373a |