pip install vallex-tools
Features
MIT licensed
parses lexicon data in txt and json formats
provides a cli for working with the data (searching, printing histogram, converting between txt/json, running data tests)
infrastructure to run data tests
Qt(WebEngine) based ui (searching, simple editing)
web based interface (searching)
Example Use
from vallex import LexiconCollection, add_file_to_collection
from vallex.grep import parse_pattern, filter_db
# Create a collection of lexicons
coll = LexiconCollection()
# Load a lexicon and add it to the collections
add_file_to_collection(coll, open('v-vallex.txt', 'r', encoding='utf-8'))
# Filter the collection looking for lexical units which have ACT in their frame
pat = parse_pattern('frame.functor=ACT')
coll = filter_db(coll, pat)
# Print out the frame attribute of each lexical unit in the filtered
# collection
for lu in coll.lexical_units:
print(lu.frame)
It also includes a cli interface:
$ vallex-cli -i v-vallex.txt --filter frame,lemma,refl -- grep frame.functor=ACT
...
* ŽRÁT SE
: id: blu-v-žrát-se-1
~ impf: žrát se
+ ACT(1;obl)CAUS(7,pro+4;typ)
#
# END ========== ../data-txt/v-vallex.txt ========== END
$ vallex-cli -i v-vallex.json --histogram frame.functor -- grep frame.functor=ACT
...
NTT (186/17819)
DPHR * (286/17819)
DIR1 * (286/17819)
MANN * (325/17819)
ORIG * (382/17819)
DIR ** (484/17819)
EFF *** (601/17819)
LOC *** (606/17819)
DIR3 *** (610/17819)
BEN *** (637/17819)
ADDR *** (731/17819)
MEANS **** (809/17819)
PAT ************************ (4836/17819)
ACT ******************************* (6176/17819)
Installing the command-line tools
Unix
We suggest using the pipx or pipsi script installers:
$ python3 -m pip install --user pipx
$ python3 -m pipx ensurepath
$ pipx install vallex-tools
Alternatively, just create a Python3 virtualenv and run vallex-tools from there:
$ python3 -m virtualenv -p `which python3` venv
$ . venv/bin/activate
(venv) $ pip install vallex-tools
Assuming you used pipx to install vallex-tools, you can get bash command completion for vallex-cli, by putting the following line into your .bashrc or .bash_profile:
eval $(pipx run vallex-cli completion)
(For pipsi, replace pipx with pipsi. For the virtualenv, you need to first activate the virtualenv, then run the eval with just vallex-cli instead of pipx, and then deactivate the environment again).
Windows
Run the install-win.ps1 script in a PowerShell prompt. This script will download and install a Python interpretter into C:\vallex-tools and the it will use it to install the vallex-tools package. Finally, it will put a shortcut to run the vallex-gui on the desktop. Using this method, all configuration & logs will live in the C:\vallex-tools directory. To change this directory, you can edit the script and change the definition of the $install_path variable.
Contributing
Please see Developer documentation for documentation describing how to set-up your environment for working on vallex-tools.
Metadata
Release files for vallex-tools 0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vallex-tools-0.12.tar.gz | 3.2 MB | Without provenance | Details for vallex-tools-0.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vallex_tools-0.12-py3-none-any.whl | Python 3 | none | any | Details for vallex_tools-0.12-py3-none-any.whl |
Total release size: 6.4 MB
Release files / vallex-tools-0.12.tar.gz
| Download URL | vallex-tools-0.12.tar.gz |
|---|---|
| Size | 3.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1726f7ee799aa45d1e382f21e8dc51256715ea27848596c4d2b9ea870e21cde5
|
|
BLAKE2b-256 checksum How to use checksums |
3ac564768c1338778109ec2f1ca3f06f09c10220bf1ddd7b5bed7c7f890c098b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8
|
Release files / vallex_tools-0.12-py3-none-any.whl
| Download URL | vallex_tools-0.12-py3-none-any.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa1623ea340749de5aeea6f1097b8a11d7a0534bfa12ce6d55444b5e84263395
|
|
BLAKE2b-256 checksum How to use checksums |
c439c9872f7863864e4ceb8eac3d90a15ad11aafb22b77eb325cfa99fa17b1cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8
|
Security for vallex-tools 0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.