### Install gdeltdoc using pip Source: https://pypi.org/project/gdeltdoc Install the gdeltdoc library using pip. This is the standard method for installing Python packages. ```bash pip install gdeltdoc ``` -------------------------------- ### Install Requirements Source: https://pypi.org/project/gdeltdoc Install all necessary dependencies for the project using pip. ```bash pip install -r requirements.txt ``` -------------------------------- ### Constructing a Filters object Source: https://pypi.org/project/gdeltdoc Example of initializing a Filters object with various parameters to define a search query. This includes date ranges, keywords, domains, countries, themes, and proximity/repetition of words. ```python from gdeltdoc import Filters, near, repeat f = Filters( start_date = "2020-05-01", end_date = "2020-05-02", num_records = 250, keyword = "climate change", domain = ["bbc.co.uk", "nytimes.com"], country = ["UK", "US"], theme = "GENERAL_HEALTH", near = near(10, "airline", "carbon"), repeat = repeat(5, "planet") ) ``` -------------------------------- ### Create Virtual Environment Source: https://pypi.org/project/gdeltdoc Use this command to create a new virtual environment for development. ```bash python -m venv venv ``` -------------------------------- ### Basic gdeltdoc Usage: Article and Timeline Search Source: https://pypi.org/project/gdeltdoc Demonstrates how to initialize the GdeltDoc client, define search filters, and perform both an article search and a timeline search. Requires importing GdeltDoc and Filters. ```python from gdeltdoc import GdeltDoc, Filters f = Filters( keyword = "climate change", start_date = "2020-05-10", end_date = "2020-05-11" ) gd = GdeltDoc() # Search for articles matching the filters articles = gd.article_search(f) # Get a timeline of the number of articles matching the filters timeline = gd.timeline_search("timelinevol", f) ``` -------------------------------- ### Run Unit Tests Source: https://pypi.org/project/gdeltdoc Execute the package's unit tests using the unittest module. ```bash python -m unittest ``` -------------------------------- ### Activate Virtual Environment (Mac/Linux) Source: https://pypi.org/project/gdeltdoc Activate the virtual environment on macOS or Linux systems. ```bash source venv/bin/activate ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.