Source code

VIEWS is an open-source project. All source code required to replicate our models and peek into the data infrastructure supporting it is available in a set of GitHub repositories. We also offer a number of tools to help users access data from our API and visualise output from the VIEWS models. Links to the full suite of public VIEWS repositories can be found below. 
Modeling code
Repository: viewsforecasting
Description:
Documentation of the prediction model currently in use (2022- ).
Prediction outcome:
Continuous (number of fatalities per country-month and PRIO-GRID-month).
License: CC-BY-NC

CitationHåvard Hegre, Forogh Akbari, Mihai Croicu, James Dale, Tim Gåsste, Remco Jansen, Peder Landsverk, Maxine Leis, Angelica Lindqvist-McGowan, Hannes Mueller, Malika Rakhmankulova, David Randahl, Christopher Rauh, Espen Geelmuyden Rød, Paola Vesco, 2022. ” Forecasting fatalities“. Report, Uppsala University, 2022-06-09.
Repository:  FCDO_predicting_fatalities
Description: 
A snap shot of the source code for the continuous prediction model as it looked when it was first released early 2022 ( the fatalities001 model) in collaboration with the UK FCDO. Further developments are pushed to the viewsforecasting repository.
Prediction outcome:
Continuous (number of fatalities per country-month and PRIO-GRID-month).
License: CC-BY-NC

CitationHåvard Hegre, Forogh Akbari, Mihai Croicu, James Dale, Tim Gåsste, Remco Jansen, Peder Landsverk, Maxine Leis, Angelica Lindqvist-McGowan, Hannes Mueller, Malika Rakhmankulova, David Randahl, Christopher Rauh, Espen Geelmuyden Rød, Paola Vesco, 2022. ” Forecasting fatalities“. Report, Uppsala University, 2022-06-09.
Repository:  views_competition
Description:
Code and data used in the clean-up and evaluation of the 2020 ViEWS prediction competition
License: CC-BY-NC

Citation: Vesco, Paola, Håvard Hegre, Michael Colaresi, Remco Bastiaan Jansen, Adeline Lo, Gregor Reisch & Nils B Weidmann (2022). “United They Stand: Findings from an Escalation Prediction Competition.” International Interactions 48(4). doi: 10.1080/03050629.2022.2029856
Repository:  OpenViEWS2
Description:
  Documentation of the prediction models in use between 2018 – 2021. Please note that these models are deprecated and thus no longer maintained. 
Prediction outcome:
Dichotomous (at least 25 BRDs per country-month, and at least 1 BRD per PRIO-GRID-month).
License: CC-BY-NC
Citation: Hegre, H., Bell, C., Colaresi, M., Croicu, M., Hoyles, F., Jansen, R., Leis, M. R., Lindqvist-McGowan, A., Randahl, D., Rød, E. G., & Vesco, P. (2021). ” ViEWS 2020: Revising and evaluating the ViEWS political Violence Early-Warning System“. Journal of Peace Research. doi:10.1177/0022343320962157
Repository:  OpenViEWS
Description:
Documentation of the prediction models in use between 2017 and early 2018. Please note that these models are deprecated and thus no longer maintained. 
Prediction outcome:
Dichotomous (at least 25 BRDs per country-month, and at least 1 BRD per PRIO-GRID-month).
License: CC-BY-NC
Citation: Hegre, Håvard, Marie Allansson, Matthias Basedau, Michael Colaresi, Mihai Croicu, Hanne Fjelde, Frederick Hoyles, Lisa Hultman, Stina Högbladh, Remco Jansen, Naima Mouhleb, Sayyed Auwn Muhammad, Desirée Nilsson, Håvard Mokleiv Nygård, Gudlaug Olafsdottir, Kristina Petrova, David Randahl, Espen Geelmuyden RDichotomous (at least 25 BRDs per country-month, and at least 1 BRD per PRIO-GRID-month). weight: 400;”>ød, Gerald Schneider, Nina von Uexkull, and Jonas Vestby. ��ViEWS: a Political Violence Early-Warning System”. Journal of Peace Research, 56, no. 2 (March 2019): 155–74. doi:10.1177/0022343319823860.
Data visualization
Repository: Mapper2
Description:
A VIEWS package that provides a set of tools to generate visualizations of the VIEWS data. Coupled with a set of Jupyter notebooks that illustrate different data mapping options. 
License: CC-BY-NC
API
Repository:  views_api
Description:
Documentation and user guide for the VIEWS API that allows retrieval of predictions and selected input data.
License: MIT
Data infrastructure
The repositories below contain all documentation and source code required to run the ViEWS prediction models that have been developed since 2017. Each prediction model is based on one of three different data infrastructures: VIEWS3 (current, see Hegre et al. 2022), ViEWS2 (2018-2021, see Hegre et al. 2021), or ViEWS1 (2017-2018, see Hegre et al. 2019). 
VIEWS3 (2022- )
Key repositories for VIEWS3
Repository: viewser
Description: 
A client package for interacting with the ViEWS3 cloud ecosystem. This library provides functions, as well as a CLI entrypoint that handles authentication and API calls, making it easy to seamlessly retrieve data, explore models, and much more. See the viewser  user documentation to learn more. 
License:
CC-BY-NC
Repository:  views3
Description: 
A repository that holds the main docker-compose file used to deploy ViEWS3. See the  wiki for how to run.
License:  CC-BY-NC
Remaining repositories for VIEWS3
Repository:  base_data_retriever
Description:
Database layer for ViEWS3
License: MIT
Repository:  queries_benchmark
Description:
A script to serve as a benchmark to ensure that ViEWS3 is working as expected. 
License: Default GitHub protection
Repository:  stepshift
Description:
A package that implements the stepshifting algorithm described in Appendix A of Hegre et al. (2020).
License: CC-BY-NC
Repository: viewserspace
Description:
A batteries-included workspace for writing modelling notebooks using viewser.
License: Default GitHub protection
Repository:  views_dataviz
Description:
A legacy library holding former data visualization functions used by the ViEWS team.
License: CC-BY-NC
Repository:  views_data_transformer
Description:
The transformation endpoint for resolving data queries
License: CC-BY-NC
Repository:  views_docs
Description:
A small service that proxies to various introspection routes to forward documentation to the user. The service also checks for optional verbose documentation, which can also be posted to expand upon what is already provided by the services.
License: MIT
Repository:  views_example_workspace
Description:
A repository that demonstrates how to work with the ViEWS3 cloud locally.
License: Default GitHub protection
Repository:  views_job_manager
Description:
The service responsible for launching and managing jobs.
License: MIT
Repository:  views_partitioning
Description:
A python package for partitioning data for the ViEWS project.
License: CC-BY-NC
Repository:  views_queryset_manager
Description: 
A  service that is responsible for managing and retrieving data pertaining to querysets, which are collections of links to remote data
License: MIT
Repository:  views_query_planning
Description:
A package that exposes a class that makes it possible to generate queries against a relational database using a network representation of the ViEWS database.
License:  MIT
Repository:  views_router
Description:
The router is responsible for routing requests to the right data source.
License: MIT
Repository:  views_runs
Description:
A package meant to help ViEWS researchers with training models by providing a common interface for data partitioning and stepshift model training. It also functions as a central hub package for other classes and functions used by ViEWS researchers.
License: CC-BY-NC
Repository:  views_schema
Description:
Contains data definitions used throughout the ViEWS 3 system.
License: MIT
Repository:  views_stepshift
Description:
Package that contains the modelling procedure from ViEWS2, along with helpers and auxiliary functions.
License: Default GitHub protection
Repository:  views_storefront
Description:
An nginx database that proxies requests to the rest of the system.
License: CC-BY-NC
Repository:  views_transformation_library
Description:
The data transformation library used by the views data transformer service.
License: CC-BY-NC
Repository:  views_storage
Description:
A package that contains various classes used for storage and retrieval of data within views.
License: MIT
Repository:  views_timecaster
Description:
Simple service for casting between time formats when querying data for ViEWS.
License: Default GitHub protection
Repository:  vgrouper
Description:
A service responsible for grouping collections of variables into querysets.
License: Default GitHub protection
Repository:  views_blob_storage
Description:
Blob storage manager, experimental solution for storing submitted data in a flexible but efficient way.
License: Default GitHub protection
ViEWS2 (2018-2021)
Repository:  OpenViEWS2
Description:
  Source code to run the 2018-2021 prediction models under the ViEWS2 data infrastructure, coupled with a  user guide to get started with ViEWS2. Please note that ViEWS2 is deprecated and thus no longer maintained. 
License: CC-BY-NC
ViEWS1 (2017-2018)
Repository:  OpenViEWS
Description:
The prediction model and infrastructure in use between 2017 and early 2018. Please note that ViEWS1 is deprecated and thus no longer maintained. 
License: CC-BY-NC