Giter Club home page Giter Club logo

census-wikidata-bot's Introduction

census-wikidata-bot

U.S. Census Bureau logo

This project contains code for a bot which interacts with [Wikidata] (https://www.wikidata.org/wiki/Wikidata:Main_Page) using the pywikibot library. This bot is designed to use Census data specifically and push it to wikidata if a page exists for the subject matter.

Scope

Currently, this bot is only set up to use a static file containing U.S. state population values for 2015. The bot will use these values to search and see if a page exists for that state. If a single result is found, it will access the page and check if the population statement is present. If so, it will check the claims. If there is a claim with no point in time value, it will be deleted. Subsequently, it will check for any entries referring to a 2015 point in time. If it finds any it will check them for completeness. if anything is off, it will delete that entry and make a new complete entry. If no population statement is present or if no 2015 entry for population is present it will add that to the page. Currently, there is a page for Arizona, Oregon, California, and Virginia on the test site which this bot will find.

Future Scope

Going forward, there will be changes to the functionality of this bot and the range of data that it accesses and inserts into Wikidata. This page will be periodically accordingly.

Setup

In order to set up this bot to run, a wikidata account with a bot flag approval is necessary. This bot uses python 3.5 and the main library for interaction with the Wikidata API is [Pywikibot] (https://www.mediawiki.org/wiki/Manual:Pywikibot). The configuration file for this bot is contained in user-config.py.

In the this file, insert your user account in the following line:
usernames['sitename']['en'] = u'ExampleBot'

The mylang and family parameters will also need to be set accordingly. Please refer to the documentation for Pywikibot for additional information regarding this (as well as logging in).

Lastly, for testing purposes, there is a mode parameter contained in the addPopValues.py file. This can be set to either test or wikidata. This determines whether the test site or production property tags will be used.

Running Bot

Once setup has been completed, the bot can be run by executing the addPopValues.py file.

census-wikidata-bot's People

Contributors

bahadasx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.