agronholm / cbor2

Python CBOR (de)serializer with extensive tag support
MIT License
226 stars 59 forks source link

CLI support for encoding/importing from JSON #222

Open chenliu0831 opened 8 months ago

chenliu0831 commented 8 months ago

Things to check first

Feature description

Currently the CLI tool only supports converting CBOR data to representation that allows printing as JSON. The reverse serialization / importing is also a common task.

Happy to contribute as well.

Use case

It's convenient for manual testing with human readable JSON files/payload. Supported in this Rust project as well https://github.com/TakenPilot/cbor-cli.

Examples:

cbor2 -o test.cbor test.json --format=json

chenliu0831 commented 8 months ago

@agronholm gentle ping, any thoughts on the feature and interface?

agronholm commented 8 months ago

I might be open to that, but would require a PR with tests, any necessary docs updates and a changelog entry.