Skip to content

vahgon/magic-wikibytes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magic-wikibytes

Parses and converts the file signature wikitable at List of file signatures into json and markdown.

How it Works

magic-wikibytes will make at most two GET requests to the Wikimedia API. The first request calls for the revision id of the Wikipedia page List of file signatures. The second request asks for the page content. This request is conditional—If the revision id is not identical to the revision id of the application's last execution (or if --force is specified), the request is made.

Because differing authors can contribute to the Wikitable, the format of each cell can differ compared to another. As such, many checks are performed during the parsing process. During this process, the user can provide command-line arguments to alter the final format of the parsed table.

Example outputs of this application can be seen at this project's docs directory.

Getting Started

  1. Clone the repo

    $ git clone https://github.com/vahgon/magic-wikibytes
    
  2. Install required packages

    $ pip3 install -r requirements.txt
    

After cloning the repo and installing the required packages, run the app

$ python3 wikibytes.py

When ran for the first time, the application will ask for you to input your email address. This is to adhere to the Wikimedia API's access policy; the given email address is set as the value of all future requests' User-Agent header. This email address is then saved in ./lib/util/.conf and can be changed manually by directly editing the value of EMAIL in the file, or by specifying a different email before executing the application by use of the --email argument.

About

Retrieves and formats the 'List of file signatures' Wikipedia page

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages