# Sastadev
[![Actions Status](https://github.com/UUDigitalHumanitieslab/sastadev/workflows/Unit%20tests/badge.svg)](https://github.com/UUDigitalHumanitieslab/sastadev/actions)
[pypi sastadev](https://pypi.org/project/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
```python
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**):
```python
from sastadev.conf import settings
def get_dataroot():
print(settings.DATAROOT)
```
Example 2 (**wrong!**):
```python
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](https://docs.pytest.org/).
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](https://flake8.pycqa.org/en/latest/).
To lint, run:
```
flake8 ./src/sastadev/
```
### Upload to PyPi
Specify the files which should be included in the package in `pypi/include.txt`.
```bash
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
Raw data
{
"_id": null,
"home_page": "https://github.com/UUDigitalHumanitieslab/sastadev",
"name": "sastadev",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Research Software Lab - Centre for Digital Humanities - Utrecht University",
"author_email": "digitalhumanities@uu.nl",
"download_url": "https://files.pythonhosted.org/packages/79/ca/73fae0eebcb5c3c558fb59413162c5f9b0685e948d89406d0e69697417ea/sastadev-0.1.5.tar.gz",
"platform": null,
"description": "# Sastadev\n\n[![Actions Status](https://github.com/UUDigitalHumanitieslab/sastadev/workflows/Unit%20tests/badge.svg)](https://github.com/UUDigitalHumanitieslab/sastadev/actions)\n\n[pypi sastadev](https://pypi.org/project/sastadev)\n\nMethod definitions for use in SASTA\n\n## Installation\nYou can install SASTADEV using pip:\n```\npip install sastadev\n```\n\n## Usage\n\n### Command line interface\nThe installation provides an entrypoint `sastadev` which invokes `sastadev.__main__.main()`\n\nTo lists arguments and options:\n\n```\nsastadev -h\n```\nor\n```\npython -m sastadev -h\n```\n\n### Using as a library\n```python\nfrom sastadev.deregularise import correctinflection\nresult = correctinflection('slaapten')\nprint(result)\n# [('sliepen', 'Overgeneralisation')]\n```\n\n## Configuration\nThe package contains a configuration module `sastadev.conf` that produces a `SastadevConfig` object at runtime, called `settings`.\n\n### Using settings values\nExample 1 (**correct**): \n```python\nfrom sastadev.conf import settings\ndef get_dataroot():\n print(settings.DATAROOT)\n```\n\nExample 2 (**wrong!**):\n```python\nfrom sastadev.conf import settings\n\ndataroot = settings.DATAROOT\n\ndef get_dataroot():\n print(dataroot)\n```\n\nThe 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.\n\n\n### Changing settings\n`sastadev.conf.settings` can be changed at runtime. \n> :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. \n\n## Development\nTo install the requirements:\n```\npip install -r requirements.txt\n```\n\n### Installing locally\nTo install the package in editable state:\n```\npip install -e .\n```\n\n### Testing\nTests should be written and run using [pytest](https://docs.pytest.org/).\nTo test, make sure the package is installed in editable mode.\nThen, each time you wish to run the tests:\n```\npytest\n```\n\n### Linting\nLinting configuration is provided for [flake8](https://flake8.pycqa.org/en/latest/).\nTo lint, run:\n```\nflake8 ./src/sastadev/\n```\n\n### Upload to PyPi\n\nSpecify the files which should be included in the package in `pypi/include.txt`.\n\n```bash\npip install twine\npython setup.py sdist\ntwine upload dist/*.tar.gz\n```\n\n## Contributing\nEnhancements, bugfixes, and new features are welcome. For major changes, please follow these steps:\n\n- open an issue to discuss what you would like to change\n- create a branch `feature/<your-branchname`>, based on `develop` that contains your changes \n- ensure the code is well tested\n- create a pull request for merging the changes into `develop`\n- the maintainers will take care of reviewing the code, offering suggested changes, and merging the code\n- at the discretion of the maintainers, the `develop` branch will be merged into `master`, and a new release will be made\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Linguistic functions for SASTA tool",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/UUDigitalHumanitieslab/sastadev"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "79ca73fae0eebcb5c3c558fb59413162c5f9b0685e948d89406d0e69697417ea",
"md5": "29d03d11b47fa72bc61eb896be8ec8b5",
"sha256": "595eb902e2bceb286700e210dea23ca0a7467b4ea459291674ac62f9a3aee6da"
},
"downloads": -1,
"filename": "sastadev-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "29d03d11b47fa72bc61eb896be8ec8b5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.7",
"size": 8947594,
"upload_time": "2024-04-24T11:03:57",
"upload_time_iso_8601": "2024-04-24T11:03:57.471629Z",
"url": "https://files.pythonhosted.org/packages/79/ca/73fae0eebcb5c3c558fb59413162c5f9b0685e948d89406d0e69697417ea/sastadev-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-24 11:03:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "UUDigitalHumanitieslab",
"github_project": "sastadev",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "sastadev"
}