Skip to content

Commit

Permalink
Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Jun 17, 2024
1 parent cb55200 commit dc1d37a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Usage
=====

**Parse, Compile, Render, Convert and Validate**
Omi can read(parse), compile, Render(json compilant), convert(convert metadata from v1.4 to v1.5 structure) and validate - a json
file or object that is compliant with the oemetadata spec. This is usefull to do various operations that help to integrate with - as
well as in interact with the oemetadata. Some parts of this tool might still be volatile but the code quality is conventionsly improved
Omi can read(parse), compile, Render(json compilant), convert(convert metadata from v1.4 to v1.5 structure) and validate - a json
file or object that is compliant with the oemetadata spec. This is usefull to do various operations that help to integrate with - as
well as in interact with the oemetadata. Some parts of this tool might still be volatile but the code quality is conventionsly improved
as this module is a core component of the oeplatfroms metadata integration system.

Check if omi is able to read a oemetadata file (for version 1.4 and 1.5)
Expand All @@ -96,8 +96,8 @@ CLI - oemetadata version 1.4::

omi translate -f oep-v1.4 -t oep-v1.4 examples/data/metadata_v14.json

omi is able to read a JSON file and parse it into one of the internal Python structures (depending on the oemetadata version).
The OEPMetadata Python object can then be compiled and converted back to JSON. You can manipulate a successfully parsed
omi is able to read a JSON file and parse it into one of the internal Python structures (depending on the oemetadata version).
The OEPMetadata Python object can then be compiled and converted back to JSON. You can manipulate a successfully parsed
OEPMetadata object.

Module usage::
Expand All @@ -120,7 +120,7 @@ by using a CLI command.

CLI - oemetadata conversion from v1.4 to v1.5::

omi convert -i {input/path} -o {output/path}
omi convert -i {input/path} -o {output/path}

**Validation**

Expand All @@ -142,21 +142,21 @@ Module usage::

parser = JSONParser()
parser.validate(metadata)
# check if your metadata is valid for the given schmea

# check if your metadata is valid for the given schmea
schema = ... get a schema or import form oemetadata module
parser.is_valid(metadata, schema)

**Additional Fields - not related to the OEMetadata specification**

Sometimes it is necessary to store additional key-value pairs along with the keys included in the OEMetadata specification.
OMI's compiler methods are capable of handling additional arguments or key-value arguments, but this must be
be explicitly specified.
OMI's compiler methods are capable of handling additional arguments or key-value arguments, but this must be
be explicitly specified.

To add additional key-value pairs, you must:
To add additional key-value pairs, you must:

NOTE: If you save the renderer return value in a json file and try to parse the file, the extra field is not included.
You must read the json file using Python and then add the extra field back oemetadata object as shown below.
You must read the json file using Python and then add the extra field back oemetadata object as shown below.

1 Parse the oemetadata from json file / variable into omis internal structure::

Expand Down
1 change: 0 additions & 1 deletion src/omi/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Entrypoint module, in case you use `python -momi`.
Why does this file exist, and why __main__? For more info, read:
- https://www.python.org/dev/peps/pep-0338/
Expand Down

0 comments on commit dc1d37a

Please sign in to comment.