Skip to main content

[RFC] Semantic Conventions for OpenStreetMap™ 2023 - Python library example

Project description

wiki_as_base-py

[MVP] Use MediaWiki Wiki page content as read-only database. Python library implementation. See https://github.com/fititnt/openstreetmap-serverless-functions/tree/main/function/wiki-as-base

GitHub Pypi: wiki_as_base

Installing

pip install wiki_as_base --upgrade

Usage

Environment variables

Customize for your needs. They're shared between command line and the library.

export WIKI_API='https://wiki.openstreetmap.org/w/api.php'
export WIKI_INFOBOXES='ValueDescription\nKeyDescription'
export WIKI_DATA_LANGS='yaml\nturtle'

Command line

wiki_as_base --help

# Select base page from the Wiki mentioned on WIKI_API
wiki_as_base --page-title 'User:EmericusPetro/sandbox/Wiki-as-base'

# The output is JSON-LD. Feel free to further filter the data
wiki_as_base --page-title 'User:EmericusPetro/sandbox/Wiki-as-base' | jq .data[0]

Library

Disclaimer / Trivia

The wiki_as_base allows no-as-complete data extraction from MediaWiki markup text directly by its API or direct input, without need to install server extensions.

Check also the wikimedia/Wikibase, a full server version (which inspired the name).

License

Public domain

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

wiki_as_base-0.2.0.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

wiki_as_base-0.2.0-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

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