images: portraits and logos from Wikimedia Commons with author and licence
New adapter wikimedia.images: Wikidata P18 for people without an official photo, P154 logos for parties and organisations matched by Wikidata id, Firmenbuch (P5285) or ZVR number (P6279). Licence data from the Commons file page goes into image_credit (keyed by image URL); official Parliament/EP photos are never replaced. Web: logos on party cards, party, organisation and organisation-list pages, credit lines under portraits and logos, image proxy allows upload.wikimedia.org. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5640ed653b
commit
b761517386
22 files changed
+484
-17
No files matched your search
@@ -121,6 +121,20 @@ class SocialAccount:
|
||||
verified: bool = False # True only for official sources (parliament profile, official website)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Image:
|
||||
"""A portrait (person) or logo (organization) from a freely licensed source, with its attribution. Fills the
|
||||
entity's photo_url / logo_url only if it has no official image."""
|
||||
url: str # the image (thumbnail) shown on the site
|
||||
role: Literal["photo", "logo"]
|
||||
page_url: str | None = None # description page with the full licence information
|
||||
credit: str | None = None
|
||||
license: str | None = None
|
||||
license_url: str | None = None
|
||||
person: PersonRef | None = None
|
||||
org: OrgRef | None = None
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Facets (structured payload of a claim)
|
||||
# --------------------------------------------------------------------------------------------
|
||||
@@ -273,7 +287,8 @@ class ArchiveCopy:
|
||||
archive_url: str
|
||||
|
||||
|
||||
Record = Union[PersonRecord, OrgRecord, SocialAccount, VoteEvent, Event, Claim, Document, PostRemoved, ArchiveCopy]
|
||||
Record = Union[PersonRecord, OrgRecord, SocialAccount, VoteEvent, Event, Claim, Document, PostRemoved, ArchiveCopy,
|
||||
Image]
|
||||
|
||||
|
||||
def to_jsonable(obj: Any) -> Any:
|
||||
|
||||
Reference in new issue
Block a user