Skip to main content

Linguistic functions for SASTA tool

Project description

Sastadev

Actions Status

PyPi/sastadev

Method definitions for use in SASTA

Installation

You can install SASTADEV using pip:

pip install sastadev

Usage

Command line interface

The installation provides an entrypoint sastadev which invokes sastadev.__main__.main()

To lists arguments and options:

sastadev -h

or

python -m sastadev -h

Using as a library

from sastadev.deregularise import correctinflection
result = correctinflection('slaapten')
print(result)
# [('sliepen', 'Overgeneralisation')]

Configuration

The package contains a configuration module sastadev.conf that produces a SastadevConfig object at runtime, called settings.

Using settings values

Example 1 (correct):

from sastadev.conf import settings
def get_dataroot():
    print(settings.DATAROOT)

Example 2 (wrong!):

from sastadev.conf import settings

dataroot = settings.DATAROOT

def get_dataroot():
    print(dataroot)

The key difference is that the code in example 2 evaluates settings.DATAROOT at the moment the code is executed. If settings.DATAROOT changes between the first time the module is loaded and the time it is ran, the first value will be used. This disables configurable settings.

Changing settings

sastadev.conf.settings can be changed at runtime.

:warning: Changing settings properties changes all code that is executed after the change. Therefore, make sure you set the settings once, and at the beginning of the runtime cycle.

Development

To install the requirements:

pip install -r requirements.txt

Installing locally

To install the package in editable state:

pip install -e .

Testing

Tests should be written and run using pytest. To test, make sure the package is installed in editable mode. Then, each time you wish to run the tests:

pytest

Linting

Linting configuration is provided for flake8. To lint, run:

flake8 ./src/sastadev/

Upload to PyPi

Specify the files which should be included in the package in pypi/include.txt.

pip install twine
python setup.py sdist
twine upload dist/*.tar.gz

Contributing

Enhancements, bugfixes, and new features are welcome. For major changes, please follow these steps:

  • open an issue to discuss what you would like to change
  • create a branch feature/<your-branchname>, based on develop that contains your changes
  • ensure the code is well tested
  • create a pull request for merging the changes into develop
  • the maintainers will take care of reviewing the code, offering suggested changes, and merging the code
  • at the discretion of the maintainers, the develop branch will be merged into master, and a new release will be made

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

sastadev-0.3.1.tar.gz (11.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sastadev-0.3.1-py3-none-any.whl (11.7 MB view details)

Uploaded Python 3

File details

Details for the file sastadev-0.3.1.tar.gz.

File metadata

  • Download URL: sastadev-0.3.1.tar.gz
  • Upload date:
  • Size: 11.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sastadev-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ec133adfbdf00ce200e39236434c447d2c2ea2fc6ad095dd2c9e9d6b7ae6b39e
MD5 62e44b53a72e517b8548c934dc397162
BLAKE2b-256 9481f62af87db2690983f2b18eae11987e85b3fc05caa9f7a462402f44071abe

See more details on using hashes here.

Provenance

The following attestation bundles were made for sastadev-0.3.1.tar.gz:

Publisher: release.yml on UUDigitalHumanitieslab/sastadev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sastadev-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: sastadev-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sastadev-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d25ca9144762f5a6a3d2d7081a300d80d19ccfd88595fca98a1f6b233204986e
MD5 385cbe59b94c0bbc8940b63d714e89d1
BLAKE2b-256 1e89ba44e54167303b911892eedffe2ac1cf5c2a6c748c34a5544d52f28e0993

See more details on using hashes here.

Provenance

The following attestation bundles were made for sastadev-0.3.1-py3-none-any.whl:

Publisher: release.yml on UUDigitalHumanitieslab/sastadev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page