Skip to main content

clld-glottologfamily-plugin

clld plugin, adding language families from Glottolog to a clld app to allow for better navigation and visualization.

Build Status PyPI

Usage

To equip a Language model with a family relation, the model should inherit from clld_glottologfamily_plugin.models.HasFamilyMixin. This relation can be populated upon database initialization calling clld_glottologfamily_plugin.util.load_families.

The families assigned in this way have an associated icon which can be used as map marker. To make this easier, a custom IMapMarker may inherit from clld_glottologfamily_plugin.util.LanguageByFamilyMapMarker.

Associated DataTable columns suitable for tables listing Language objects can be used as follows:

from clld.web.datatables.language import Languages
from clld_glottologfamily_plugin.datatables import FamilyCol, MacroareaCol
from clld_glottologfamily_plugin.models import Family

from models import CustomLanguage


class LanguagesWithFamily(Languages):
    def base_query(self, query):
        return query.outerjoin(Family)  # note: isolates will have no related family!

    def col_defs(self):
        res = Languages.col_defs(self)
        res.append(MacroareaCol(self, 'macroarea', language_cls=CustomLanguage))
        res.append(FamilyCol(self, 'family', language_cls=CustomLanguage))
        return res

Assigning families

  1. Family information is retrieved from Glottolog, based on the id attribute of a language. This will only work if id is either a glottocode or an ISO 639-3 code.

  2. If no related family is found, None will be assigned - rather than a dummy isolates family or individual one-member families derived from the language.

Release files for clld-glottologfamily-plugin 4.1.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 clld-glottologfamily-plugin 4.1.0
File Size Uploaded
clld-glottologfamily-plugin-4.1.0.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clld-glottologfamily-plugin 4.1.0
File Interpreter ABI Platform
clld_glottologfamily_plugin-4.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 24.4 kB

Release files / clld-glottologfamily-plugin-4.1.0.tar.gz

Download URL clld-glottologfamily-plugin-4.1.0.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b2971441fbd339d361f8b2c5b15f6bd572ffb10b537831d7ca2081c018665470
BLAKE2b-256 checksum
How to use checksums
3ef17e57c5a5a97b6046baf683ec6fcc7cde468af8b14d09109a9236fd8e0058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / clld_glottologfamily_plugin-4.1.0-py2.py3-none-any.whl

Download URL clld_glottologfamily_plugin-4.1.0-py2.py3-none-any.whl
Size 12.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
93f8c6444d782a93bd94e7883c7bfe4dbd0ef3d487a386e7174d680f3f1ac39b
BLAKE2b-256 checksum
How to use checksums
409b971007093998847aa8faa76c8ba258a2aaef2ec7f0aa5a7715f17afbdd48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

4.1.0 This release

2 release files

4.0.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.1.0

2 release files

2.0.1

1 release file

2.0.0

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.4

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