Python code for working with the data of the DFG-funded SPP Computational Literary Studies.
- sppcls.py: the sppcls Python
module to access the data:
- blocking:
from sppcls import sppcls df = sppcls.load_df(work="judenbuche", projects=["keypassages"]) print(df.describe())
- non blocking:
from sppcls import sppcls df = await sppcls.load_df_async(work="judenbuche", projects=["keypassages"]) print(df.describe())
Installation
PyPI
pip install sppcls
or with spacy
pip install sppcls[spacy]
From source
Setup an virtual environment, if necessary:
python3 -m venv env
source env/bin/activate
Install dependencies:
pip install -r requirements.txt
Note
For tokenization, the spacy model is required:
python -m spacy download de_core_news_lg
Usage
The package offers a command line interface, either by using the command sppcls after installing using PyPI
or python -m sppcls.cli.sppclscli when running from source.
usage: sppclscli.py [-h] {tokenise,check} ...
Accessing and processing data from the DFG-funded SPP Computational Literary
Studies
positional arguments:
{tokenise,check}
tokenise Tokenize text file and create output tsv.
check Compare two tsv files and check that the structures
matches.
optional arguments:
-h, --help show this help message and exit
tokenise
Tokenise takes a txt file, e.g. work.txt,
and produces a tsv file containing the tokenized text, e.g. work.tsv.
This base tsv file is then extended by the individual projects.
usage: sppclscli.py tokenise [-h] input_file output_folder
Tokenize text file and create output tsv.
positional arguments:
input_file Path to the input txt file.
output_folder Path to the output folder where the output tsv will be saved.
optional arguments:
-h, --help show this help message and exit
TODO: fix character offset to be byte instead
check
check.py takes two tsv files, e.g. work.tsv
and keypassages.tsv,
and makes sure that the project tsv file matches the structure of the base work tsv file.
usage: sppclscli.py check [-h] org-tokens-file-path project-tokens-file-path
Compare two tsv files and check that the structures matches.
positional arguments:
org-tokens-file-path Path to the original tokens tsv file
project-tokens-file-path
Path to the project tokens tsv file
optional arguments:
-h, --help show this help message and exit
Metadata
Release files for sppcls 0.1.0
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 |
|---|---|---|---|---|
| sppcls-0.1.0.tar.gz | 10.1 kB | Without provenance | Details for sppcls-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sppcls-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for sppcls-0.1.0-py3-none-any.whl |
Total release size: 20.9 kB
Release files / sppcls-0.1.0.tar.gz
| Download URL | sppcls-0.1.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddff616cc6d93bf2ceb3a85b67a45409569e94935eaa2e929696d1f66df9a2c0
|
|
BLAKE2b-256 checksum How to use checksums |
7797ea9a6a68c0ca8959551531d78e44fd2fb025643213bf41c111220460ac1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.16
|
Release files / sppcls-0.1.0-py3-none-any.whl
| Download URL | sppcls-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7d9c31ded91ce5db34bc1208a074061c2008716a070a6543066b5f770ea9e6f
|
|
BLAKE2b-256 checksum How to use checksums |
a500579696f802701ac08d14bf9b762ab38f08c6d65f5d81a412f598535fd707
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.16
|
Security for sppcls 0.1.0
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.