Skip to main content

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.

Release files for pyglottolog 4.0.1

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

Source distribution (sdist)

Source distribution for pyglottolog 4.0.1
File Size Uploaded
pyglottolog-4.0.1.tar.gz 6.7 MB Details

Built distribution (wheel)

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

Total release size:13.4 MB

Release files / pyglottolog-4.0.1.tar.gz

Download URL pyglottolog-4.0.1.tar.gz
Size 6.7 MB
Tags Source
SHA-256 checksum
How to use checksums
8e6d65af6f515d33626fd51a519ee54ea078a5668f28301e5f15f5f72f693a66
BLAKE2b-256 checksum
How to use checksums
f855c38d55d6921d1c33ab1c5fd4bf9999ec26dd4e805bd1c0979e68fef8c757
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / pyglottolog-4.0.1-py2.py3-none-any.whl

Download URL pyglottolog-4.0.1-py2.py3-none-any.whl
Size 6.7 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
86038eb420ea66d1df1ebcf218037090205ed786ee5cac04984b054f58c0a171
BLAKE2b-256 checksum
How to use checksums
c39a211513d2fa239b42858c4f716012ed2f54cbe85048896ba0077f204ffc80
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

4.0.1 This release

2 release files

4.0.0

2 release files

3.16.0

2 release files

3.15.0

2 release files

3.14.0

2 release files

3.13.0

2 release files

3.12.0

2 release files

3.10.0

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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