pyconcepticon


Namepyconcepticon JSON
Version 3.1.0 PyPI version JSON
download
home_pagehttps://github.com/concepticon/pyconcepticon
Summaryprogrammatic curation of concepticon-data
upload_time2024-03-18 09:28:35
maintainer
docs_urlNone
authorRobert Forkel
requires_python>=3.8
licenseApache 2.0
keywords data linguistics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyconcepticon

Tooling to access and curate [Concepticon data](https://github.com/concepticon/concepticon-data).

[![Build Status](https://github.com/concepticon/pyconcepticon/workflows/tests/badge.svg)](https://github.com/concepticon/pyconcepticon/actions?query=workflow%3Atests)
[![PyPI](https://img.shields.io/pypi/v/pyconcepticon.svg)](https://pypi.org/project/pyconcepticon)


## Installation

`pyconcepticon` can be installed from [PyPI](https://pypi.python.org/pypi) running
```shell script
pip install pyconcepticon
```

Note that `pyconcepticon` requires a clone or export of the [concepticon data repository](https://github.com/concepticon/concepticon-data).


## Usage

To use `pyconcepticon` you must have a local copy of the Concepticon data, i.e. either

* the sources of a [released version](https://github.com/concepticon/concepticon-data/releases), as provided in the **Downloads** 
  section of a release, or
* a clone of this repository (or your personal fork of it).
* or a released version of the data as archived on [ZENODO](https://doi.org/10.5281/zenodo.596412).


### Python API

Assuming you have downloaded release 1.2.0 [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1313461.svg)](https://doi.org/10.5281/zenodo.1313461)
and unpacked the sources to a directory `clld-concepticon-data-41d2bf0`, you can access
the data as follows:
```python
>>> from pyconcepticon import Concepticon
>>> api = Concepticon('clld-concepticon-data-41d2bf0')
>>> conceptlist = list(api.conceptlists.values())[0]
>>> conceptlist.author
'Perrin, Loïc-Michel'
>>> conceptlist.tags
['annotated']
>>> len(conceptlist.concepts)
110
>>> list(conceptlist.concepts.values())[0]
Concept(
    id='Perrin-2010-110-1', number='1', concepticon_id='1906', concepticon_gloss='SOUR', gloss=None, 
    english='ACID', attributes={'german': 'sauer', 'french': 'acide'}, 
    _list=Conceptlist(
        _api=<pyconcepticon.api.Concepticon object at 0x7f31693be518>, 
        id='Perrin-2010-110', author='Perrin, Loïc-Michel', year=2010, list_suffix='', items=110, 
        tags=['annotated'], source_language=['english', 'french', 'german'], 
        target_language='Global', 
        url='https://journals.dartmouth.edu/cgi-bin/WebObjects/Journals.woa/xmlpage/1/article/353?htmlOnce=yes', 
        refs=['Perrin2010'], pdf=['Perrin2010'], 
        note='This list was used as an initial questionnaire for colexification studies on a world-wide sample of languages.', 
        pages='276f', alias=[], local=False))
```

### Command line interface

Having installed `pyconcepticon`, you can also directly query concept lists via the terminal command 
`concepticon`. To learn about the functionality it provides run
```shell script
$ concepticon -h
usage: concepticon [-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 concepticon/concepticon-data
  --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
    attributes          Print all columns in concept lists that contain
                        surplus information.
...
```

To learn about individual subcommands run `concepticon COMMAND -h`, e.g.
```shell
$ concepticon lookup -h
usage: concepticon lookup [-h]
                          [--format {fancy_grid,fancy_outline,github,grid,html,jira,latex,latex_booktabs,latex_longtable,latex_raw,mediawiki,moinmoin,orgtbl,pipe,plain,presto,pretty,psql,rst,simple,textile,tsv,unsafehtml,youtrack}]
                          [--similarity SIMILARITY] [--full-search]
                          [--language LANGUAGE]
                          GLOSS [GLOSS ...]

Look up the specified glosses in Concepticon.

positional arguments:
  GLOSS

optional arguments:
  -h, --help            show this help message and exit
  --format {fancy_grid,fancy_outline,github,grid,html,jira,latex,latex_booktabs,latex_longtable,latex_raw,mediawiki,moinmoin,orgtbl,pipe,plain,presto,pretty,psql,rst,simple,textile,tsv,unsafehtml,youtrack}
                        Format of tabular output. (default: simple)
  --similarity SIMILARITY
                        specify level of similarity for concept mapping
                        (default: 5)
  --full-search         select between approximate search (default) and full
                        search (default: False)
  --language LANGUAGE   specify your desired language for mapping (default:
                        en)
```


## Configuration

The Python API as well as the CLI can lookup the location of the data from a
[`cldfcatalog` config file](https://github.com/cldf/cldfcatalog/#configuration), under the key `concepticon`.

Such a config file (and the repository clone) can be created automatically,
by installing [`cldfbench`](https://pypi.org/cldfbench) and running
`cldfbench config`.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/concepticon/pyconcepticon",
    "name": "pyconcepticon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "data,linguistics",
    "author": "Robert Forkel",
    "author_email": "robert_forkel@eva.mpg.de",
    "download_url": "https://files.pythonhosted.org/packages/1e/a3/1c30a09f1e9fc271a82b78925e8b929a3b1f18021c6001188cdff6767575/pyconcepticon-3.1.0.tar.gz",
    "platform": "any",
    "description": "# pyconcepticon\n\nTooling to access and curate [Concepticon data](https://github.com/concepticon/concepticon-data).\n\n[![Build Status](https://github.com/concepticon/pyconcepticon/workflows/tests/badge.svg)](https://github.com/concepticon/pyconcepticon/actions?query=workflow%3Atests)\n[![PyPI](https://img.shields.io/pypi/v/pyconcepticon.svg)](https://pypi.org/project/pyconcepticon)\n\n\n## Installation\n\n`pyconcepticon` can be installed from [PyPI](https://pypi.python.org/pypi) running\n```shell script\npip install pyconcepticon\n```\n\nNote that `pyconcepticon` requires a clone or export of the [concepticon data repository](https://github.com/concepticon/concepticon-data).\n\n\n## Usage\n\nTo use `pyconcepticon` you must have a local copy of the Concepticon data, i.e. either\n\n* the sources of a [released version](https://github.com/concepticon/concepticon-data/releases), as provided in the **Downloads** \n  section of a release, or\n* a clone of this repository (or your personal fork of it).\n* or a released version of the data as archived on [ZENODO](https://doi.org/10.5281/zenodo.596412).\n\n\n### Python API\n\nAssuming you have downloaded release 1.2.0 [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1313461.svg)](https://doi.org/10.5281/zenodo.1313461)\nand unpacked the sources to a directory `clld-concepticon-data-41d2bf0`, you can access\nthe data as follows:\n```python\n>>> from pyconcepticon import Concepticon\n>>> api = Concepticon('clld-concepticon-data-41d2bf0')\n>>> conceptlist = list(api.conceptlists.values())[0]\n>>> conceptlist.author\n'Perrin, Lo\u00efc-Michel'\n>>> conceptlist.tags\n['annotated']\n>>> len(conceptlist.concepts)\n110\n>>> list(conceptlist.concepts.values())[0]\nConcept(\n    id='Perrin-2010-110-1', number='1', concepticon_id='1906', concepticon_gloss='SOUR', gloss=None, \n    english='ACID', attributes={'german': 'sauer', 'french': 'acide'}, \n    _list=Conceptlist(\n        _api=<pyconcepticon.api.Concepticon object at 0x7f31693be518>, \n        id='Perrin-2010-110', author='Perrin, Lo\u00efc-Michel', year=2010, list_suffix='', items=110, \n        tags=['annotated'], source_language=['english', 'french', 'german'], \n        target_language='Global', \n        url='https://journals.dartmouth.edu/cgi-bin/WebObjects/Journals.woa/xmlpage/1/article/353?htmlOnce=yes', \n        refs=['Perrin2010'], pdf=['Perrin2010'], \n        note='This list was used as an initial questionnaire for colexification studies on a world-wide sample of languages.', \n        pages='276f', alias=[], local=False))\n```\n\n### Command line interface\n\nHaving installed `pyconcepticon`, you can also directly query concept lists via the terminal command \n`concepticon`. To learn about the functionality it provides run\n```shell script\n$ concepticon -h\nusage: concepticon [-h] [--log-level LOG_LEVEL] [--repos REPOS]\n                   [--repos-version REPOS_VERSION]\n                   COMMAND ...\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --log-level LOG_LEVEL\n                        log level [ERROR|WARN|INFO|DEBUG] (default: 20)\n  --repos REPOS         clone of concepticon/concepticon-data\n  --repos-version REPOS_VERSION\n                        version of repository data. Requires a git clone!\n                        (default: None)\n\navailable commands:\n  Run \"COMAMND -h\" to get help for a specific command.\n\n  COMMAND\n    attributes          Print all columns in concept lists that contain\n                        surplus information.\n...\n```\n\nTo learn about individual subcommands run `concepticon COMMAND -h`, e.g.\n```shell\n$ concepticon lookup -h\nusage: concepticon lookup [-h]\n                          [--format {fancy_grid,fancy_outline,github,grid,html,jira,latex,latex_booktabs,latex_longtable,latex_raw,mediawiki,moinmoin,orgtbl,pipe,plain,presto,pretty,psql,rst,simple,textile,tsv,unsafehtml,youtrack}]\n                          [--similarity SIMILARITY] [--full-search]\n                          [--language LANGUAGE]\n                          GLOSS [GLOSS ...]\n\nLook up the specified glosses in Concepticon.\n\npositional arguments:\n  GLOSS\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --format {fancy_grid,fancy_outline,github,grid,html,jira,latex,latex_booktabs,latex_longtable,latex_raw,mediawiki,moinmoin,orgtbl,pipe,plain,presto,pretty,psql,rst,simple,textile,tsv,unsafehtml,youtrack}\n                        Format of tabular output. (default: simple)\n  --similarity SIMILARITY\n                        specify level of similarity for concept mapping\n                        (default: 5)\n  --full-search         select between approximate search (default) and full\n                        search (default: False)\n  --language LANGUAGE   specify your desired language for mapping (default:\n                        en)\n```\n\n\n## Configuration\n\nThe Python API as well as the CLI can lookup the location of the data from a\n[`cldfcatalog` config file](https://github.com/cldf/cldfcatalog/#configuration), under the key `concepticon`.\n\nSuch a config file (and the repository clone) can be created automatically,\nby installing [`cldfbench`](https://pypi.org/cldfbench) and running\n`cldfbench config`.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "programmatic curation of concepticon-data",
    "version": "3.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/concepticon/pyconcepticon/issues",
        "Homepage": "https://github.com/concepticon/pyconcepticon"
    },
    "split_keywords": [
        "data",
        "linguistics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f9157ce303306d0837500a206c6af8dbad5eaa3614ad54fdab8a86063c2b1e5",
                "md5": "e70a6d9d3bd5449ab5340ebd82711177",
                "sha256": "ebe02abf35a1f7835f55a15cc478cf957863daff6265be26a851f8a8852b50d5"
            },
            "downloads": -1,
            "filename": "pyconcepticon-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e70a6d9d3bd5449ab5340ebd82711177",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1144499,
            "upload_time": "2024-03-18T09:28:27",
            "upload_time_iso_8601": "2024-03-18T09:28:27.020159Z",
            "url": "https://files.pythonhosted.org/packages/5f/91/57ce303306d0837500a206c6af8dbad5eaa3614ad54fdab8a86063c2b1e5/pyconcepticon-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ea31c30a09f1e9fc271a82b78925e8b929a3b1f18021c6001188cdff6767575",
                "md5": "931bfef7d15fd4155a0cfdf93898e762",
                "sha256": "4ac3248265b9d8ccee6c940dced669eca07b20e6e52cc6e451e5f77b39f00000"
            },
            "downloads": -1,
            "filename": "pyconcepticon-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "931bfef7d15fd4155a0cfdf93898e762",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1080128,
            "upload_time": "2024-03-18T09:28:35",
            "upload_time_iso_8601": "2024-03-18T09:28:35.289354Z",
            "url": "https://files.pythonhosted.org/packages/1e/a3/1c30a09f1e9fc271a82b78925e8b929a3b1f18021c6001188cdff6767575/pyconcepticon-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 09:28:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "concepticon",
    "github_project": "pyconcepticon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pyconcepticon"
}
        
Elapsed time: 0.25963s