Skip to main content

Converter between multiple open-standard file formats.

Project description

fconv

GitHub Github GitHub release (latest by date) GitHub Workflow Status PyPI version

fconv is a Command-Line utility and library for converting between multiple file formats such as JSON, YAML.

Getting started

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

Features

  • Convert a file into other formatted file

  • Supported format

    • json
    • yaml
    • toml
    • xml
  • To be supported

    • ini

You can use fconv as command-line tool and Python module.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 command-line tool

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

Contribution

Have a look through existing Issues and Pull Requests that you could help with. If you'd like to request a feature or report a bug, please create a GitHub Issue using one of the templates provided.

See contribution guide->

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-3.2.1.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

fconv-3.2.1-py3-none-any.whl (10.3 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