gdelt-regkg
Reconstruct GDELT GKG records from prepared article text and supplied metadata. Generate complete 27-column records or analyze individual fields from Python.
Documentation · Installation and setup · Quickstart · GKG field reference
You can use gdelt-regkg to:
- Process your own news datasets into GKG-compatible records.
- Extract individual fields, such as themes, tone, entities or event counts, for analysis.
- Reconstruct gaps in GKG coverage from available article bodies and metadata.
- Analyze multilingual articles.
- Evaluate custom dictionaries and extraction profiles.
- Compare reconstructed fields with archived GKG output using the benchmark tools.
Installation
Requires Python 3.12 or newer. For English record generation:
python -m pip install "gdelt-regkg[ner]"
python -m spacy download en_core_web_sm
gdelt-regkg-cli build all --sources-dir downloads/resources --download-sources --output local-resources
See Installation and setup for optional dependencies, translation and CPU/CUDA setup. External dictionaries and models are prepared locally and retain their own source terms.
Usage
The library supports processing fields either individually:
from gdelt_regkg.fields.counts import analyze_counts
from gdelt_regkg.fields.themes import analyze_themes
from gdelt_regkg.fields.tone import analyze_tone
text = "Flooding killed 12 people."
counts = analyze_counts(text)
print(counts.to_gkg())
print(counts.to_gkg(enhanced=True))
print(analyze_themes(text).to_gkg())
print(analyze_tone(text).to_gkg())
CRISISLEX_T03_DEAD#12#people#0######;KILL#12#people#0######;
CRISISLEX_T03_DEAD#12#people#0#######16;KILL#12#people#0#######16;
CRISISLEX_C06_WATER_SANITATION;NATURAL_DISASTER_FLOODING;CRISISLEX_T03_DEAD;KILL;
-25,0,25,25,25,0,4
or all at once:
from gdelt_regkg import RecordMetadata, Resources, generate_gkg, write_gkg
from gdelt_regkg.fields.ner import SpacyNER
text = "Flooding killed 12 people in London."
metadata = RecordMetadata(
identifier="https://example.org/story",
batch_time="20261001091500",
sequence=1,
sharing_image="",
related_images=[],
social_image_embeds=[],
social_video_embeds=[],
extras={},
)
resources = Resources(
resources_dir="local-resources",
recognizer=SpacyNER.from_model("en_core_web_sm"),
)
record = generate_gkg(text, metadata, resources, strict=True)
with open("articles.gkg.tsv", "w", encoding="utf-8", newline="") as stream:
write_gkg([record], stream)
articles.gkg.tsv contains one complete, headerless GKG row. Run from the directory containing local-resources/ prepared by gdelt-regkg-cli build.
See Quickstart for standalone field extraction and Generate records for metadata, overrides and export behavior.
Documentation
| Topic | Documentation |
|---|---|
| Start here | Home and Quickstart |
| Field formats and limitations | GKG field reference |
| Dictionaries and configuration | Build resources |
| Dictionary presets and custom inventories | Build GCAM resources |
| Geographic reference lookups | Build gazetteers |
| Non-English articles | Translation |
| Command-line tools | CLI and Benchmarking |
| Accuracy and interpretation | Results and Methodology |
| Upgrading | Migration and changelog |
Citation
If you use this package in research, cite the software release on Zenodo. See Citing the software for BibTeX and CITATION.cff for machine-readable metadata. Cite the dictionary resources used in your analysis separately.
For the field-level agreement evaluation, cite Nikita A. Klimin (2026), Agreement Between Reconstructed and Native GDELT GKG Records: A Field-Level Baseline. See Citing the agreement study for BibTeX.
Contributing
See Development setup for local checks and evaluation requirements, and Project structure for the source layout. Contributing covers issue reports, pull requests and external inputs. Follow the code of conduct; report vulnerabilities through the security policy.
Implementation tasks are listed under Future work.
License and disclaimer
This is an independent implementation, unaffiliated with and not endorsed by the GDELT Project. Reconstructed fields are approximate; results depend on article text, translation, models and dictionaries. Validate them for your intended analysis.
The code and original rules use the MIT license and are provided without warranty. External dictionaries, models, article bodies and derived profiles retain their source terms.
Metadata
Release files for gdelt-regkg 2.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gdelt_regkg-2.1.3.tar.gz | 630.8 kB | With provenance | Details for gdelt_regkg-2.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gdelt_regkg-2.1.3-py3-none-any.whl | Python 3 | none | any | Details for gdelt_regkg-2.1.3-py3-none-any.whl |
Total release size: 1.1 MB
Release files / gdelt_regkg-2.1.3.tar.gz
| Download URL | gdelt_regkg-2.1.3.tar.gz |
|---|---|
| Size | 630.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1224a4245d2f49889fb0466feeeb3d7e2c587425c0f377d7ae1a49c53f1977b1
|
|
BLAKE2b-256 checksum How to use checksums |
a48450c3801ce8ad58b18e74538dd7152cf9516f03e2c7eb6291a6b5a13436f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / gdelt_regkg-2.1.3-py3-none-any.whl
| Download URL | gdelt_regkg-2.1.3-py3-none-any.whl |
|---|---|
| Size | 461.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c23d3b89a130a329334396c0100ee89235df98c774363e54d33db004175023b9
|
|
BLAKE2b-256 checksum How to use checksums |
cd16203cc46a5f829dbf100b03bb0a78b4809c1096f7a055cb240dc0ccf0de55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for gdelt-regkg 2.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gdelt_regkg-2.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.