Skip to content

Convert a Kiwix library.xml file into a pibox/ideascube catalog.yml one

Notifications You must be signed in to change notification settings

mgautierfr/library-to-catalog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

library-to-catalog

A script to convert a Kiwix library.xml file into a pibox/ideascube catalog.yml one.

Requirements

  • Python2.7+ or Python3.3+
  • Virtualenv
  • Working internet connexion (SHA-256 checksum and size of ZIM are fetched online)

Debian/Ubuntu

apt install python3 python3-virtualenv

Installation

  • Extract to appropriate location
  • run library-to-catalog.sh script once (creates virtual envirronment at first start)
  • schedule periodic run via cron
# m h  dom mon dow   command
0 2 * * * /path/to/library-to-catalog.sh /var/www/library.xml /var/www/kiwix-catalog.yml >> /path/to/lib2cat.log

Usage

library-to-catalog.sh library.xml kiwix-catalog.yml [zim|zip]
  • Script takes two args: path to library.xml file and final wanted path for catalog.yml file.
  • Script first writes to a temporary file and only creates final yaml file upon success so it's safe to use the final location.
  • Script does not download library.xml file. You can easily chain it to a wget|curl command though.
wget -O kiwix_library.xml http://download.kiwix.org/library/library.xml && library-to-catalog.sh kiwix_library.xml /path/to/kiwix.yml

About

Convert a Kiwix library.xml file into a pibox/ideascube catalog.yml one

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 83.8%
  • Shell 16.2%