sastadev


Namesastadev JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttps://github.com/UUDigitalHumanitieslab/sastadev
SummaryLinguistic functions for SASTA tool
upload_time2024-12-03 09:03:29
maintainerNone
docs_urlNone
authorResearch Software Lab - Centre for Digital Humanities - Utrecht University
requires_python<4,>=3.7
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements attrs auchann chamd editdistance et-xmlfile flake8 iniconfig lxml mccabe mypy mypy-extensions openpyxl packaging pluggy py pycodestyle pyflakes pyparsing pytest pyyaml pyyaml-include sastadev toml tomli typing-extensions xlsxwriter
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/de/7a/4494d90f707d7a44dc649405fbe7bbecd8dc548fa76740c0251285a46abb/sastadev-0.2.4.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.2.4",
    "project_urls": {
        "Homepage": "https://github.com/UUDigitalHumanitieslab/sastadev"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de7a4494d90f707d7a44dc649405fbe7bbecd8dc548fa76740c0251285a46abb",
                "md5": "5b2f0d8ee7aa57faffd569df672de43c",
                "sha256": "c6eadf5d09751cb07298328c6828a426e60ac180dfb337732bd04988da48e061"
            },
            "downloads": -1,
            "filename": "sastadev-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5b2f0d8ee7aa57faffd569df672de43c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 9012100,
            "upload_time": "2024-12-03T09:03:29",
            "upload_time_iso_8601": "2024-12-03T09:03:29.861966Z",
            "url": "https://files.pythonhosted.org/packages/de/7a/4494d90f707d7a44dc649405fbe7bbecd8dc548fa76740c0251285a46abb/sastadev-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-03 09:03:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "UUDigitalHumanitieslab",
    "github_project": "sastadev",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "21.2.0"
                ]
            ]
        },
        {
            "name": "auchann",
            "specs": [
                [
                    "==",
                    "0.1.1"
                ]
            ]
        },
        {
            "name": "chamd",
            "specs": [
                [
                    "==",
                    "0.5.8"
                ]
            ]
        },
        {
            "name": "editdistance",
            "specs": [
                [
                    "==",
                    "0.6.2"
                ]
            ]
        },
        {
            "name": "et-xmlfile",
            "specs": [
                [
                    "==",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "flake8",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    "==",
                    "4.6.4"
                ]
            ]
        },
        {
            "name": "mccabe",
            "specs": [
                [
                    "==",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "mypy",
            "specs": [
                [
                    "==",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "mypy-extensions",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "openpyxl",
            "specs": [
                [
                    "==",
                    "3.0.9"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "21.3"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "py",
            "specs": [
                [
                    "==",
                    "1.11.0"
                ]
            ]
        },
        {
            "name": "pycodestyle",
            "specs": [
                [
                    "==",
                    "2.10.0"
                ]
            ]
        },
        {
            "name": "pyflakes",
            "specs": [
                [
                    "==",
                    "3.0.1"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "3.0.6"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "6.2.5"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0"
                ]
            ]
        },
        {
            "name": "pyyaml-include",
            "specs": [
                [
                    "==",
                    "1.3"
                ]
            ]
        },
        {
            "name": "sastadev",
            "specs": [
                [
                    "==",
                    "0.0.3"
                ]
            ]
        },
        {
            "name": "toml",
            "specs": [
                [
                    "==",
                    "0.10.2"
                ]
            ]
        },
        {
            "name": "tomli",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.6.3"
                ]
            ]
        },
        {
            "name": "xlsxwriter",
            "specs": [
                [
                    "==",
                    "3.0.2"
                ]
            ]
        }
    ],
    "lcname": "sastadev"
}
        
Elapsed time: 0.38769s