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
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.3.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46edff78d510115f1c3d8130106615f0ab8afd2038aa5bd026e79fc6bdbb0b03 |
|
MD5 | 6bf6775579ec6d0a7646fbc3f58251cf |
|
BLAKE2b-256 | 5fe164b8e4a4de32173d0331e01adbcbd79e6d5496c6863570270d9fd716c7b6 |
Hashes for votable_cli-0.3.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1b31a56fa217ad8184e90b4f34fc7ce42c5b71504f0d5ec44338770ff52a8a4 |
|
MD5 | 45ea741a27f4da23182fb161064b5943 |
|
BLAKE2b-256 | 131559de3fae32cf45878d53788baea5d0072dcf9b81fa4ce56e94efe651770d |
Hashes for votable_cli-0.3.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42710e3e211cf5452923402e858925cf0d736a5324f6b4597b44e4d4d0e72fdf |
|
MD5 | cf2a268b663410264ddac00ead865799 |
|
BLAKE2b-256 | b33f35897ff07769ba75dba6f8759ba8ef7a0ee0558c67e9a36ec7673d7e00e1 |
Hashes for votable_cli-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf4c9f1be03f7944fef338916d4d1c6afbe8eb9bf24a5317d4984de68f9bb4a5 |
|
MD5 | f5436027cf537666f2c0b84aec4e3664 |
|
BLAKE2b-256 | c8abe532f97c1eee7f1204c87e233863ae2517aafa2404f09acb4e002ab0ef87 |
Hashes for votable_cli-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35e75cb8ca0c7fc2e5eb63612f354f2a319d0d3e8c876613a303448d4fc89dcf |
|
MD5 | c981b2153e876e928723cc0efdeceb4c |
|
BLAKE2b-256 | 1ef476065eb6340a388e2156a992de8ef595774798005554bdc9bc75ab8be127 |
Hashes for votable_cli-0.3.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a92f68afe7a0f1973b2ca1d3f32f745251f12a01a4141f08c8195888360afe51 |
|
MD5 | a95c6ea85a4d393324b4c2b4646a0a44 |
|
BLAKE2b-256 | 9bbaffb84be6c87256b8a4c57d3287b65108017f0a4de97d397540515b907fe1 |