diff --git a/python/data_parsing/__init__.py b/python/data_parsing/__init__.py index 303a2bb..1640263 100644 --- a/python/data_parsing/__init__.py +++ b/python/data_parsing/__init__.py @@ -7,9 +7,9 @@ ) __all__ = [ + "control_title", "full_name_with_database", - "name_string", - "initialize_translation_database", "initialize_database_for_xml", - "control_title", + "initialize_translation_database", + "name_string", ] diff --git a/python/database_controls/__init__.py b/python/database_controls/__init__.py index 0fb8cc2..90487af 100644 --- a/python/database_controls/__init__.py +++ b/python/database_controls/__init__.py @@ -11,9 +11,9 @@ "check_all_comments", "check_all_placenames", "check_all_sources", + "check_translations", "control_date", "control_functions", "control_titles", - "check_translations", "is_isni", ] diff --git a/python/database_searches/__init__.py b/python/database_searches/__init__.py index 84fd8f2..02d97a3 100644 --- a/python/database_searches/__init__.py +++ b/python/database_searches/__init__.py @@ -2,8 +2,8 @@ from database_searches.search_wikidata import search_wikidata, unspecified_wikidate __all__ = [ - "search_wikidata", - "unspecified_wikidate", "convert_wikidata_to_isni", "search_isni_api", + "search_wikidata", + "unspecified_wikidate", ] diff --git a/python/date_functions/__init__.py b/python/date_functions/__init__.py index 3e1f087..14c84ba 100644 --- a/python/date_functions/__init__.py +++ b/python/date_functions/__init__.py @@ -8,10 +8,10 @@ __all__ = [ "check_date", "check_date_earlier", + "check_date_for_missing_elements", "check_date_later", - "create_document_date", - "extract_date", "create_date_data", - "check_date_for_missing_elements", "create_date_tuple", + "create_document_date", + "extract_date", ] diff --git a/python/date_functions/check_date_for_earlylate.py b/python/date_functions/check_date_for_earlylate.py index 7abf7a4..11169a2 100644 --- a/python/date_functions/check_date_for_earlylate.py +++ b/python/date_functions/check_date_for_earlylate.py @@ -22,15 +22,15 @@ def check_date_earlier( or isinstance(row[4].value, date) ): raise ValueError(f"Excel cells should not be dates. Please check {row}") - if not row[2].value or early_date[0] is not None and int(row[2].value) > int(early_date[0]): + if not row[2].value or (early_date[0] is not None and int(row[2].value) > int(early_date[0])): return early_date if early_date[0] is not None and int(row[2].value) < int(early_date[0]): return row[2].value, row[3].value, row[4].value - if not row[3].value or early_date[1] is not None and int(row[3].value) > int(early_date[1]): + if not row[3].value or (early_date[1] is not None and int(row[3].value) > int(early_date[1])): return early_date if early_date[1] is not None and int(row[3].value) < int(early_date[1]): return row[2].value, row[3].value, row[4].value - if not row[4].value or early_date[2] is not None and int(row[4].value) > int(early_date[2]): + if not row[4].value or (early_date[2] is not None and int(row[4].value) > int(early_date[2])): return early_date if early_date[2] is not None and int(row[4].value) < int(early_date[2]): return row[2].value, row[3].value, row[4].value @@ -56,15 +56,15 @@ def check_date_later( or isinstance(row[4].value, date) ): raise ValueError(f"Excel cells should not be dates. Please check {row}") - if not row[2].value or late_date[0] is not None and int(row[2].value) < int(late_date[0]): + if not row[2].value or (late_date[0] is not None and int(row[2].value) < int(late_date[0])): return late_date if late_date[0] is not None and int(row[2].value) > int(late_date[0]): return row[2].value, row[3].value, row[4].value - if not row[3].value or late_date[1] is not None and int(row[3].value) < int(late_date[1]): + if not row[3].value or (late_date[1] is not None and int(row[3].value) < int(late_date[1])): return late_date if late_date[1] is not None and int(row[3].value) > int(late_date[1]): return row[2].value, row[3].value, row[4].value - if not row[4].value or late_date[2] is not None and int(row[4].value) < int(late_date[2]): + if not row[4].value or (late_date[2] is not None and int(row[4].value) < int(late_date[2])): return late_date if late_date[2] is not None and int(row[4].value) > int(late_date[2]): return row[2].value, row[3].value, row[4].value diff --git a/python/json_create_descriptive_stats.py b/python/json_create_descriptive_stats.py index 8419d55..5f2175e 100644 --- a/python/json_create_descriptive_stats.py +++ b/python/json_create_descriptive_stats.py @@ -62,7 +62,7 @@ def create_type_statistics(filename: str, type_list: list[int], skip: bool) -> N if data["wikidata:id"]: c_wikidata += 1 start_string = " Number of entries with" - if type_list != [] and skip or type_list != [0, 1, 2, 3, 4, 5] and not skip: + if (type_list != [] and skip) or (type_list != [0, 1, 2, 3, 4, 5] and not skip): type_string = f"the types {' and '.join(str(i) for i in type_list)}:" else: type_string = "the full database:" diff --git a/python/typing_utils/__init__.py b/python/typing_utils/__init__.py index a28879a..39e0050 100644 --- a/python/typing_utils/__init__.py +++ b/python/typing_utils/__init__.py @@ -17,22 +17,22 @@ ) __all__ = [ - "TranslationDictCleanedTitles", - "TranslationDictEntry", - "TranslationDictPlacenames", + "Database", + "DateData", + "DateTuple", + "FileData", + "IndividualsDict", + "IndividualsDictCleaned", + "IndividualsDictEntry", + "SeriesData", "TranslationDict", "TranslationDictCleaned", "TranslationDictCleanedDocuments", "TranslationDictCleanedPlacenames", - "TranslationDictTitles", - "TranslationDictEntryTitles", - "IndividualsDictEntry", + "TranslationDictCleanedTitles", + "TranslationDictEntry", "TranslationDictEntryPlacenames", - "IndividualsDict", - "IndividualsDictCleaned", - "Database", - "SeriesData", - "DateData", - "FileData", - "DateTuple", + "TranslationDictEntryTitles", + "TranslationDictPlacenames", + "TranslationDictTitles", ] diff --git a/python/xlsx_functions/__init__.py b/python/xlsx_functions/__init__.py index 1f5917b..5b628c1 100644 --- a/python/xlsx_functions/__init__.py +++ b/python/xlsx_functions/__init__.py @@ -6,11 +6,11 @@ from xlsx_functions.translate import translate_xlsx __all__ = [ + "add_identifier_columns", + "compare_rows", "fill_in_xlsx", "parse_file", "parse_series", "sanitize_xlsx", "translate_xlsx", - "compare_rows", - "add_identifier_columns", ] diff --git a/python/xml_functions/__init__.py b/python/xml_functions/__init__.py index cc39341..a469e96 100644 --- a/python/xml_functions/__init__.py +++ b/python/xml_functions/__init__.py @@ -6,12 +6,12 @@ from xml_functions.xml_writer import XMLWriter __all__ = [ - "add_unitdate", + "XMLWriter", + "add_dao", "add_dateset", "add_geognames", "add_persname", + "add_unitdate", "add_unittitle", "fix_daoset", - "add_dao", - "XMLWriter", ]