A python library to curate Grambank data
Project description
pygrambank
Curation tools for Grambank data.
Install
pygrambank
can be installed from PyPI via
pip install pygrambank
or from a clone of [grambank/pygrambank
]:
git clone ...
cd pygrambank
pip install -e .
You should install pygrambank
in a virtual environment to make sure it does not mess with a system-wide Python installation.
CLI
Installing pygrambank
will also install a command line program grambank
. Data curation functionality is implemented as subcommands
of this program. To get information about available subcommands, run
grambank --help
More info on individual subcommands can be obtained running
grambank <SUBCOMMAND> -h
e.g.
$ grambank describe -h
usage: grambank describe [-h] [--columns] SHEET
Describe a (set of) sheets.
This includes checking for correctness - i.e. the functionality of `grambank check`.
While references will be parsed, the corresponding sources will **not** be looked up
in Glottolog (since this is slow). Thus, for a final check of a sheet, you must run
`grambank sourcelookup`.
positional arguments:
SHEET Path of a specific TSV file to check or substring of a filename
(e.g. a glottocode)
optional arguments:
-h, --help show this help message and exit
--columns List columns of the sheet (default: False)
API
pygrambank
also allows programmatic access to Grambank data from Python
programs. All functionality is mediated through a pygrambank.Grambank
instance:
>>> from pygrambank import Grambank
>>> gb = Grambank('.')
>>> gb.sheets_dir
PosixPath('original_sheets')
>>> for sheet in gb.iter_sheets():
... print(sheet)
... break
...
original_sheets/AH_alag1248.tsv
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
Built Distribution
Hashes for pygrambank-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e95f9428e0dc0c06229f339ca8f031610430b0cc881ccd480499311380b619a |
|
MD5 | 22525ca7d0df2d9123ad8041bf44f955 |
|
BLAKE2b-256 | 868ddbcd12e4523244a8086f0444d0ebd2f5d5316b2f8b23a822d24dcae82b8a |