json-converter
package is not owned or supported by Unstructured. For questions and
requests, see the Issues tab of the
json-converter
repository in GitHub.Install dependencies
Identify the JSON file to transform
Create the JSON field mappings file
type
field is renamed to content_type
.element_id
field is renamed to content_id
.text
field is renamed to content
.page_number
field nested inside metadata
is renamed to page
and is nested inside content_properties
.filetype
, languages
, and filename
) are dropped.json-converter
page on PyPI or the
README in the json-converter
repository in GitHub.
Add and run the transform code
LOCAL_FILE_INPUT_PATH
to the local path to the source JSON file.LOCAL_FILE_OUTPUT_PATH
to the local path to the target JSON file.LOCAL_FIELD_MAPPINGS_PATH
to the local path to the JSON field mappings file.LOCAL_FILE_OUTPUT_PATH
for the transformed JSON file.
json-converter
package with newer versions of Python such as 3.11 and later,
Python tries to use an outdated import in this json-converter
package.
Solution: Update the json-converter
package’s source code to use a different import, as follows:
json-converter
package’s source location, by running the pip show
command:
json-converter
package’s source code.
json_mapper.py
.
.abc
: