Skip to main content

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 in TD 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

votable_cli-0.4.0.tar.gz (127.1 kB view details)

Uploaded Source

Built Distributions

votable_cli-0.4.0-py3-none-win_amd64.whl (2.3 MB view details)

Uploaded Python 3 Windows x86-64

votable_cli-0.4.0-py3-none-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.28+ x86-64

votable_cli-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (2.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ i686

votable_cli-0.4.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.5 MB view details)

Uploaded Python 3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

File details

Details for the file votable_cli-0.4.0.tar.gz.

File metadata

  • Download URL: votable_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 127.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.4.0

File hashes

Hashes for votable_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6142afc59f00a5d152d647f865515f79cb95e06047682142f8fbcebf415ec218
MD5 53be083c8a1d03c067078c4c10daa336
BLAKE2b-256 76b898e3a805a4a491bd517db8d91ac0ef9f17d2c8dcdfcc66c63fa8ed63e67d

See more details on using hashes here.

File details

Details for the file votable_cli-0.4.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for votable_cli-0.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4d29fcfad7352a3429894f3396cfcbf5072d6bf5d208be0aa90506c6148a40df
MD5 50c955d110029104ff7486cf9cfb8e44
BLAKE2b-256 961d5b174e2b1d0081d2da1c46e5293458845efb2d6179da18edc44e28eade3e

See more details on using hashes here.

File details

Details for the file votable_cli-0.4.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file votable_cli-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file votable_cli-0.4.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

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

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page