Skip to main content

A cldfbench plugin to create offline broweable CLDF datasets

Project description

cldfofflinebrowser

A cldfbench plugin to create an offline-browseable representation of a CLDF Wordlist with audio. This representation consists of a set of HTML pages augmented with Javascript which can be viewed in a web browser without requiring internet.

Build Status PyPI

Install

Install the package via

pip install cldfofflinebrowser

CLI

The functionality of this package is provided as cldfbench subcommand:

$ cldfbench offline.create -h
usage: cldfbench offline.create [-h] [--outdir OUTDIR] [--tiles TILES] [--with-audio] [--include INCLUDE] [--download-dir DOWNLOAD_DIR] [--padding PADDING] [--max-zoom MAX_ZOOM]
                                DATASET

Create an offline browseable version of a CLDF Wordlist.

positional arguments:
  DATASET               Dataset locator (i.e. URL or path to a CLDF metadata file or to the data file). Resolving dataset locators like DOI URLs might require installation of third-
                        party packages, registering such functionality using the `pycldf_dataset_resolver` entry point.

options:
  -h, --help            show this help message and exit
  --outdir OUTDIR       Directory in which to create the offline browseable files. (default: offline)
  --tiles TILES         Also add map tiles from the mbtiles file specified. (default: None)
  --with-audio          Also download audio files (default: False)
  --include INCLUDE     Whitespace separated list of parameter IDs (default: None)
  --download-dir DOWNLOAD_DIR
                        An existing directory to use for downloading a dataset (if necessary). (default: None)
  --padding PADDING     Padding in degree longitude at zoom level 5 to add to minimal bounding box when retrieving map tiles. (default: 8)
  --max-zoom MAX_ZOOM   Maximal zoom level for which to add map tiles. (default: 10)

Notes on offline maps

The browser pages use geographic maps to visualize the languages and words in the dataset in geographic space. The Javascript library implementing this functionality requires map data to be available as set of tiles.

cldfbench create --tiles […] allows you to add map tiles at different zoom levels for offline viewing to the browser. Since bulk downloads of map tiles from the internet require a lot of bandwith and server processing, it is generally discouraged. Thus, cldfofflinebrowser support an alternative way to obtain map tiles using a local tileserver, serving data from a MBTiles file.

So, after

you should be able to run

cldfbench offline.create --tiles PATH/TO/osm-*.mbtiles []

To keep the amount of required map tiles at a minimum (making the browser's storage footprint smaller), you should follow these guidelines:

  • Keep your LanguageTable clean!
    Make sure it only contains languages that you have actual data points for, otherwise you'll end up downloading map tiles for regions that nobody will look at.
  • Set --max-zoom to a reasonably low zoom level!
    This is especially true if your language sample spans over great distances. A map that covers half the planet will result in tens if not hundreds of thousands of tile downloads at higher zoom levels (10, 11, 12). So it's better to find a zoom-level that makes your data comfortable to look at and not go any deeper than that.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cldfofflinebrowser-1.0.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cldfofflinebrowser-1.0.0-py2.py3-none-any.whl (1.6 MB view details)

Uploaded Python 2Python 3

File details

Details for the file cldfofflinebrowser-1.0.0.tar.gz.

File metadata

  • Download URL: cldfofflinebrowser-1.0.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cldfofflinebrowser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c4d84bc68c856afb531b2073f6f8affc23880a31d19119275e358b0ebe9c25c7
MD5 c23c81965210ef617f2546c7919de889
BLAKE2b-256 0011ccace294c31f9679599827e030625325a510d0e99c6a58bb3688f5db6100

See more details on using hashes here.

File details

Details for the file cldfofflinebrowser-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cldfofflinebrowser-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22f460a8d71d1656f3df9991c43e6520e5d165897ccf7c5ac84157495765ec2b
MD5 65c45a75f9af026ebc7801178dc152b5
BLAKE2b-256 647f2843927758a0ac539a93c5916ec001f5c8d70dc49099691cbc9bac4e8777

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page