dsp-tools 8.2.0.post10__tar.gz → 18.1.0.post5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dsp-tools might be problematic. Click here for more details.
- dsp_tools-18.1.0.post5/PKG-INFO +90 -0
- dsp_tools-18.1.0.post5/docs/index.md +54 -0
- dsp_tools-18.1.0.post5/pyproject.toml +207 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/__init__.py +5 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/cli/args.py +47 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/cli/call_action.py +82 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/cli/call_action_files_only.py +74 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/cli/call_action_with_network.py +202 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/cli/create_parsers.py +185 -68
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/cli/entry_point.py +19 -19
- dsp_tools-18.1.0.post5/src/dsp_tools/cli/utils.py +87 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/authentication_client.py +14 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/authentication_client_live.py +66 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/utils → dsp_tools-18.1.0.post5/src/dsp_tools/clients}/connection.py +2 -18
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/connection_live.py +233 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/fuseki_metrics.py +60 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/legal_info_client.py +23 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/legal_info_client_live.py +137 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/list_client.py +49 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/list_client_live.py +166 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/metadata_client.py +24 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/metadata_client_live.py +47 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/ontology_clients.py +36 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/ontology_create_client_live.py +120 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/ontology_get_client_live.py +80 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/project_client.py +10 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/clients/project_client_live.py +37 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/communicate_problems.py +19 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/constants.py +7 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/create_on_server/cardinalities.py +127 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/create_on_server/lists.py +163 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/create_on_server/mappers.py +12 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/lists_only.py +47 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/models/input_problems.py +45 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/models/parsed_ontology.py +48 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/models/parsed_project.py +62 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/models/rdf_ontology.py +12 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/models/server_project_info.py +39 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/parsing/parse_lists.py +45 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/parsing/parse_ontology.py +108 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/parsing/parse_project.py +118 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/parsing/parsing_utils.py +40 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/serialisation/ontology.py +41 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/CLAUDE.md +101 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/json_header.py +321 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists/compliance_checks.py +292 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists/make_lists.py +247 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists/models/deserialise.py +30 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists/models/input_error.py +216 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists/models/serialise.py +57 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists/utils.py +81 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2json/models/input_error.py +146 -233
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/models/json_header.py +175 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/models/ontology.py +76 -0
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/excel2json/lists.py → dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/old_lists.py +19 -78
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2json/project.py +108 -81
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2json/properties.py +124 -88
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2json/resources.py +208 -204
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2json/utils.py +67 -6
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2xml/__init__.py +2 -2
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2xml/excel2xml_cli.py +7 -17
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2xml/excel2xml_lib.py +460 -609
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2xml/propertyelement.py +10 -10
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/id2iri.py +24 -14
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py +174 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/ingest_xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/create_resources}/apply_ingest_id.py +6 -11
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/create_resources/upload_xml.py +166 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/ingest_xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/create_resources}/user_information.py +2 -2
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/ingest_files/ingest_files.py +64 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/upload_files/filechecker.py +20 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/upload_files/input_error.py +57 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/upload_files/upload_failures.py +66 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/upload_files/upload_files.py +67 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/create/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/create/parse_project.py +108 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/create/project_create_all.py +608 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/create/project_create_default_permissions.py +135 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/create/project_create_ontologies.py +460 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/project/create/project_validate.py +347 -146
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/get/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/get}/get.py +29 -13
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/get/get_permissions.py +257 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/get/get_permissions_legacy.py +89 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/context.py +6 -6
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/group.py +5 -10
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/listnode.py +5 -35
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/model.py +1 -1
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/ontology.py +9 -14
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/project.py +13 -6
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/propertyclass.py +9 -16
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/resourceclass.py +8 -46
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/user.py +20 -47
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/models/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/models/permissions_client.py +68 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/models/permissions_models.py +10 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/models/project_definition.py +25 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/resume_xmlupload/__init__.py +0 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/resume_xmlupload/resume_xmlupload.py +18 -18
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/start_stack.py +128 -86
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/CLAUDE.md +159 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/constants.py +59 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/mappers.py +143 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/models/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/models/api_responses.py +45 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/models/input_problems.py +119 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/models/rdf_like_data.py +117 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/models/validation.py +106 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/prepare_data/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/prepare_data/get_rdf_like_data.py +296 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/prepare_data/make_data_graph.py +91 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/prepare_data/prepare_data.py +180 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/process_validation_report/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/process_validation_report/get_user_validation_message.py +358 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/process_validation_report/query_validation_result.py +507 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/process_validation_report/reformat_validation_results.py +150 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/shacl_cli_validator.py +70 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/sparql/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/sparql/cardinality_shacl.py +209 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/sparql/construct_shacl.py +92 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/sparql/legal_info_shacl.py +36 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/sparql/value_shacl.py +357 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/utils.py +59 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/validate_data.py +279 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/validation/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/validation/check_duplicate_files.py +55 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/validation/check_for_unknown_classes.py +67 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/validation/get_validation_report.py +94 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/validate_data/validation/validate_ontology.py +107 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/CLAUDE.md +292 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/make_rdf_graph/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/make_rdf_graph/constants.py +63 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/make_rdf_graph/jsonld_utils.py +44 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/make_rdf_graph/make_file_value.py +77 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/make_rdf_graph/make_resource_and_values.py +114 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/make_rdf_graph/make_values.py +262 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/bitstream_info.py +18 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/formatted_text_value.py +10 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/ingest.py +143 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/models/input_problems.py +6 -14
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/lookup_models.py +21 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/permission.py +45 -0
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/deserialise/xmlpermission.py → dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/permissions_parsed.py +6 -4
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/processed/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/processed/file_values.py +29 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/processed/res.py +27 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/processed/values.py +101 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/models/rdf_models.py +26 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/models/upload_clients.py +3 -3
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/models/upload_state.py +2 -4
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input}/ark2iri.py +1 -1
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input/get_processed_resources.py +250 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input}/iiif_uri_validator.py +1 -3
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input}/list_client.py +15 -10
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input/prepare_xml_input.py +66 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input/read_validate_xml_file.py +39 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/prepare_xml_input/transform_input_values.py +117 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/resource_create_client.py +25 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/richtext_id2iri.py +37 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/stash/__init__.py +0 -0
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/stash/construct_and_analyze_graph.py → dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/stash/analyse_circular_reference_graph.py +64 -131
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/stash/create_info_for_graph.py +53 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/stash/graph_models.py +13 -8
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py +68 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/stash/stash_models.py +4 -9
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py +34 -40
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py +98 -108
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/upload_config.py +8 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/commands/xmlupload/write_diagnostic_info.py +27 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/xmlupload.py +215 -192
- dsp_tools-18.1.0.post5/src/dsp_tools/config/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/config/logger_config.py +68 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/utils → dsp_tools-18.1.0.post5/src/dsp_tools/config}/warnings_config.py +4 -1
- dsp_tools-18.1.0.post5/src/dsp_tools/error/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/custom_warnings.py +39 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/exceptions.py +187 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/problems.py +10 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/xmllib_errors.py +20 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/xmllib_warnings.py +54 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/xmllib_warnings_util.py +158 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/error/xsd_validation_error_msg.py +19 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/legacy_models/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/models → dsp_tools-18.1.0.post5/src/dsp_tools/legacy_models}/datetimestamp.py +7 -7
- {dsp_tools-8.2.0.post10/src/dsp_tools/models → dsp_tools-18.1.0.post5/src/dsp_tools/legacy_models}/langstring.py +1 -1
- {dsp_tools-8.2.0.post10/src/dsp_tools/models → dsp_tools-18.1.0.post5/src/dsp_tools/legacy_models}/projectContext.py +4 -4
- dsp_tools-18.1.0.post5/src/dsp_tools/py.typed +0 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/resources/schema/data.xsd +128 -175
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/resources/schema/lists-only.json +4 -23
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/resources/schema/project.json +80 -35
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/resources/schema/properties-only.json +1 -4
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/start-stack/docker-compose.override-host.j2 +11 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/start-stack/docker-compose.override.yml +11 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/resources/start-stack/docker-compose.yml +41 -30
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/start-stack/dsp-app-config.json +45 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/start-stack/dsp-app-config.override-host.j2 +26 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/validate_data/api-shapes-resource-cardinalities.ttl +191 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/validate_data/api-shapes.ttl +804 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/validate_data/shacl-cli-image.yml +4 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/resources/validate_data/validate-ontology.ttl +99 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/ansi_colors.py +32 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/data_formats/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/utils → dsp_tools-18.1.0.post5/src/dsp_tools/utils/data_formats}/date_util.py +13 -1
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/data_formats/iri_util.py +30 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/utils → dsp_tools-18.1.0.post5/src/dsp_tools/utils/data_formats}/shared.py +2 -36
- {dsp_tools-8.2.0.post10/src/dsp_tools/utils → dsp_tools-18.1.0.post5/src/dsp_tools/utils/data_formats}/uri_util.py +16 -5
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/fuseki_bloating.py +63 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/json_parsing.py +46 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/rdflib_constants.py +22 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/rdflib_utils.py +10 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/replace_id_with_iri.py +66 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/request_utils.py +225 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/xml_parsing/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/xml_parsing/get_lookups.py +32 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/xml_parsing/get_parsed_resources.py +325 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/xml_parsing/models/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/xml_parsing/models/parsed_resource.py +76 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/utils/xml_parsing/parse_clean_validate_xml.py +158 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/CLAUDE.md +302 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/__init__.py +49 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/general_functions.py +877 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/checkers.py +153 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/circumvent_circular_imports.py +36 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/constants.py +46 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/input_converters.py +150 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/serialise_file_value.py +57 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/serialise_resource.py +176 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/serialise_values.py +151 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/internal/type_aliases.py +11 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/config_options.py +28 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/date_formats.py +48 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/dsp_base_resources.py +1671 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/internal/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/internal/file_values.py +157 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/internal/geometry.py +161 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/internal/migration_metadata.py +52 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/internal/serialise_permissions.py +66 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/internal/values.py +341 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/licenses/__init__.py +0 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/licenses/other.py +59 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/licenses/recommended.py +107 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/permissions.py +41 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/res.py +1828 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/models/root.py +347 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/value_checkers.py +419 -0
- dsp_tools-18.1.0.post5/src/dsp_tools/xmllib/value_converters.py +777 -0
- dsp_tools-8.2.0.post10/LICENSE +0 -674
- dsp_tools-8.2.0.post10/PKG-INFO +0 -122
- dsp_tools-8.2.0.post10/docs/index.md +0 -86
- dsp_tools-8.2.0.post10/pyproject.toml +0 -237
- dsp_tools-8.2.0.post10/src/dsp_tools/__init__.py +0 -1
- dsp_tools-8.2.0.post10/src/dsp_tools/cli/args.py +0 -11
- dsp_tools-8.2.0.post10/src/dsp_tools/cli/call_action.py +0 -237
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/excel2json/models/list_node.py +0 -109
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/excel2json/new_lists.py +0 -703
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py +0 -105
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/create/project_create.py +0 -1107
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/create/project_create_lists.py +0 -204
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models/project_definition.py +0 -12
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/rosetta.py +0 -124
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/template.py +0 -30
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/check_consistency_with_ontology.py +0 -242
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/deserialise/deserialise_value.py +0 -188
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/deserialise/xmlresource.py +0 -111
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/formatted_text_value.py +0 -35
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/ingest.py +0 -151
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/namespace_context.py +0 -39
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/ontology_lookup_models.py +0 -160
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/ontology_problem_models.py +0 -169
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/permission.py +0 -84
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/serialise/jsonld_serialiser.py +0 -40
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/serialise/serialise_value.py +0 -51
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/ontology_client.py +0 -92
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/project_client.py +0 -91
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/read_validate_xml_file.py +0 -99
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/resource_create_client.py +0 -485
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py +0 -135
- dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/write_diagnostic_info.py +0 -22
- dsp_tools-8.2.0.post10/src/dsp_tools/models/custom_warnings.py +0 -31
- dsp_tools-8.2.0.post10/src/dsp_tools/models/exceptions.py +0 -90
- dsp_tools-8.2.0.post10/src/dsp_tools/resources/0100-template-repo/template.json +0 -45
- dsp_tools-8.2.0.post10/src/dsp_tools/resources/0100-template-repo/template.xml +0 -27
- dsp_tools-8.2.0.post10/src/dsp_tools/resources/start-stack/docker-compose.override.yml +0 -5
- dsp_tools-8.2.0.post10/src/dsp_tools/resources/start-stack/start-stack-config.yml +0 -4
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/connection_live.py +0 -383
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/iri_util.py +0 -14
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/logger_config.py +0 -41
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/set_encoder.py +0 -20
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/xml_utils.py +0 -123
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/xml_validation.py +0 -197
- dsp_tools-8.2.0.post10/src/dsp_tools/utils/xml_validation_models.py +0 -68
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/cli/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands → dsp_tools-18.1.0.post5/src/dsp_tools/clients}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/excel2json → dsp_tools-18.1.0.post5/src/dsp_tools/commands}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/excel2json/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/create}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/ingest_xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/create_on_server}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project → dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/models}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/create → dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/parsing}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/create/serialisation}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/resume_xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload → dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/lists}/models/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/deserialise → dsp_tools-18.1.0.post5/src/dsp_tools/commands/excel2json/models}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/excel2json/models/list_node_name.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/models/serialise → dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/xmlupload/stash → dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/create_resources}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/ingest_files}/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/utils → dsp_tools-18.1.0.post5/src/dsp_tools/commands/ingest_xmlupload/upload_files}/__init__.py +0 -0
- /dsp_tools-8.2.0.post10/src/dsp_tools/py.typed → /dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/__init__.py +0 -0
- {dsp_tools-8.2.0.post10/src/dsp_tools/commands/project/models → dsp_tools-18.1.0.post5/src/dsp_tools/commands/project/legacy_models}/helpers.py +0 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/commands/xmlupload/iri_resolver.py +0 -0
- {dsp_tools-8.2.0.post10 → dsp_tools-18.1.0.post5}/src/dsp_tools/resources/schema/resources-only.json +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: dsp-tools
|
|
3
|
+
Version: 18.1.0.post5
|
|
4
|
+
Summary: DSP-TOOLS is a Python package with a command line interface that helps you interact with a DaSCH service platform (DSP) server.
|
|
5
|
+
Author: DaSCH - Swiss National Data and Service Center for the Humanities
|
|
6
|
+
Author-email: DaSCH - Swiss National Data and Service Center for the Humanities <info@dasch.swiss>
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
9
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Dist: argparse
|
|
12
|
+
Requires-Dist: dotenv
|
|
13
|
+
Requires-Dist: jinja2
|
|
14
|
+
Requires-Dist: jsonpath-ng
|
|
15
|
+
Requires-Dist: jsonschema
|
|
16
|
+
Requires-Dist: loguru
|
|
17
|
+
Requires-Dist: lxml
|
|
18
|
+
Requires-Dist: networkx
|
|
19
|
+
Requires-Dist: openpyxl
|
|
20
|
+
Requires-Dist: packaging
|
|
21
|
+
Requires-Dist: pandas[excel]
|
|
22
|
+
Requires-Dist: polars
|
|
23
|
+
Requires-Dist: pyld
|
|
24
|
+
Requires-Dist: pyyaml
|
|
25
|
+
Requires-Dist: rdflib
|
|
26
|
+
Requires-Dist: regex
|
|
27
|
+
Requires-Dist: requests
|
|
28
|
+
Requires-Dist: rustworkx
|
|
29
|
+
Requires-Dist: tqdm
|
|
30
|
+
Requires-Dist: typing-extensions
|
|
31
|
+
Requires-Python: >=3.12
|
|
32
|
+
Project-URL: Documentation, https://docs.dasch.swiss/latest/DSP-TOOLS/
|
|
33
|
+
Project-URL: Homepage, https://www.dasch.swiss/
|
|
34
|
+
Project-URL: Repository, https://github.com/dasch-swiss/dsp-tools.git
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
[](https://pypi.org/project/dsp-tools/)
|
|
38
|
+
[](https://pypi.org/project/dsp-tools/)
|
|
39
|
+
[](https://pypi.org/project/dsp-tools/)
|
|
40
|
+
[](https://github.com/astral-sh/ruff)
|
|
41
|
+
[](https://github.com/astral-sh/uv)
|
|
42
|
+
[](https://github.com/python/mypy)
|
|
43
|
+
|
|
44
|
+
# DSP-TOOLS Documentation
|
|
45
|
+
|
|
46
|
+
## Installing `dsp-tools`
|
|
47
|
+
|
|
48
|
+
To install the latest version, run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip3 install dsp-tools
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
To update to the latest version run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip3 install --upgrade dsp-tools
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> 🚨 If your Python version is older than ours,
|
|
61
|
+
> pip will silently install an outdated version of DSP-TOOLS.
|
|
62
|
+
> DSP-TOOLS requires one of these Python versions:
|
|
63
|
+
> [](https://pypi.org/project/dsp-tools/)
|
|
64
|
+
> The most recent version of DSP-TOOLS is
|
|
65
|
+
> [](https://pypi.org/project/dsp-tools/)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
The `dsp-tools` package provides you with functionalities in the command line
|
|
70
|
+
to interact with the [DSP-API](https://github.com/dasch-swiss/dsp-api), both remote and locally.
|
|
71
|
+
Additionally, it contains the `xmllib` which helps you construct the XML file required for a mass upload.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## Where To Start?
|
|
75
|
+
|
|
76
|
+
`dsp-tools` provides you with the following core functionalities.
|
|
77
|
+
|
|
78
|
+
- **Running a Local Stack:** If you want to run your own DSP stack locally, take a look [here](./local-stack.md).
|
|
79
|
+
- **Data Modelling:** There are several ways to create a data model with `dsp-tools`
|
|
80
|
+
- Take a look at the technical specification for the [JSON file](./data-model/json-project/overview.md).
|
|
81
|
+
- Or take a look at our tool to [convert Excel files into the JSON format](./data-model/excel2json.md).
|
|
82
|
+
- You can create a data model on the DSP-APP. To re-use that data model on another server
|
|
83
|
+
you can use the CLI command described [here](./data-model/data-model-cli.md#get).
|
|
84
|
+
- **Data for Mass-Upload:**
|
|
85
|
+
- If you want to create the XML file required for a mass-upload onto DSP, take a look at the [`xmllib`](./xmllib-docs/overview.md).
|
|
86
|
+
- You can find an in-depth explanation of our XML file format [here](./data-file/xml-data-file.md).
|
|
87
|
+
Please note, that we recommend to use the `xmllib` library to create the file
|
|
88
|
+
as we will ensure interoperability between the DSP-API requirements and your input.
|
|
89
|
+
- If you want to validate and upload your XML file take a look [here](./data-file/data-file-commands.md).
|
|
90
|
+
Please note, that only DaSCH employees are permitted to upload data on a production server.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[](https://pypi.org/project/dsp-tools/)
|
|
2
|
+
[](https://pypi.org/project/dsp-tools/)
|
|
3
|
+
[](https://pypi.org/project/dsp-tools/)
|
|
4
|
+
[](https://github.com/astral-sh/ruff)
|
|
5
|
+
[](https://github.com/astral-sh/uv)
|
|
6
|
+
[](https://github.com/python/mypy)
|
|
7
|
+
|
|
8
|
+
# DSP-TOOLS Documentation
|
|
9
|
+
|
|
10
|
+
## Installing `dsp-tools`
|
|
11
|
+
|
|
12
|
+
To install the latest version, run:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip3 install dsp-tools
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
To update to the latest version run:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip3 install --upgrade dsp-tools
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
> 🚨 If your Python version is older than ours,
|
|
25
|
+
> pip will silently install an outdated version of DSP-TOOLS.
|
|
26
|
+
> DSP-TOOLS requires one of these Python versions:
|
|
27
|
+
> [](https://pypi.org/project/dsp-tools/)
|
|
28
|
+
> The most recent version of DSP-TOOLS is
|
|
29
|
+
> [](https://pypi.org/project/dsp-tools/)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
The `dsp-tools` package provides you with functionalities in the command line
|
|
34
|
+
to interact with the [DSP-API](https://github.com/dasch-swiss/dsp-api), both remote and locally.
|
|
35
|
+
Additionally, it contains the `xmllib` which helps you construct the XML file required for a mass upload.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Where To Start?
|
|
39
|
+
|
|
40
|
+
`dsp-tools` provides you with the following core functionalities.
|
|
41
|
+
|
|
42
|
+
- **Running a Local Stack:** If you want to run your own DSP stack locally, take a look [here](./local-stack.md).
|
|
43
|
+
- **Data Modelling:** There are several ways to create a data model with `dsp-tools`
|
|
44
|
+
- Take a look at the technical specification for the [JSON file](./data-model/json-project/overview.md).
|
|
45
|
+
- Or take a look at our tool to [convert Excel files into the JSON format](./data-model/excel2json.md).
|
|
46
|
+
- You can create a data model on the DSP-APP. To re-use that data model on another server
|
|
47
|
+
you can use the CLI command described [here](./data-model/data-model-cli.md#get).
|
|
48
|
+
- **Data for Mass-Upload:**
|
|
49
|
+
- If you want to create the XML file required for a mass-upload onto DSP, take a look at the [`xmllib`](./xmllib-docs/overview.md).
|
|
50
|
+
- You can find an in-depth explanation of our XML file format [here](./data-file/xml-data-file.md).
|
|
51
|
+
Please note, that we recommend to use the `xmllib` library to create the file
|
|
52
|
+
as we will ensure interoperability between the DSP-API requirements and your input.
|
|
53
|
+
- If you want to validate and upload your XML file take a look [here](./data-file/data-file-commands.md).
|
|
54
|
+
Please note, that only DaSCH employees are permitted to upload data on a production server.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml
|
|
2
|
+
|
|
3
|
+
[project]
|
|
4
|
+
name = "dsp-tools"
|
|
5
|
+
version = "18.1.0.post5"
|
|
6
|
+
description = "DSP-TOOLS is a Python package with a command line interface that helps you interact with a DaSCH service platform (DSP) server."
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "DaSCH - Swiss National Data and Service Center for the Humanities", email = "info@dasch.swiss" },
|
|
9
|
+
]
|
|
10
|
+
readme = "docs/index.md"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Programming Language :: Python :: 3.12",
|
|
13
|
+
"Programming Language :: Python :: 3.13",
|
|
14
|
+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
]
|
|
17
|
+
requires-python = ">=3.12"
|
|
18
|
+
dependencies = [
|
|
19
|
+
"argparse",
|
|
20
|
+
"dotenv",
|
|
21
|
+
"jinja2",
|
|
22
|
+
"jsonpath-ng",
|
|
23
|
+
"jsonschema",
|
|
24
|
+
"loguru",
|
|
25
|
+
"lxml",
|
|
26
|
+
"networkx",
|
|
27
|
+
"openpyxl",
|
|
28
|
+
"packaging",
|
|
29
|
+
"pandas[excel]",
|
|
30
|
+
# pandas: "excel" is an extra that contains xlrd that is necessary for reading old .xls Excel files
|
|
31
|
+
"polars",
|
|
32
|
+
"pyld",
|
|
33
|
+
"pyyaml",
|
|
34
|
+
"rdflib",
|
|
35
|
+
"regex",
|
|
36
|
+
"requests",
|
|
37
|
+
"rustworkx",
|
|
38
|
+
"tqdm",
|
|
39
|
+
"typing-extensions",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://www.dasch.swiss/"
|
|
45
|
+
Documentation = "https://docs.dasch.swiss/latest/DSP-TOOLS/"
|
|
46
|
+
Repository = "https://github.com/dasch-swiss/dsp-tools.git"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
dsp-tools = "dsp_tools.cli.entry_point:main" # definition of the CLI entry point
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
[build-system]
|
|
54
|
+
# Tells “frontend” build tools (like pip, build, or uv) what “backend” build tool to use.
|
|
55
|
+
requires = ["uv_build>=0.8.13"]
|
|
56
|
+
build-backend = "uv_build"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
[dependency-groups]
|
|
60
|
+
dev = [
|
|
61
|
+
"darglint",
|
|
62
|
+
"docker",
|
|
63
|
+
"mkdocs-include-markdown-plugin",
|
|
64
|
+
"mkdocs-material",
|
|
65
|
+
"mkdocs",
|
|
66
|
+
"mkdocstrings[python]",
|
|
67
|
+
"mypy",
|
|
68
|
+
"pandas-stubs",
|
|
69
|
+
"pre-commit",
|
|
70
|
+
"pytest-cov",
|
|
71
|
+
"pytest-unordered",
|
|
72
|
+
"pytest-xdist",
|
|
73
|
+
"pytest",
|
|
74
|
+
"requests-mock",
|
|
75
|
+
"ruff",
|
|
76
|
+
"testcontainers",
|
|
77
|
+
"tomlkit",
|
|
78
|
+
"types-docker",
|
|
79
|
+
"types-jsonschema",
|
|
80
|
+
"types-lxml",
|
|
81
|
+
"types-networkx",
|
|
82
|
+
"types-openpyxl",
|
|
83
|
+
"types-pyyaml",
|
|
84
|
+
"types-regex",
|
|
85
|
+
"types-requests",
|
|
86
|
+
"types-tqdm",
|
|
87
|
+
"viztracer",
|
|
88
|
+
"vulture",
|
|
89
|
+
"yamllint",
|
|
90
|
+
"pytest-order",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
[tool.pytest.ini_options]
|
|
95
|
+
addopts = ["--import-mode=importlib"]
|
|
96
|
+
# see https://docs.pytest.org/en/latest/explanation/goodpractices.html#tests-outside-application-code
|
|
97
|
+
pythonpath = [".", "src", "test"]
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
[tool.mypy]
|
|
101
|
+
show_column_numbers = true
|
|
102
|
+
strict = true
|
|
103
|
+
enable_error_code = ["possibly-undefined"]
|
|
104
|
+
exclude = [
|
|
105
|
+
"src/dsp_tools/legacy_models/datetimestamp.py",
|
|
106
|
+
"src/dsp_tools/legacy_models/langstring.py",
|
|
107
|
+
"src/dsp_tools/legacy_models/projectContext.py",
|
|
108
|
+
"src/dsp_tools/commands/project/legacy_models/context.py",
|
|
109
|
+
"src/dsp_tools/commands/project/legacy_models/group.py",
|
|
110
|
+
"src/dsp_tools/commands/project/legacy_models/helpers.py",
|
|
111
|
+
"src/dsp_tools/commands/project/legacy_models/listnode.py",
|
|
112
|
+
"src/dsp_tools/commands/project/legacy_models/ontology.py",
|
|
113
|
+
"src/dsp_tools/commands/project/legacy_models/project.py",
|
|
114
|
+
"src/dsp_tools/commands/project/legacy_models/propertyclass.py",
|
|
115
|
+
"src/dsp_tools/commands/project/legacy_models/resourceclass.py",
|
|
116
|
+
"src/dsp_tools/commands/project/legacy_models/user.py",
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
[[tool.mypy.overrides]]
|
|
121
|
+
# For these packages, no type stubs are available yet:
|
|
122
|
+
module = ["jsonpath_ng.*", "viztracer.*", "pyld.*", "testcontainers.*"]
|
|
123
|
+
ignore_missing_imports = true
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
[tool.ruff]
|
|
127
|
+
line-length = 120
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
[tool.ruff.lint]
|
|
131
|
+
select = [
|
|
132
|
+
"RUF", # ruff-specific rules
|
|
133
|
+
"PL", # pylint
|
|
134
|
+
"I", # isort
|
|
135
|
+
"E", # pycodestyle errors
|
|
136
|
+
"F", # pyflakes
|
|
137
|
+
"A", # flake8-builtins
|
|
138
|
+
"BLE", # flake8-blind-except
|
|
139
|
+
"ARG", # flake8-unused-arguments
|
|
140
|
+
"S", # flake8-bandit plugin which checks for security issues
|
|
141
|
+
"YTT", # flake8-2020 plugin, which checks for misuse of `sys.version` or `sys.version_info`
|
|
142
|
+
"ASYNC", # flake8-async plugin, which checks for bad async / asyncio practices
|
|
143
|
+
"ISC", # flake8-implicit-str-concat plugin, which checks for problematic string concatenation
|
|
144
|
+
"INP", # flake8-no-pep420 plugin, which checks for missing __init__.py files
|
|
145
|
+
"PIE", # flake8-pie plugin, which does miscellaneous checks
|
|
146
|
+
"PT", # flake8-pytest-style plugin
|
|
147
|
+
"TID", # flake8-tidy-imports plugin
|
|
148
|
+
"ICN", # flake8-import-conventions plugin, which checks for import conventions
|
|
149
|
+
"PGH", # pygrep-hooks: A collection of fast, cheap, regex based pre-commit hooks
|
|
150
|
+
"UP", # pyupgrade
|
|
151
|
+
"D101", # pydocstyle: undocumented-public-class
|
|
152
|
+
"D102", # pydocstyle: undocumented-public-method
|
|
153
|
+
"D103", # pydocstyle: undocumented-public-function
|
|
154
|
+
"D417", # pydocstyle: undocumented-param
|
|
155
|
+
"B023", # flake8-bugbear: function-uses-loop-variable
|
|
156
|
+
"FIX", # flake8-fixme: checks for FIXME, TODO, XXX, etc.
|
|
157
|
+
]
|
|
158
|
+
ignore = [
|
|
159
|
+
"ISC001", # flake8-implicit-str-concat: single-line-implicit-string-concatenation # incompatible with the formatter
|
|
160
|
+
"S105", # flake8-bandit: hardcoded password
|
|
161
|
+
"S106", # flake8-bandit: hardcoded password
|
|
162
|
+
"S603", # flake8-bandit: subprocess-without-shell-equals-true
|
|
163
|
+
"UP007", # forbid use of typing.Union and typing.Optional
|
|
164
|
+
"UP015", # Unnecessary mode="r" argument in open()
|
|
165
|
+
"UP045", # Forced use of "|" instead of typing.Optional and typing.Union
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
[tool.ruff.lint.per-file-ignores]
|
|
170
|
+
"__init__.py" = [
|
|
171
|
+
"F401", # unused-import
|
|
172
|
+
"F403", # undefined-local-with-import-star
|
|
173
|
+
"PLC0414", # useless-import-alias
|
|
174
|
+
]
|
|
175
|
+
"testdata/**" = [
|
|
176
|
+
"INP001", # implicit-namespace-package # there are some python files, but no __init__.py
|
|
177
|
+
]
|
|
178
|
+
"test/*" = [
|
|
179
|
+
"D103", # pydocstyle: undocumented-public-function
|
|
180
|
+
"D102", # pydocstyle: undocumented-public-method
|
|
181
|
+
"D101", # pydocstyle: undocumented-public-class
|
|
182
|
+
"S101", # flake8-bandit: use of assert
|
|
183
|
+
]
|
|
184
|
+
"!src/dsp_tools/xmllib/**.py" = ["D103"] # Ignore everywhere except for the `src/dsp_tools/xmllib/` directory.
|
|
185
|
+
"src/dsp_tools/legacy_models/**" = [
|
|
186
|
+
"PLW"
|
|
187
|
+
]
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
[tool.ruff.lint.pydocstyle]
|
|
191
|
+
convention = "google"
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
[tool.ruff.lint.isort]
|
|
195
|
+
force-single-line = true
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
[tool.vulture]
|
|
199
|
+
paths = ["src/dsp_tools", ".vulture_whitelist.py"]
|
|
200
|
+
exclude = [
|
|
201
|
+
"src/dsp_tools/xmllib/",
|
|
202
|
+
"src/dsp_tools/error/xmllib_warnings.py",
|
|
203
|
+
"src/dsp_tools/error/xmllib_warnings_util.py",
|
|
204
|
+
"src/dsp_tools/commands/excel2xml/",
|
|
205
|
+
"test/",
|
|
206
|
+
]
|
|
207
|
+
sort_by_size = true # sort unused classes and functions by size
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from dataclasses import field
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class ServerCredentials:
|
|
11
|
+
"""Contains credentials to connect to a server."""
|
|
12
|
+
|
|
13
|
+
user: str
|
|
14
|
+
password: str
|
|
15
|
+
server: str
|
|
16
|
+
dsp_ingest_url: str = "http://0.0.0.0:3340"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass(frozen=True)
|
|
20
|
+
class ValidateDataConfig:
|
|
21
|
+
"""Contains the configuration for validate data."""
|
|
22
|
+
|
|
23
|
+
xml_file: Path
|
|
24
|
+
save_graph_dir: Path | None
|
|
25
|
+
severity: ValidationSeverity
|
|
26
|
+
ignore_duplicate_files_warning: bool
|
|
27
|
+
is_on_prod_server: bool
|
|
28
|
+
skip_ontology_validation: bool
|
|
29
|
+
do_not_request_resource_metadata_from_db: bool
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ValidationSeverity(Enum):
|
|
33
|
+
ERROR = 3
|
|
34
|
+
WARNING = 2
|
|
35
|
+
INFO = 1
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclass
|
|
39
|
+
class PathDependencies:
|
|
40
|
+
required_files: list[Path] = field(default_factory=list)
|
|
41
|
+
required_directories: list[Path] = field(default_factory=list)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass
|
|
45
|
+
class NetworkRequirements:
|
|
46
|
+
api_url: str
|
|
47
|
+
always_requires_docker: bool = False
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from loguru import logger
|
|
4
|
+
|
|
5
|
+
from dsp_tools.cli.call_action_files_only import call_excel2json
|
|
6
|
+
from dsp_tools.cli.call_action_files_only import call_excel2lists
|
|
7
|
+
from dsp_tools.cli.call_action_files_only import call_excel2properties
|
|
8
|
+
from dsp_tools.cli.call_action_files_only import call_excel2resources
|
|
9
|
+
from dsp_tools.cli.call_action_files_only import call_id2iri
|
|
10
|
+
from dsp_tools.cli.call_action_files_only import call_old_excel2json
|
|
11
|
+
from dsp_tools.cli.call_action_files_only import call_old_excel2lists
|
|
12
|
+
from dsp_tools.cli.call_action_with_network import call_create
|
|
13
|
+
from dsp_tools.cli.call_action_with_network import call_get
|
|
14
|
+
from dsp_tools.cli.call_action_with_network import call_ingest_files
|
|
15
|
+
from dsp_tools.cli.call_action_with_network import call_ingest_xmlupload
|
|
16
|
+
from dsp_tools.cli.call_action_with_network import call_resume_xmlupload
|
|
17
|
+
from dsp_tools.cli.call_action_with_network import call_start_stack
|
|
18
|
+
from dsp_tools.cli.call_action_with_network import call_stop_stack
|
|
19
|
+
from dsp_tools.cli.call_action_with_network import call_upload_files
|
|
20
|
+
from dsp_tools.cli.call_action_with_network import call_validate_data
|
|
21
|
+
from dsp_tools.cli.call_action_with_network import call_xmlupload
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def call_requested_action(args: argparse.Namespace) -> bool: # noqa: PLR0912 (too many branches)
|
|
25
|
+
"""
|
|
26
|
+
Call the appropriate function of DSP-TOOLS.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
args: parsed CLI arguments
|
|
30
|
+
|
|
31
|
+
Raises:
|
|
32
|
+
BaseError: from the called function
|
|
33
|
+
InputError: from the called function
|
|
34
|
+
DockerNotReachableError: from the called function
|
|
35
|
+
LocalDspApiNotReachableError: from the called function
|
|
36
|
+
unexpected errors from the called methods and underlying libraries
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
success status
|
|
40
|
+
"""
|
|
41
|
+
match args.action:
|
|
42
|
+
# commands with Docker / API interactions
|
|
43
|
+
case "start-stack":
|
|
44
|
+
result = call_start_stack(args)
|
|
45
|
+
case "stop-stack":
|
|
46
|
+
result = call_stop_stack()
|
|
47
|
+
case "create":
|
|
48
|
+
result = call_create(args)
|
|
49
|
+
case "get":
|
|
50
|
+
result = call_get(args)
|
|
51
|
+
case "validate-data":
|
|
52
|
+
result = call_validate_data(args)
|
|
53
|
+
case "xmlupload":
|
|
54
|
+
result = call_xmlupload(args)
|
|
55
|
+
case "resume-xmlupload":
|
|
56
|
+
result = call_resume_xmlupload(args)
|
|
57
|
+
case "upload-files":
|
|
58
|
+
result = call_upload_files(args)
|
|
59
|
+
case "ingest-files":
|
|
60
|
+
result = call_ingest_files(args)
|
|
61
|
+
case "ingest-xmlupload":
|
|
62
|
+
result = call_ingest_xmlupload(args)
|
|
63
|
+
# commands that do not require docker
|
|
64
|
+
case "excel2json":
|
|
65
|
+
result = call_excel2json(args)
|
|
66
|
+
case "old-excel2json":
|
|
67
|
+
result = call_old_excel2json(args)
|
|
68
|
+
case "excel2lists":
|
|
69
|
+
result = call_excel2lists(args)
|
|
70
|
+
case "old-excel2lists":
|
|
71
|
+
result = call_old_excel2lists(args)
|
|
72
|
+
case "excel2resources":
|
|
73
|
+
result = call_excel2resources(args)
|
|
74
|
+
case "excel2properties":
|
|
75
|
+
result = call_excel2properties(args)
|
|
76
|
+
case "id2iri":
|
|
77
|
+
result = call_id2iri(args)
|
|
78
|
+
case _:
|
|
79
|
+
print(f"ERROR: Unknown action '{args.action}'")
|
|
80
|
+
logger.error(f"Unknown action '{args.action}'")
|
|
81
|
+
result = False
|
|
82
|
+
return result
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from dsp_tools.cli.args import PathDependencies
|
|
5
|
+
from dsp_tools.cli.utils import check_path_dependencies
|
|
6
|
+
from dsp_tools.commands.excel2json.lists.make_lists import excel2lists
|
|
7
|
+
from dsp_tools.commands.excel2json.old_lists import old_excel2lists
|
|
8
|
+
from dsp_tools.commands.excel2json.project import excel2json
|
|
9
|
+
from dsp_tools.commands.excel2json.project import old_excel2json
|
|
10
|
+
from dsp_tools.commands.excel2json.properties import excel2properties
|
|
11
|
+
from dsp_tools.commands.excel2json.resources import excel2resources
|
|
12
|
+
from dsp_tools.commands.id2iri import id2iri
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def call_id2iri(args: argparse.Namespace) -> bool:
|
|
16
|
+
check_path_dependencies(PathDependencies([Path(args.xmlfile), Path(args.mapping)]))
|
|
17
|
+
return id2iri(
|
|
18
|
+
xml_file=args.xmlfile,
|
|
19
|
+
json_file=args.mapping,
|
|
20
|
+
remove_resource_if_id_in_mapping=args.remove_resources,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def call_excel2properties(args: argparse.Namespace) -> bool:
|
|
25
|
+
check_path_dependencies(PathDependencies([Path(args.excelfile)]))
|
|
26
|
+
_, _, success = excel2properties(
|
|
27
|
+
excelfile=args.excelfile,
|
|
28
|
+
path_to_output_file=args.properties_section,
|
|
29
|
+
)
|
|
30
|
+
return success
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def call_excel2resources(args: argparse.Namespace) -> bool:
|
|
34
|
+
check_path_dependencies(PathDependencies([Path(args.excelfile)]))
|
|
35
|
+
_, _, success = excel2resources(
|
|
36
|
+
excelfile=args.excelfile,
|
|
37
|
+
path_to_output_file=args.resources_section,
|
|
38
|
+
)
|
|
39
|
+
return success
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def call_old_excel2lists(args: argparse.Namespace) -> bool:
|
|
43
|
+
check_path_dependencies(PathDependencies(required_directories=[Path(args.excelfolder)]))
|
|
44
|
+
_, success = old_excel2lists(
|
|
45
|
+
excelfolder=args.excelfolder,
|
|
46
|
+
path_to_output_file=args.lists_section,
|
|
47
|
+
verbose=args.verbose,
|
|
48
|
+
)
|
|
49
|
+
return success
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def call_excel2lists(args: argparse.Namespace) -> bool:
|
|
53
|
+
check_path_dependencies(PathDependencies(required_directories=[Path(args.excelfolder)]))
|
|
54
|
+
_, success = excel2lists(
|
|
55
|
+
excelfolder=args.excelfolder,
|
|
56
|
+
path_to_output_file=args.lists_section,
|
|
57
|
+
)
|
|
58
|
+
return success
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def call_excel2json(args: argparse.Namespace) -> bool:
|
|
62
|
+
check_path_dependencies(PathDependencies(required_directories=[Path(args.excelfolder)]))
|
|
63
|
+
return excel2json(
|
|
64
|
+
data_model_files=args.excelfolder,
|
|
65
|
+
path_to_output_file=args.project_definition,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def call_old_excel2json(args: argparse.Namespace) -> bool:
|
|
70
|
+
check_path_dependencies(PathDependencies(required_directories=[Path(args.excelfolder)]))
|
|
71
|
+
return old_excel2json(
|
|
72
|
+
data_model_files=args.excelfolder,
|
|
73
|
+
path_to_output_file=args.project_definition,
|
|
74
|
+
)
|