Skip to content

Commit

Permalink
added json output
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDaniel committed Mar 4, 2024
1 parent a7cb35f commit 5178c4f
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 85 deletions.
7 changes: 4 additions & 3 deletions dev_requirements/requirements-coverage.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SHA1:6dafbcf610e9f81897b65ee9142715ab2e793f9e
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-coverage.in
# pip-compile-multi
#
coverage==7.4.3
# via -r dev_requirements/requirements-coverage.in
# via -r dev_requirements\requirements-coverage.in
21 changes: 10 additions & 11 deletions dev_requirements/requirements-formatting.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# SHA1:2c7ffcd29222de3114c7f7994911f1b69d06b6b3
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-formatting.in
# pip-compile-multi
#
black==24.2.0
# via -r dev_requirements/requirements-formatting.in
click==8.1.3
# via -r dev_requirements\requirements-formatting.in
click==8.1.7
# via black
colorama==0.4.6
# via click
isort==5.13.2
# via -r dev_requirements/requirements-formatting.in
# via -r dev_requirements\requirements-formatting.in
mypy-extensions==1.0.0
# via black
packaging==23.0
packaging==23.2
# via black
pathspec==0.11.0
pathspec==0.12.1
# via black
platformdirs==4.2.0
# via black
tomli==2.0.1
# via black
typing-extensions==4.10.0
# via black
17 changes: 8 additions & 9 deletions dev_requirements/requirements-linting.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# SHA1:0e15f8789b9d62fe90d1f1b0b6a7e32f13b99b19
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-linting.in
# pip-compile-multi
#
astroid==3.1.0
# via pylint
dill==0.3.7
colorama==0.4.6
# via pylint
dill==0.3.8
# via pylint
isort==5.13.2
# via pylint
Expand All @@ -15,10 +18,6 @@ mccabe==0.7.0
platformdirs==4.2.0
# via pylint
pylint==3.1.0
# via -r dev_requirements/requirements-linting.in
tomli==2.0.1
# via pylint
tomlkit==0.11.6
# via -r dev_requirements\requirements-linting.in
tomlkit==0.12.4
# via pylint
typing-extensions==4.10.0
# via astroid
69 changes: 26 additions & 43 deletions dev_requirements/requirements-packaging.txt
Original file line number Diff line number Diff line change
@@ -1,56 +1,49 @@
# SHA1:93e4fbf2b6cce1574fe3d5315360512fa9927699
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-packaging.in
# pip-compile-multi
#
bleach==6.0.0
# via readme-renderer
build==1.1.1
# via -r dev_requirements/requirements-packaging.in
certifi==2023.7.22
# via -r dev_requirements\requirements-packaging.in
certifi==2024.2.2
# via requests
cffi==1.15.1
# via cryptography
charset-normalizer==3.1.0
charset-normalizer==3.3.2
# via requests
cryptography==42.0.4
# via secretstorage
colorama==0.4.6
# via build
docutils==0.20.1
# via readme-renderer
idna==3.4
idna==3.6
# via requests
importlib-metadata==6.7.0
# via
# keyring
# twine
jaraco-classes==3.2.3
importlib-metadata==7.0.1
# via twine
jaraco-classes==3.3.1
# via keyring
jeepney==0.8.0
# via
# keyring
# secretstorage
keyring==23.13.1
keyring==24.3.1
# via twine
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
more-itertools==9.1.0
more-itertools==10.2.0
# via jaraco-classes
packaging==23.1
nh3==0.2.15
# via readme-renderer
packaging==23.2
# via build
pkginfo==1.9.6
pkginfo==1.10.0
# via twine
pycparser==2.21
# via cffi
pygments==2.15.1
pygments==2.17.2
# via
# readme-renderer
# rich
pyproject-hooks==1.0.0
# via build
readme-renderer==37.3
pywin32-ctypes==0.2.2
# via keyring
readme-renderer==43.0
# via twine
requests==2.31.0
# via
Expand All @@ -60,23 +53,13 @@ requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==13.4.2
rich==13.7.1
# via twine
secretstorage==3.3.3
# via keyring
six==1.16.0
# via bleach
tomli==2.0.1
# via
# build
# pyproject-hooks
twine==5.0.0
# via -r dev_requirements/requirements-packaging.in
urllib3==2.0.7
# via -r dev_requirements\requirements-packaging.in
urllib3==2.2.1
# via
# requests
# twine
webencodings==0.5.1
# via bleach
zipp==3.15.0
zipp==3.17.0
# via importlib-metadata
9 changes: 5 additions & 4 deletions dev_requirements/requirements-spell_check.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SHA1:a7062511e9640ed2a5c2dea1da5c8b5f59c0f0d7
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-spellcheck.in
# pip-compile-multi
#
codespell==2.2.6
# via -r dev_requirements/requirements-spell_check.in
# via -r dev_requirements\requirements-spell_check.in
15 changes: 7 additions & 8 deletions dev_requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# SHA1:0eaa389e1fdb3a1917c0f987514bd561be5718ee
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-tests.in
# pip-compile-multi
#
exceptiongroup==1.1.3
colorama==0.4.6
# via pytest
iniconfig==2.0.0
# via pytest
packaging==23.0
packaging==23.2
# via pytest
pluggy==1.4.0
# via pytest
pytest==8.1.0
# via -r dev_requirements/requirements-tests.in
tomli==2.0.1
# via pytest
pytest==8.0.2
# via -r dev_requirements\requirements-tests.in
9 changes: 4 additions & 5 deletions dev_requirements/requirements-type_check.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# SHA1:7983aaa01d64547827c20395d77e248c41b2572f
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile requirements-type_check.in
# pip-compile-multi
#
mypy==1.8.0
# via -r dev_requirements/requirements-type_check.in
# via -r dev_requirements\requirements-type_check.in
mypy-extensions==1.0.0
# via mypy
tomli==2.0.1
# via mypy
typing-extensions==4.10.0
# via mypy
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
annotated-types==0.6.0
# via pydantic
click==8.1.3
click==8.1.7
# via migmose (pyproject.toml)
colorama==0.4.6
# via
Expand Down
5 changes: 4 additions & 1 deletion src/migmose/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
contains CLI logic for migmose.
"""

import json
from pathlib import Path
from typing import Generator, Union

Expand Down Expand Up @@ -79,7 +80,9 @@ def preliminary_output_as_json(table: list[str], message_type: str, output_dir:
if not output_dir.exists():
output_dir.mkdir(parents=True, exist_ok=True)
file_path = output_dir.joinpath(f"{message_type}_preliminary_output.json")
file_path.write_text(str(table), encoding="utf-8")
structured_json = {line: None for line in table}
with open(file_path, "w") as json_file:
json.dump(structured_json, json_file, indent=4, encoding="utf-8")
logger.info(f"Created and wrote to {file_path}")


Expand Down

0 comments on commit 5178c4f

Please sign in to comment.