Skip to main content

python package for glottolog data curation

Project description

pyglottolog

Programmatic access to Glottolog data.

Build Status Documentation Status PyPI

[!NOTE]
Accessing Glottolog data programmatically has become a lot easier with the Glottolog CLDF dataset. Thus, pyglottolog now mostly serves as internal data curation tool.

Install

To install pyglottolog you need a python installation on your system, running python >3.8. Run

pip install pyglottolog

This will also install the command line interface glottolog.

Note: To make use of pyglottolog you also need a local copy of the Glottolog data. This can be

Make sure you remember where this local copy of the data is located - you may have to pass this location as option when using pyglottolog.

A convenient way to clone the data repository, keep it updated and access it from pyglottolog is provided by cldfbench. See the README for details.

Python API

Using pyglottolog, Glottolog data can be accessed programmatically from within python programs. All functionality is mediated through an instance of pyglottolog.Glottolog, e.g.

>>> from pyglottolog import Glottolog
>>> glottolog = Glottolog('.')
>>> print(glottolog)
<Glottolog repos v0.2-259-g27ac0ef at /.../glottolog>

For details, refer to the API documentation at readthedocs.

Command line interface

Command line functionality is implemented via sub-commands of glottolog. The list of available sub-commands can be inspected running

$ glottolog -h
usage: glottolog [-h] [--log-level LOG_LEVEL] [--repos REPOS]
                 [--repos-version REPOS_VERSION]
                 COMMAND ...

optional arguments:
  -h, --help            show this help message and exit
  --log-level LOG_LEVEL
                        log level [ERROR|WARN|INFO|DEBUG] (default: 20)
  --repos REPOS         clone of glottolog/glottolog
  --repos-version REPOS_VERSION
                        version of repository data. Requires a git clone!
                        (default: None)

available commands:
  Run "COMAMND -h" to get help for a specific command.

  COMMAND
    create              Create a new languoid directory for a languoid
                        specified by name and level.
    edit                Open a languoid's INI file in a text editor.
    htmlmap             Create an HTML/Javascript map (using leaflet) of
                        Glottolog languoids.
    iso2codes           Map ISO codes to the list of all Glottolog languages
                        and dialects subsumed "under" it.
    langdatastats       List all metadata fields used in languoid INI files
                        and their frequency.
    show                Display details of a Glottolog object.
    tree                Print the classification tree starting at a specific
                        languoid.

Extracting languoid data

Glottolog data is often integrated with other data or incorporated as reference data in tools, e.g. as LanguageTable in a CLDF dataset.

To do this, the LanguageTable from glottolog/glottolog-cldf can be copied.

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

pyglottolog-4.0.0.tar.gz (6.7 MB view details)

Uploaded Source

Built Distribution

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

pyglottolog-4.0.0-py2.py3-none-any.whl (6.7 MB view details)

Uploaded Python 2Python 3

File details

Details for the file pyglottolog-4.0.0.tar.gz.

File metadata

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

File hashes

Hashes for pyglottolog-4.0.0.tar.gz
Algorithm Hash digest
SHA256 c18307c961e581e986ad6c46b31648aa5fd7e0d90ab05d870cfd7d48a27c3da0
MD5 9b0628ce83ef64827120401e0bb14e0d
BLAKE2b-256 201e2dcf70e9654a3445775b8868854d035eee2c2969d71c957035d8e81847c5

See more details on using hashes here.

File details

Details for the file pyglottolog-4.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pyglottolog-4.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.7 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pyglottolog-4.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e2a3e737f64ea692eac6edd74e379b4bf1bbb78c7274dc6030fc57b67471c16
MD5 056be8f374bd37f9a5d667e5b6e62952
BLAKE2b-256 ba159a99ac96a37da9507f923e3727cd026b0cc495a3a82773432e9935a3b4f0

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