Skip to main content

Converter between multiple open-standard file formats.

Project description

fconv

Python lib and CLI command that convert between multiple file formats

Getting started

pip install fconv
$ fconv --v
version: x.x.x

Features

  • Converting a file into other formatted file

  • Supportting format

    • json
    • yaml
    • on going
      • xml
      • toml
      • ini
  • In condition of using as a module, fconv supports optional arguments.

To know which options are available,

See the reference:

Example

Use as a module

>>> from fconv.core import Former
>>> from fconv.formats.json import Json
>>> from fconv.formats.yaml import Yaml
>>> f = Former(src_format=Json, target_format=Yaml)

>>> f.form('{"key1":"value1"}')
'key1: value1\\n'

>>> f = Former(src_format=Yaml, target_format=Json, out_opt={'indent':3})
>>> f.form('key1: value1\\n')
'{\\n   "key1": "value1"\\n}'

Use as a CLI command

Basic usage

fconv <source format> <target format> -i <source file name>

Convert json file into yaml and print out

fconv json yaml -i sample.json

Convert yaml file into json formated file

fconv yaml json -i sample.yaml -o result.json

License

Licensed under the MIT License.

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

fconv-1.0.2.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

fconv-1.0.2-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

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