destiny_sdk 0.7.2__tar.gz → 0.7.3__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.
Files changed (38) hide show
  1. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/PKG-INFO +1 -1
  2. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/pyproject.toml +1 -1
  3. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/enhancements.py +38 -0
  4. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_data/destiny_references.jsonl +9 -9
  5. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_enhancements.py +1 -0
  6. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_references.py +1 -0
  7. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/.gitignore +0 -0
  8. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/LICENSE +0 -0
  9. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/README.md +0 -0
  10. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/__init__.py +0 -0
  11. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/auth.py +0 -0
  12. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/client.py +0 -0
  13. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/core.py +0 -0
  14. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/identifiers.py +0 -0
  15. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/imports.py +0 -0
  16. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/labs/__init__.py +0 -0
  17. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/labs/references.py +0 -0
  18. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/parsers/__init__.py +0 -0
  19. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/parsers/eppi_parser.py +0 -0
  20. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/parsers/exceptions.py +0 -0
  21. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/py.typed +0 -0
  22. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/references.py +0 -0
  23. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/robots.py +0 -0
  24. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/search.py +0 -0
  25. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/src/destiny_sdk/visibility.py +0 -0
  26. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/__init__.py +0 -0
  27. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/conftest.py +0 -0
  28. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/labs/test_references.py +0 -0
  29. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/parsers/test_eppi_parser.py +0 -0
  30. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_auth.py +0 -0
  31. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_client.py +0 -0
  32. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_data/eppi_import.jsonl +0 -0
  33. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_data/eppi_import_with_annotations.jsonl +0 -0
  34. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_data/eppi_import_with_raw.jsonl +0 -0
  35. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_data/eppi_report.json +0 -0
  36. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_identifiers.py +0 -0
  37. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/tests/unit/test_robots.py +0 -0
  38. {destiny_sdk-0.7.2 → destiny_sdk-0.7.3}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: destiny_sdk
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: A software development kit (sdk) to support interaction with the DESTINY repository
5
5
  Author-email: Adam Hamilton <adam@futureevidence.org>, Andrew Harvey <andrew@futureevidence.org>, Daniel Breves <daniel@futureevidence.org>, Jack Walmisley <jack@futureevidence.org>, Tim Repke <tim.repke@pik-potsdam.de>
6
6
  License-Expression: Apache-2.0
@@ -35,7 +35,7 @@ license = "Apache-2.0"
35
35
  name = "destiny_sdk"
36
36
  readme = "README.md"
37
37
  requires-python = "~=3.12"
38
- version = "0.7.2"
38
+ version = "0.7.3"
39
39
 
40
40
  [project.optional-dependencies]
41
41
  labs = []
@@ -1,6 +1,7 @@
1
1
  """Enhancement classes for the Destiny Repository."""
2
2
 
3
3
  import datetime
4
+ import json
4
5
  from enum import StrEnum, auto
5
6
  from typing import Annotated, Any, Literal, Self
6
7
 
@@ -87,6 +88,10 @@ other works have cited this work
87
88
  created_date: datetime.date | None = Field(
88
89
  default=None, description="The ISO8601 date this metadata record was created"
89
90
  )
91
+ updated_date: datetime.date | None = Field(
92
+ default=None,
93
+ description="The ISO8601 date of the last OpenAlex update to this metadata",
94
+ )
90
95
  publication_date: datetime.date | None = Field(
91
96
  default=None, description="The date which the version of record was published."
92
97
  )
@@ -100,6 +105,20 @@ other works have cited this work
100
105
  )
101
106
  title: str | None = Field(default=None, description="The title of the reference.")
102
107
 
108
+ @property
109
+ def fingerprint(self) -> str:
110
+ """
111
+ The fingerprint of this bibliographic metadata enhancement.
112
+
113
+ Excludes updated_at from the fingerprint calculation, meaning
114
+ that two raw enhancements with identical data but different export dates
115
+ will be considered the same.
116
+ """
117
+ return json.dumps(
118
+ self.model_dump(mode="json", exclude={"updated_date"}, exclude_none=True),
119
+ sort_keys=True,
120
+ )
121
+
103
122
 
104
123
  class AbstractProcessType(StrEnum):
105
124
  """The process used to acquire the abstract."""
@@ -332,6 +351,25 @@ class RawEnhancement(BaseModel):
332
351
  raise ValueError(msg)
333
352
  return self
334
353
 
354
+ @property
355
+ def fingerprint(self) -> str:
356
+ """
357
+ The unique fingerprint of this raw enhancement.
358
+
359
+ Excludes the source_export_date from the fingerprint calculation, meaning
360
+ that two raw enhancements with identical data but different export dates
361
+ will be considered the same.
362
+
363
+ Unstructured data in `data` and `metadata` is included in the fingerprint,
364
+ sorted by key.
365
+ """
366
+ return json.dumps(
367
+ self.model_dump(
368
+ mode="json", exclude={"source_export_date"}, exclude_none=True
369
+ ),
370
+ sort_keys=True,
371
+ )
372
+
335
373
 
336
374
  #: Union type for all enhancement content types.
337
375
  EnhancementContent = Annotated[