Skip to content

Commit

Permalink
Update all dependencies and code
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed Nov 14, 2023
1 parent 7ba2055 commit 7276b47
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
27 changes: 13 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -18,8 +18,8 @@ repos:
additional_dependencies:
- beautifulsoup4~=4.12
- openpyxl~=3.1
- requests~=2.28
- Babel~=2.12
- requests~=2.31
- Babel~=2.13
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
Expand All @@ -31,7 +31,7 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py311-plus]
Expand All @@ -40,28 +40,27 @@ repos:
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black
args: [--quiet]
- repo: https://github.com/pycqa/pylint
rev: v3.0.0
rev: v3.0.1
hooks:
- id: pylint
args: ["--disable=fixme"]
additional_dependencies:
- Babel~=2.12
- Babel~=2.13
- beautifulsoup4~=4.12
- geocoder~=1.38
- lxml~=4.8
- lxml~=4.9
- openpyxl~=3.1
- python-docx~=0.8
- requests~=2.28
- python-docx~=1.1
- requests~=2.31
- sparql-client~=3.8
- wikidataintegrator~=0.9
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.7.0
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand All @@ -70,7 +69,7 @@ repos:
- openpyxl-stubs~=0.1
- types-babel~=2.11
- types-beautifulsoup4~=4.12
- types-requests~=2.28
- types-requests~=2.31
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: v0.7.3
hooks:
Expand Down
2 changes: 1 addition & 1 deletion python/database_searches/search_cultura_italia.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DEPRECIATED: Site is currently not working.

import sparql # type: ignore[import] # Can't find stubs
import sparql # type: ignore[import-not-found] # Can't find stubs

s = sparql.Service("http://dati.culturaitalia.it", "utf-8", "GET")
QUERY_STR = "SELECT DISTINCT ?class WHERE { ?s a ?class . } LIMIT 25 OFFSET 0"
Expand Down
2 changes: 1 addition & 1 deletion python/database_searches/search_isni.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests
from typing_utils import IndividualsDictCleaned
from wikidataintegrator import wdi_core # type: ignore[import]
from wikidataintegrator import wdi_core # type: ignore[import-not-found]
from write_files import write_single_json_file


Expand Down
2 changes: 1 addition & 1 deletion python/database_searches/search_koelman.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json

import docx # type: ignore[import]
import docx # type: ignore[import-not-found]


def search_koelman(filename: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion python/database_searches/search_wikidata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing_utils import IndividualsDictCleaned
from wikidataintegrator import wdi_core # type: ignore[import]
from wikidataintegrator import wdi_core # type: ignore[import-not-found]


def search_wikidata(database: IndividualsDictCleaned) -> None:
Expand Down
4 changes: 2 additions & 2 deletions python/date_functions/check_date_for_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def check_date(
if len(dates) != 2:
raise ValueError(f"Missing a '/' in function/title with date {function_period}")

begin_date, end_date = dates # type: ignore[misc]
begin_date, end_date = dates

if len(date) == 1:
if check_begin(date[0], begin_date) and check_end(date[0], end_date):
return True
elif check_begin(end_date, date[0]) and check_end(begin_date, date[1]): # type: ignore[misc]
elif check_begin(end_date, date[0]) and check_end(begin_date, date[1]):
return True
return False
4 changes: 2 additions & 2 deletions python/docx_functions/docx_make.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import re

import docx # type: ignore[import]
from docx.shared import Pt # type: ignore[import]
import docx # type: ignore[import-not-found]
from docx.shared import Pt # type: ignore[import-not-found]
from typing_utils import IndividualsDictCleaned


Expand Down
2 changes: 1 addition & 1 deletion python/json_geonames.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
from typing import cast

import geocoder # type: ignore[import]
import geocoder # type: ignore[import-not-found]
from typing_utils.translations_classes import TranslationDictCleanedPlacenames
from write_files import write_single_json_file

Expand Down
2 changes: 1 addition & 1 deletion python/json_load_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import re

import docx # type: ignore[import]
import docx # type: ignore[import-not-found]
from typing_utils import TranslationDict, TranslationDictTitles
from write_files import write_single_json_file

Expand Down
7 changes: 4 additions & 3 deletions python/json_save_load_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import json
import re

import docx # type: ignore[import]
import docx # type: ignore[import-not-found]
from docx_functions import database, parse_function, parse_title
from typing_utils import IndividualsDict
from typing_utils.translations_classes import IndividualsDictEntry
from write_files import write_single_json_file


Expand All @@ -19,7 +20,7 @@ def save_database( # pylint: disable=too-many-locals
previous_database: Dict with data from previous database
"""
doc = docx.Document(filename)
all_individuals: IndividualsDict = {}
all_individuals: dict[str, str | IndividualsDictEntry] = {}

# TODO: This does not work currently and removes fields we are using
for para in doc.paragraphs:
Expand Down Expand Up @@ -65,7 +66,7 @@ def save_database( # pylint: disable=too-many-locals

# Sort and Schema, shouldn't sort a dict but oh well..
all_individuals = dict(sorted(all_individuals.items(), key=lambda item: item[0]))
all_individuals = {"$schema": "../static/JSON/Individuals.json"} | all_individuals
all_individuals["$schema"] = "../static/JSON/Individuals.json"

write_single_json_file(all_individuals, "outputs", "Individuals.json")

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ beautifulsoup4~=4.12
geocoder~=1.38
lxml~=4.9
openpyxl~=3.1
python-docx~=0.8
python-docx~=1.1
requests~=2.31
sparql-client~=3.8
wikidataintegrator~=0.9

2 comments on commit 7276b47

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the currently missing titles:
no. Missing titles
These are the currently missing translations:
no. Missing translations
These are the errors found in titles:
no. Errors in titles

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the rest of the output log. Please check for additional errors:
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 10_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 11_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 12_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 13_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 14_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 15_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 16_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 17_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 18_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 19_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 1_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 20_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 21_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 22_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 23_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 24_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 25_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 26_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 27_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 28_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 29_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 2_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 30_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 31_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 32_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 33_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 34_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 35_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 36_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 37_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 38_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 39_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 3_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 40_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 41_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 42_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 43_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 44_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 45_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 46_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 47_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 48_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 49_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 4_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 50_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 51_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 52_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 53_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 54_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 55_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 56_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 57_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 58_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 59_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 5_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 60_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 61_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 62_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 63_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 64_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 65_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 66_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 67_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 68_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 69_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 6_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 7_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 8_it_IT.xlsx
File written to outputs/VolumesExcelSanitized_06_07_2022/it_IT/Paesi Bassi VOLUME 9_it_IT.xlsx
Starting to create XML file!
Finished writing volume ms276 - Volume 1
Finished writing volume ms277 - Volume 2
Finished writing volume ms278 - Volume 3
Finished writing volume ms279 - Volume 4
Finished writing volume ms280 - Volume 5
Finished writing volume ms281 - Volume 6
Finished writing volume ms282 - Volume 7
Finished writing volume ms283 - Volume 8
Finished writing volume ms284 - Volume 9
Finished writing volume ms285 - Volume 10
Finished writing volume ms286 - Volume 11
Finished writing volume ms287 - Volume 12
Finished writing volume ms288 - Volume 13
Finished writing volume ms289 - Volume 14
Finished writing volume ms290 - Volume 15
Finished writing volume ms291 - Volume 16
Finished writing volume ms292 - Volume 17
Finished writing volume ms293 - Volume 18
Finished writing volume ms294 - Volume 19
Finished writing volume ms295 - Volume 20
Finished writing volume ms296 - Volume 21
Finished writing volume ms297 - Volume 22
Finished writing volume ms298 - Volume 23
Finished writing volume ms299 - Volume 24
Finished writing volume ms300 - Volume 25
Finished writing volume ms301 - Volume 26
Finished writing volume ms302 - Volume 27
Finished writing volume ms303 - Volume 28
Finished writing volume ms304 - Volume 29
Finished writing volume ms305 - Volume 30
Finished writing volume ms306 - Volume 31
Finished writing volume ms307 - Volume 32
Finished writing volume ms308 - Volume 33
Finished writing volume ms309 - Volume 34
Finished writing volume ms310 - Volume 35
Finished writing volume ms311 - Volume 36
Finished writing volume ms312 - Volume 37
Finished writing volume ms313 - Volume 38
Finished writing volume ms314 - Volume 39
Finished writing volume ms315 - Volume 40
Finished writing volume ms316 - Volume 41
Finished writing volume ms317 - Volume 42
Finished writing volume ms318 - Volume 43
Finished writing volume ms319 - Volume 44
Finished writing volume ms320 - Volume 45
Finished writing volume ms321 - Volume 46
Finished writing volume ms322 - Volume 47
Finished writing volume ms323 - Volume 48
Finished writing volume ms324 - Volume 49
Finished writing volume ms325 - Volume 50
Finished writing volume ms326 - Volume 51
Finished writing volume ms327 - Volume 52
Finished writing volume ms328 - Volume 53
Finished writing volume ms329 - Volume 54
Finished writing volume ms330 - Volume 55
Finished writing volume ms331 - Volume 56
Finished writing volume ms332 - Volume 57
Finished writing volume ms333 - Volume 58
Finished writing volume ms334 - Volume 59
Finished writing volume ms335 - Volume 60
Finished writing volume ms336 - Volume 61
Finished writing volume ms337 - Volume 62
Finished writing volume ms338 - Volume 63
Finished writing volume ms339 - Volume 64
Finished writing volume ms340 - Volume 65
Finished writing volume ms341 - Volume 66
Finished writing volume ms342 - Volume 67
Finished writing volume ms343 - Volume 68
Finished writing volume ms344 - Volume 69
Printed file to outputs/Legation_Archive.xml
Writing XML complete!
XML-DTD check complete!

Please sign in to comment.