Skip to content

Commit

Permalink
refactor: excel2json (DEV-2547) (#487)
Browse files Browse the repository at this point in the history
* Creation of excel_to_json folder

Creation of folder and changes of import paths.

* Update test_shared.py

Cleaning Datatype

* Update test_shared.py

Removal of unnecessary statements.

* Excel_to_json_properties compliance

The compliance checks for the files were changed and testing added. To this end several generic functions were created and tested. The creation and validation of the json string remains wip.

* Cleaning of names

* Documentation

* Style Fix

* Style Fix

* Update test_utils.py

* linting corrections

* mock excel upload cleaning

* Linting Fixes

* Linting Fixes

* Fix Testing

* Update Test Data

* Rename Files

* Rename Test files

* Shortening docstring in properties

* Formatting

* Changes according to review

* Update src/dsp_tools/utils/excel_to_json/properties.py

Co-authored-by: Johannes Nussbaum <39048939+jnussbaum@users.noreply.github.com>

* Changes PR Review

* Consistency Naming Convention

* Naming changes

* Cleaning up docstrings

---------

Co-authored-by: Johannes Nussbaum <39048939+jnussbaum@users.noreply.github.com>
  • Loading branch information
Nora-Olivia-Ammann and jnussbaum committed Aug 30, 2023
1 parent 00d5ed6 commit 504a4ec
Show file tree
Hide file tree
Showing 32 changed files with 1,563 additions and 619 deletions.
8 changes: 4 additions & 4 deletions src/dsp_tools/cli.py
Expand Up @@ -13,10 +13,10 @@
from dsp_tools.fast_xmlupload.upload_files import upload_files
from dsp_tools.fast_xmlupload.upload_xml import fast_xmlupload
from dsp_tools.models.exceptions import UserError
from dsp_tools.utils.excel_to_json_lists import excel2lists, validate_lists_section_with_schema
from dsp_tools.utils.excel_to_json_project import excel2json
from dsp_tools.utils.excel_to_json_properties import excel2properties
from dsp_tools.utils.excel_to_json_resources import excel2resources
from dsp_tools.utils.excel_to_json.lists import excel2lists, validate_lists_section_with_schema
from dsp_tools.utils.excel_to_json.project import excel2json
from dsp_tools.utils.excel_to_json.properties import excel2properties
from dsp_tools.utils.excel_to_json.resources import excel2resources
from dsp_tools.utils.generate_templates import generate_template_repo
from dsp_tools.utils.id_to_iri import id_to_iri
from dsp_tools.utils.logging import get_logger
Expand Down
1 change: 0 additions & 1 deletion src/dsp_tools/fast_xmlupload/process_files.py
Expand Up @@ -19,7 +19,6 @@

from dsp_tools.models.exceptions import UserError
from dsp_tools.utils.logging import get_logger

from dsp_tools.utils.shared import http_call_with_retry

logger = get_logger(__name__, filesize_mb=100, backupcount=36)
Expand Down
3 changes: 1 addition & 2 deletions src/dsp_tools/fast_xmlupload/upload_xml.py
Expand Up @@ -5,12 +5,11 @@

from lxml import etree

from dsp_tools.fast_xmlupload.upload_files import get_pkl_files
from dsp_tools.models.exceptions import UserError
from dsp_tools.utils.logging import get_logger
from dsp_tools.utils.xml_upload import xml_upload

from dsp_tools.fast_xmlupload.upload_files import get_pkl_files

logger = get_logger(__name__)


Expand Down
4 changes: 2 additions & 2 deletions src/dsp_tools/models/sipi.py
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from datetime import datetime
import json
import os
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import Any

Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/models/xmlbitstream.py
@@ -1,4 +1,4 @@
from typing import cast, Optional
from typing import Optional, cast

from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/models/xmlvalue.py
@@ -1,7 +1,7 @@
from typing import Optional, Union, cast

from lxml import etree
import regex
from lxml import etree

from dsp_tools.models.value import KnoraStandoffXml

Expand Down
Empty file.
File renamed without changes.
Expand Up @@ -4,9 +4,9 @@
import regex

from dsp_tools.models.exceptions import BaseError
from dsp_tools.utils.excel_to_json_lists import excel2lists
from dsp_tools.utils.excel_to_json_properties import excel2properties
from dsp_tools.utils.excel_to_json_resources import excel2resources
from dsp_tools.utils.excel_to_json.lists import excel2lists
from dsp_tools.utils.excel_to_json.properties import excel2properties
from dsp_tools.utils.excel_to_json.resources import excel2resources


def excel2json(
Expand Down

0 comments on commit 504a4ec

Please sign in to comment.