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.1.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.1-py2.py3-none-any.whl (6.7 MB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pyglottolog-4.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8e6d65af6f515d33626fd51a519ee54ea078a5668f28301e5f15f5f72f693a66
MD5 3947f3f07ff5037f5f72df869b127deb
BLAKE2b-256 f855c38d55d6921d1c33ab1c5fd4bf9999ec26dd4e805bd1c0979e68fef8c757

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyglottolog-4.0.1-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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 86038eb420ea66d1df1ebcf218037090205ed786ee5cac04984b054f58c0a171
MD5 dd74d179d4ada2ebfb5e508e6f85fc39
BLAKE2b-256 c39a211513d2fa239b42858c4f716012ed2f54cbe85048896ba0077f204ffc80

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