Skip to main content

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.

Release files for cldfofflinebrowser 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cldfofflinebrowser 1.0.0
File Size Uploaded
cldfofflinebrowser-1.0.0.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cldfofflinebrowser 1.0.0
File Interpreter ABI Platform
cldfofflinebrowser-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 3.1 MB

Release files / cldfofflinebrowser-1.0.0.tar.gz

Download URL cldfofflinebrowser-1.0.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
c4d84bc68c856afb531b2073f6f8affc23880a31d19119275e358b0ebe9c25c7
BLAKE2b-256 checksum
How to use checksums
0011ccace294c31f9679599827e030625325a510d0e99c6a58bb3688f5db6100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / cldfofflinebrowser-1.0.0-py2.py3-none-any.whl

Download URL cldfofflinebrowser-1.0.0-py2.py3-none-any.whl
Size 1.6 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
22f460a8d71d1656f3df9991c43e6520e5d165897ccf7c5ac84157495765ec2b
BLAKE2b-256 checksum
How to use checksums
647f2843927758a0ac539a93c5916ec001f5c8d70dc49099691cbc9bac4e8777
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page