Skip to main content

Transit CLI Tool

https://img.shields.io/pypi/v/transito.svg https://img.shields.io/travis/marianoguerra/transito.svg Documentation Status

Command Line Tool to Work with Transit Format

Features

  • convert to and form json, edn, transit

  • read content from stdin or files

Usage

$ transito -h
usage: transito [-h] {t2j,j2t,e2t,t2e,http} ...

Transit CLI

positional arguments:
  {t2j,j2t,e2t,t2e,http}
    t2j                 convert transit to json
    j2t                 convert json to transit
    e2t                 convert edn to transit
    t2e                 convert transit to edn
    http                make http requests with transit data

optional arguments:
  -h, --help            show this help message and exit

Conversions

Convert Transit to JSON from a file:

$ transito t2j examples/ex1.transit

[":keyword", "~lala", 1, 1.2, true, null, [], ["hi", "a"]]

Convert Transit to JSON from stdin:

$ transito t2j -

["~#list",["~:keyword","~$lala",1,1.2,true,null,[],["hi",["~#char","a"]]]]
[":keyword", "~lala", 1, 1.2, true, null, [], ["hi", "a"]]

Piping from another command:

$ echo '["~#list",["~:keyword","~$lala",1,1.2,true,null,[],["hi",["~#char","a"]]]]' | transito t2j -

[":keyword", "~lala", 1, 1.2, true, null, [], ["hi", "a"]]

Same for Edn:

$ transito t2e examples/ex1.transit

(keyword lala 1 1.2 true nil [] ["hi" \a])
$ echo '["~#list",["~:keyword","~$lala",1,1.2,true,null,[],["hi",["~#char","a"]]]]' | transito t2e -

(keyword lala 1 1.2 true nil [] ["hi" \a])
$ transito t2e -

["~#list",["~:keyword","~$lala",1,1.2,true,null,[],["hi",["~#char","a"]]]]
(keyword lala 1 1.2 true nil [] ["hi" \a])

you should get the idea, some with transit as output just in case:

$ transito e2t -
(keyword lala 1 1.2 true nil [] ["hi" \a])
["~#list",["~$keyword","~$lala",1,1.2,true,null,[],["hi",["~#char","a"]]]]

$ transito t2j -
["~#list",["~$keyword","~$lala",1,1.2,true,null,[],["hi",["~#char","a"]]]]
["~keyword", "~lala", 1, 1.2, true, null, [], ["hi", "a"]]

HTTP Requests

You an make an http request that supports transit, json or edn but writting and reading the request and response in a more readable way, for example, make a request writing edn that will be transformed to transit before being sent, the response will be transformed to edn if possible to make it more readable:

$ echo '(increment {:value 20})' | transito http post http://localhost:8080/action e2t -

Status: 200
Content-Type: application/transit+json
Content-Length: 28

{:value [:count]}

You may ask, isn’t it complected? yes, yes it is.

Credits

Tools used in rendering this package:

History

0.1.3 (2015-12-01)

  • add support for keywords with namespaces in edn

0.1.2 (2015-26-11)

  • fix edn encoding from transit on http response

0.1.1 (2015-25-11)

  • add support for http requests

  • fix keyword serialization in edn

0.1.0 (2015-25-11)

  • First release on PyPI.

Metadata

Release files for transito 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transito 0.1.6
File Size Uploaded Provenance
transito-0.1.6.tar.gz 16.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for transito 0.1.6
File Interpreter ABI Platform
transito-0.1.6-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 44.6 kB

Release files / transito-0.1.6.tar.gz

Download URL transito-0.1.6.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9acfde518c9dcaeafdfe0646fd3ca22b477e5e0c3ba076f2c3a7d66ab9f18172
BLAKE2b-256 checksum
How to use checksums
4b66f3f672e5d9aaa4d3f55800a44bf6d4e6e805aade8139828a961d6f72101b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / transito-0.1.6-py2.py3-none-any.whl

Download URL transito-0.1.6-py2.py3-none-any.whl
Size 28.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d21feb8cf9fd31b0b13daae27bddb7ac8e10d8acbc2aa2bdb9ab126315c0ec4e
BLAKE2b-256 checksum
How to use checksums
31f6592766a9aa8528199f779ad595408e1d5a7dbccb9c7f88529b2241e521c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for transito 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page