Skip to content

tschenkelz/json_corrector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Corrector

Takes data, that is almost in json format, and converts it to json data.
Thus prepare the data for a json parser.

Limitations

Not all data types that are valid as values, according to json.org, are yet handled correctly.

  • String: ✅
  • Boolean: ✅
  • Object: ✅
  • Array: ✅
  • Numbers: 🕟
  • null: 🕟

Requirements

  • Python 3.x >= 3.8

Install (Windows & Linux)

pip install json-corrector

Use (Windows & Linux)

Using entry point script

echo "{'key1':'val1',key2: val2, 'key3': val3,key4: 'val4', key5: {  'key6': val6  },key7: 'val7: val7,val7'}" | jc
jc "{'key1':'val1',key2: val2, 'key3': val3,key4: 'val4', key5: {  'key6': val6  },key7: 'val7: val7,val7'}"

Using runpy

echo "{'key1':'val1',key2: val2, 'key3': val3,key4: 'val4', key5: {  'key6': val6  },key7: 'val7: val7,val7'}" | py -m json_corrector.jc
py -m json_corrector.jc "{'key1':'val1',key2: val2, 'key3': val3,key4: 'val4', key5: {  'key6': val6  },key7: 'val7: val7,val7'}"

Build

Firstly increase the version in pyproject.toml.

Windows

Checkout repo

git clone https://github.com/tschenkelz/json_corrector.git
cd json_corrector

Optional Cleanup

Remove-Item -Recurse -Force -ErrorAction SilentlyContinue .\dist\*

Optional Specify CA certs

$Env:REQUESTS_CA_BUNDLE  = "path\to\ca.pem"

Build & upload

py -m pip install --upgrade pip
py -m pip install --upgrade build
py -m build
py -m pip install --upgrade twine
twine upload dist/*

About

Fixes data that is almost json but not enterily.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages