Code Monkey home page Code Monkey logo

lingua-libre-bot's Introduction

Lingua Libre Bot

This is the source code of Lingua Libre Bot, whose goal is to ease the reuse of all the records made on Lingua Libre on as much wikis as possible.

Wikimedia coverage

See CentralAuth.

  • Wikidata
  • Wikidata Lexemes
  • French Wiktionary
  • Kurdish Wiktionary
  • Occitan Wiktionary
  • Odia Wiktionary
  • Shawiya Wiktionary

Operational documentation

Dependencies

  • Python 3.6
  • wikitextparser (latest)
  • requests (latest)
  • argparse (latest)
  • uuid (latest)
  • backoff (latest)

Installation

pip install -r requirements.txt     # Install packages
cp config.ini.sample config.ini     # Copy the configuration file
vi config.ini                       # Edit it with your information

Usage

usage: llbot.py {simple, live} [-h] [--dryrun] [--wiki WIKI]

Reuse records made on Lingua Libre on some wikis.

optional arguments:
  -h, --help            show this help message and exit
  --dryrun              run without applying any changes to the wiki
  --wiki {wikidatawiki,frwiktionary}
                        run only on the selected wiki
  
simple mode
  --item ITEM           run only on the given lingualibre item
  --startdate STARTDATE from which timestamp to start
  --enddate ENDDATE     at which timestamp to end
  --user USER           run only on records from the given user
  --lang LANG           run only on records from the given language,
                        identified by its lingua libre qid
  --langiso LANGISO     run only on records from the given language,
                        identified by its iso 693-3 code
  --langwm LANGWM       run only on records from the given language,
                        identified by its wikimedia language code
  
live mode
  --delay DELAY         duration in seconds to wait between
                        2 recent changes check (default: 10 s)
  --backcheck BACKCHECK check at launch recent changes in the 
                        last BACKCHECK seconds (default: 0)
                        

Preferred date format

%Y-%m-%dT01:00:00.000+00:00

If you need to automate the bot running a few times a week, you can use the following Linux command :

> date -d "-2 days" +'%Y-%m-%dT01:00:00.000+00:00'
2021-06-30T01:00:00.000+00:00

Structure

├── requirements.txt — dependencies list (install only).
├── config.ini.sample — config sample (install only).
├── version.py — version number of the bot.
├── lili.py — 
├── llbot.py — abstraction and help documentation
├── pywiki.py — 
├── record.py — data formating
├── sparql.py — handles SPARQL queries response's errors and formating
└── wikis/
    ├── wiki.py — 
    ├── wikidata.py — wikidata specific
    ├── wiktionary.py — abstraction for wiktionaries
    └── wiktionaries/
        ├── {iso}wiktionary.py — ... for wiktionary of language {iso}
        └── {iso}wiktionary.py — idem, etc.

Contribute

See also

lingua-libre-bot's People

Contributors

0x010c avatar ash-crow avatar cedrictarbouriech avatar hugolpz avatar mind-the-cap avatar pamputt avatar poslovitch avatar unuaiga avatar wikilucas00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.