Data Models API
Data models represent GDELT records and results.
Event Models
Event
Bases: BaseModel
GDELT Event record.
Represents a single event in the GDELT Events database. Events capture who did what to whom, when, where, and how it was reported.
Source code in src/py_gdelt/models/events.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | |
is_conflict
property
Check if event is conflict (quad_class 3 or 4).
Returns:
| Type | Description |
|---|---|
bool
|
True if event is material conflict (3) or verbal conflict (4). |
is_cooperation
property
Check if event is cooperation (quad_class 1 or 2).
Returns:
| Type | Description |
|---|---|
bool
|
True if event is verbal cooperation (1) or material cooperation (2). |
from_raw(raw)
classmethod
Convert internal _RawEvent to public Event model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawEvent
|
Internal _RawEvent dataclass from TAB-delimited parsing. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Event |
Event
|
Public Event model with proper type conversion. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields are missing or invalid. |
Source code in src/py_gdelt/models/events.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
Mention
Bases: BaseModel
Mention of a GDELT event in a source.
Represents a single mention of an event in a news article. Each event can have many mentions across different sources and times.
Source code in src/py_gdelt/models/events.py
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | |
from_raw(raw)
classmethod
Convert internal _RawMention to public Mention model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawMention
|
Internal _RawMention dataclass from TAB-delimited parsing. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Mention |
Mention
|
Public Mention model with proper type conversion. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields are missing or invalid. |
Source code in src/py_gdelt/models/events.py
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | |
Actor
Bases: BaseModel
Actor in a GDELT event.
Represents an entity (person, organization, country, etc.) participating in an event. Uses CAMEO actor codes for classification.
Source code in src/py_gdelt/models/events.py
is_state_actor
property
Check if actor is a state/government actor.
Returns:
| Type | Description |
|---|---|
bool
|
True if actor has a country code but no known group code, |
bool
|
indicating a state-level actor. |
Article Models
Article
Bases: BaseModel
Article from GDELT DOC API.
Represents a news article monitored by GDELT.
Source code in src/py_gdelt/models/articles.py
seen_datetime
property
Parse seendate to datetime.
Returns:
| Type | Description |
|---|---|
datetime | None
|
datetime object or None if parsing fails |
is_english
property
Check if article is in English.
Timeline
Bases: BaseModel
Timeline data from GDELT DOC API.
Contains time series data for article volume.
Source code in src/py_gdelt/models/articles.py
points
property
Alias for timeline for cleaner access.
dates
property
Get list of dates.
values
property
Get list of values.
parse_timeline(v)
classmethod
Parse timeline from various formats.
Handles both flat format and nested series format from timelinevol API: - Flat: [{"date": "...", "value": ...}, ...] - Nested: [{"series": "...", "data": [{"date": "...", "value": ...}]}]
Source code in src/py_gdelt/models/articles.py
to_dict()
to_series()
Convert to date:value mapping.
Useful for quick lookups and plotting.
TimelinePoint
Bases: BaseModel
Single data point in a timeline.
Source code in src/py_gdelt/models/articles.py
parsed_date
property
Parse date string to datetime.
GKG Models
GKGRecord
Bases: BaseModel
GDELT Global Knowledge Graph record.
Represents enriched content analysis of a news article or document, including extracted themes, entities, locations, tone, and other metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
record_id |
str
|
Unique identifier in format "YYYYMMDDHHMMSS-seq" or with "-T" suffix for translated |
date |
datetime
|
Publication date/time |
source_url |
str
|
URL of the source document |
source_name |
str
|
Common name of the source |
source_collection |
int
|
Source collection identifier (1=WEB, 2=Citation, etc.) |
themes |
list[EntityMention]
|
Extracted themes/topics |
persons |
list[EntityMention]
|
Extracted person names |
organizations |
list[EntityMention]
|
Extracted organization names |
locations |
list[Location]
|
Extracted geographic locations |
tone |
ToneScores | None
|
Document tone analysis scores |
gcam |
dict[str, float]
|
GCAM emotional dimension scores as dict |
quotations |
list[Quotation]
|
Extracted quotations (v2.1+ only) |
amounts |
list[Amount]
|
Extracted numerical amounts (v2.1+ only) |
sharing_image |
str | None
|
Primary sharing image URL if any |
all_names |
list[str]
|
All extracted names as flat list |
version |
int
|
GDELT version (1 or 2) |
is_translated |
bool
|
Whether this is a translated document |
original_record_id |
str | None
|
Original record ID if translated |
translation_info |
str | None
|
Translation metadata string |
Source code in src/py_gdelt/models/gkg.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
primary_theme
property
Get the first/primary theme if any.
Returns:
| Type | Description |
|---|---|
str | None
|
The name of the first theme, or None if no themes exist |
has_quotations
property
Check if record has extracted quotations.
Returns:
| Type | Description |
|---|---|
bool
|
True if one or more quotations were extracted |
from_raw(raw)
classmethod
Convert internal _RawGKG to public GKGRecord model.
This method handles parsing the complex delimited fields from GKG v2.1 format: - Themes: semicolon-delimited "theme,offset" pairs - GCAM: semicolon-delimited "key:value" pairs - Quotations: pipe-delimited records with format "offset#length#verb#quote" - Amounts: semicolon-delimited "amount,object,offset" triples - Locations: semicolon-delimited with multiple sub-fields - Tone: comma-separated values
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawGKG
|
Internal _RawGKG dataclass from TSV parsing |
required |
Returns:
| Type | Description |
|---|---|
GKGRecord
|
Validated GKGRecord with all fields parsed and typed |
Source code in src/py_gdelt/models/gkg.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
Quotation
Amount
TVGKGRecord
Bases: BaseModel
TV-GKG record with timecode mapping support.
Uses composition instead of inheritance from GKGRecord. Reuses GKG parsing logic but creates independent model.
Note
The following GKG fields are always empty in TV-GKG: - sharing_image, related_images, social_image_embeds, social_video_embeds - quotations, all_names, dates, amounts, translation_info
Special field
- timecode_mappings: Parsed from CHARTIMECODEOFFSETTOC in extras
Attributes:
| Name | Type | Description |
|---|---|---|
gkg_record_id |
str
|
Unique record identifier. |
date |
datetime
|
Timestamp of the analysis. |
source_identifier |
str
|
Source collection identifier. |
document_identifier |
str
|
URL or identifier of the source document. |
themes |
list[str]
|
List of detected themes. |
locations |
list[str]
|
List of detected locations. |
persons |
list[str]
|
List of detected persons. |
organizations |
list[str]
|
List of detected organizations. |
tone |
float | None
|
Average tone score. |
extras |
str
|
Raw extras field content. |
timecode_mappings |
list[TimecodeMapping]
|
Parsed character offset to timecode mappings. |
Source code in src/py_gdelt/models/gkg.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | |
from_raw(raw)
classmethod
Convert raw GKG to TV-GKG with timecode extraction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawGKG
|
Internal raw GKG representation. |
required |
Returns:
| Type | Description |
|---|---|
TVGKGRecord
|
Validated TVGKGRecord instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If date parsing fails. |
Source code in src/py_gdelt/models/gkg.py
TimecodeMapping
Bases: NamedTuple
Character offset to video timecode mapping (lightweight).
Used in TV-GKG to map text positions to video timestamps.
Attributes:
| Name | Type | Description |
|---|---|---|
char_offset |
int
|
Character offset in the transcript. |
timecode |
str
|
Video timecode (e.g., "00:01:23"). |
Source code in src/py_gdelt/models/gkg.py
NGrams Models
NGramRecord
Bases: BaseModel
GDELT NGram 3.0 record.
Represents an n-gram (word or phrase) occurrence in web content, including context and source information.
Source code in src/py_gdelt/models/ngrams.py
context
property
Get full context (pre + ngram + post).
Returns:
| Type | Description |
|---|---|
str
|
Full context string with ngram surrounded by pre and post context |
is_early_in_article
property
Check if ngram appears in first 30% of article.
Returns:
| Type | Description |
|---|---|
bool
|
True if position <= 20 (first 30% of article) |
is_late_in_article
property
Check if ngram appears in last 30% of article.
Returns:
| Type | Description |
|---|---|
bool
|
True if position >= 70 (last 30% of article) |
from_raw(raw)
classmethod
Convert internal _RawNGram to public NGramRecord model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawNGram
|
Internal raw ngram representation with string fields |
required |
Returns:
| Type | Description |
|---|---|
NGramRecord
|
Validated NGramRecord instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
If date parsing or type conversion fails |
Source code in src/py_gdelt/models/ngrams.py
BroadcastNGramRecord
Bases: BaseModel
Broadcast NGram frequency record (TV or Radio).
Unified model for both TV and Radio NGrams since schemas are compatible. TV NGrams: 5 columns (DATE, STATION, HOUR, WORD, COUNT) Radio NGrams: 6 columns (DATE, STATION, HOUR, NGRAM, COUNT, SHOW)
Attributes:
| Name | Type | Description |
|---|---|---|
date |
date
|
Date of the broadcast. |
station |
str
|
Station identifier (e.g., CNN, KQED). |
hour |
int
|
Hour of broadcast (0-23). |
ngram |
str
|
Word or phrase. |
count |
int
|
Frequency count. |
show |
str | None
|
Show name (Radio only, None for TV). |
source |
BroadcastSource
|
Indicates origin (tv or radio). |
Source code in src/py_gdelt/models/ngrams.py
from_raw(raw, source)
classmethod
Convert internal _RawBroadcastNGram to public model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawBroadcastNGram
|
Internal raw broadcast ngram representation. |
required |
source
|
BroadcastSource
|
Source type (TV or Radio). |
required |
Returns:
| Type | Description |
|---|---|
BroadcastNGramRecord
|
Validated BroadcastNGramRecord instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If date parsing or type conversion fails. |
Source code in src/py_gdelt/models/ngrams.py
BroadcastSource
TVNGramRecord = BroadcastNGramRecord
module-attribute
RadioNGramRecord = BroadcastNGramRecord
module-attribute
VGKG Models
VGKGRecord
Bases: BaseModel
Visual GKG record with Cloud Vision annotations.
Nested structures (labels, faces, etc.) use TypedDict for performance. See tests/benchmarks/test_bench_vgkg_parsing.py for rationale.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Timestamp of the analysis. |
document_identifier |
str
|
Source article URL. |
image_url |
str
|
URL of the analyzed image. |
labels |
list[VisionLabelDict]
|
List of detected labels with confidence scores. |
logos |
list[VisionLabelDict]
|
List of detected logos. |
web_entities |
list[VisionLabelDict]
|
List of web entities matched to the image. |
safe_search |
SafeSearchDict | None
|
SafeSearch annotation scores. |
faces |
list[FaceAnnotationDict]
|
List of detected faces with pose information. |
ocr_text |
str
|
Text extracted via OCR. |
landmark_annotations |
list[VisionLabelDict]
|
List of detected landmarks. |
domain |
str
|
Domain of the source article. |
raw_json |
str
|
Full Cloud Vision API JSON response. |
Source code in src/py_gdelt/models/vgkg.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
from_raw(raw)
classmethod
Convert internal _RawVGKG to validated VGKGRecord model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawVGKG
|
Internal raw VGKG representation with string fields. |
required |
Returns:
| Type | Description |
|---|---|
VGKGRecord
|
Validated VGKGRecord instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If date parsing or type conversion fails. |
Source code in src/py_gdelt/models/vgkg.py
VisionLabelDict
Bases: TypedDict
Google Cloud Vision label annotation (lightweight).
Used for labels, logos, web_entities, and landmark_annotations fields. TypedDict avoids Pydantic validation overhead for nested structures.
Source code in src/py_gdelt/models/vgkg.py
SafeSearchDict
Bases: TypedDict
SafeSearch detection results.
Values are integers from Cloud Vision API: - UNKNOWN = -1 - VERY_UNLIKELY = 0 - UNLIKELY = 1 - POSSIBLE = 2 - LIKELY = 3 - VERY_LIKELY = 4
Source code in src/py_gdelt/models/vgkg.py
FaceAnnotationDict
Bases: TypedDict
Detected face with pose angles.
Contains pose information (roll/pan/tilt angles), NOT emotion scores. Angles are in degrees relative to the camera.
Source code in src/py_gdelt/models/vgkg.py
Graph Models
Entity
Bases: SchemaEvolutionMixin, BaseModel
Entity extracted from GEG (Global Entity Graph).
Represents a named entity with metadata and knowledge graph links.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Entity name |
entity_type |
str
|
Entity type |
salience |
float | None
|
Salience score |
wikipedia_url |
str | None
|
Wikipedia URL if available |
knowledge_graph_mid |
str | None
|
Google Knowledge Graph MID if available |
Source code in src/py_gdelt/models/graphs.py
GALRecord
Bases: SchemaEvolutionMixin, BaseModel
Article List record.
Represents a news article with basic metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Publication date/time |
url |
str
|
Article URL |
title |
str | None
|
Article title if available |
image |
str | None
|
Primary image URL if available |
description |
str | None
|
Article description if available |
author |
str | None
|
Article author if available |
lang |
str
|
Language code |
Source code in src/py_gdelt/models/graphs.py
GEGRecord
Bases: SchemaEvolutionMixin, BaseModel
Global Entity Graph record.
Represents a document with extracted entities and their metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Publication date/time |
url |
str
|
Source document URL |
lang |
str
|
Language code |
entities |
list[Entity]
|
List of extracted entities |
Source code in src/py_gdelt/models/graphs.py
GEMGRecord
Bases: SchemaEvolutionMixin, BaseModel
Global Embedded Metadata Graph record.
Represents a document with extracted metadata tags and JSON-LD.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Publication date/time |
url |
str
|
Source document URL |
title |
str | None
|
Document title if available |
lang |
str
|
Language code |
metatags |
list[MetaTag]
|
List of extracted metadata tags |
jsonld |
list[str]
|
List of JSON-LD strings |
Source code in src/py_gdelt/models/graphs.py
GFGRecord
Bases: SchemaEvolutionMixin, BaseModel
Global Frontpage Graph record (TSV format).
Represents a hyperlink from a frontpage to another URL.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Publication date/time |
from_frontpage_url |
str
|
Source frontpage URL |
link_url |
str
|
Destination link URL |
link_text |
str
|
Anchor text of the link |
page_position |
int
|
Position of link on page |
lang |
str
|
Language code |
Source code in src/py_gdelt/models/graphs.py
from_raw(raw)
classmethod
Convert internal _RawGFGRecord to public GFGRecord model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
_RawGFGRecord
|
Internal _RawGFGRecord dataclass from TSV parsing. |
required |
Returns:
| Type | Description |
|---|---|
Self
|
Validated GFGRecord with all fields parsed and typed. |
Source code in src/py_gdelt/models/graphs.py
GGGRecord
Bases: SchemaEvolutionMixin, BaseModel
Global Geographic Graph record.
Represents a document with an extracted geographic location.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Publication date/time |
url |
str
|
Source document URL |
location_name |
str
|
Name of the location |
lat |
float
|
Latitude (-90 to 90) |
lon |
float
|
Longitude (-180 to 180) |
context |
str
|
Surrounding text context |
Source code in src/py_gdelt/models/graphs.py
parse_date(v)
classmethod
validate_lat(v)
classmethod
Validate latitude is within valid range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
float
|
Latitude value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Validated latitude. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If latitude is outside -90 to 90 range. |
Source code in src/py_gdelt/models/graphs.py
validate_lon(v)
classmethod
Validate longitude is within valid range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
float
|
Longitude value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Validated longitude. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If longitude is outside -180 to 180 range. |
Source code in src/py_gdelt/models/graphs.py
GQGRecord
Bases: SchemaEvolutionMixin, BaseModel
Global Quotation Graph record.
Represents a document with extracted quotations and their context.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Publication date/time |
url |
str
|
Source document URL |
lang |
str
|
Language code |
quotes |
list[Quote]
|
List of extracted quotations with context |
Source code in src/py_gdelt/models/graphs.py
MetaTag
Bases: SchemaEvolutionMixin, BaseModel
Metadata tag extracted from GEMG (Global Embedded Metadata Graph).
Represents a single metadata tag from HTML meta tags or JSON-LD.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
Tag key/name |
tag_type |
str
|
Tag type |
value |
str
|
Tag value |
Source code in src/py_gdelt/models/graphs.py
Quote
Bases: SchemaEvolutionMixin, BaseModel
Quote extracted from GQG (Global Quotation Graph).
Represents a single quotation with surrounding context.
Attributes:
| Name | Type | Description |
|---|---|---|
pre |
str
|
Text before the quote |
quote |
str
|
The quotation text |
post |
str
|
Text after the quote |
Source code in src/py_gdelt/models/graphs.py
Common Models
Location
Bases: BaseModel
Geographic location from GDELT data.
Source code in src/py_gdelt/models/common.py
has_coordinates
property
Check if location has valid coordinates.
as_tuple()
Return (lat, lon) tuple. Raises ValueError if either is None.
Source code in src/py_gdelt/models/common.py
as_wkt()
Return WKT POINT string for geopandas compatibility.
Returns:
| Type | Description |
|---|---|
str
|
WKT POINT string in format "POINT(lon lat)". |
Raises:
| Type | Description |
|---|---|
ValueError
|
If lat or lon is None. |
Source code in src/py_gdelt/models/common.py
ToneScores
Bases: BaseModel
Tone analysis scores from GDELT.
Source code in src/py_gdelt/models/common.py
EntityMention
Bases: BaseModel
Entity mention from GKG records.
Source code in src/py_gdelt/models/common.py
Result Models
FetchResult
dataclass
Bases: Generic[T]
Result container with partial failure tracking.
Source code in src/py_gdelt/models/common.py
complete
property
True if no requests failed.
partial
property
True if some but not all requests failed.
total_failed
property
Number of failed requests.
__iter__()
FailedRequest
dataclass
Represents a failed request in a partial result.