spanishconjugator


Namespanishconjugator JSON
Version 2.3.2025 PyPI version JSON
download
home_pagehttps://github.com/Benedict-Carling/spanish-conjugator
SummaryA python library to conjugate spanish words with parameters tense, mood and pronoun
upload_time2022-05-21 20:29:08
maintainer
docs_urlNone
authorBenedict Carling
requires_python
license
keywords
VCS
bugtrack_url
requirements attrs iniconfig packaging pluggy py pyparsing pytest toml wheel
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Spanish Conjugator 🇪🇸
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Imperial-iGEM/DJANGO-Assembly-Methods/Django%20CI)
![GitHub repo size](https://img.shields.io/github/repo-size/Benedict-Carling/spanish-conjugator)
![PyPI - Downloads](https://img.shields.io/pypi/dm/spanishconjugator)
![GitHub top language](https://img.shields.io/github/languages/top/Benedict-Carling/spanish-conjugator)
![GitHub](https://img.shields.io/github/license/Benedict-Carling/spanish-conjugator)
![PyPI](https://img.shields.io/pypi/v/spanishconjugator)


A class Conjugator containing a function conjugate which conjugates spanish verbs by tense, mood and pronoun. 

## Installation
`pip install spanishconjugator`

## Example usage
Example python usage; the `conjugate` function of the `Conjugator` Class takes 4 parameters being root-verb, tense, mood, pronoun respectively

```python
from spanishconjugator import Conjugator
imperfect_conjugation = Conjugator().conjugate('hablar','imperfect','indicative','yo')
print(imperfect_conjugation)
>>> hablaba
```
## Tenses, Moods and Pronouns implemented

All pronouns are implemented
```yo, tu, usted, nosotros, vosotros, ustedes```

All moods currently implemented are
```indicative, conditional```

All tenses currently implemented are
```present, imperfect, preterite, future, present_perfect, past_anterior, future_perfect, conditional_simple```

Exaple usage of different moods/tenses with hablar and yo

### Indicative Present

```python
Conjugator().conjugate('hablar','present','indicative','yo')
>>> hablo
```

In case of indicative present, 4th param pronoun is optional.
```python
from spanishconjugator import Conjugator
present_indicative_conjugation = Conjugator().conjugate('hablar','present','indicative')
print(present_indicative_conjugation)
>>> {'el/ella/usted': 'habla', 'ellos/ellas/ustedes': 'hablan', 'tu': 'hablas', 'vosotros': 'habláis', 'yo': 'hablo', 'nosotros': 'hablamos'}
```

### Indicative Imperfect

```python
Conjugator().conjugate('hablar','imperfect','indicative','yo')
>>> hablaba
```
### Indicative Preterite

```python
Conjugator().conjugate('hablar','preterite','indicative','yo')
>>> hablé
```
### Indicative Future

```python
Conjugator().conjugate('hablar','future','indicative','yo')
>>> hablaré
```
### Indicative Present_Perfect

```python
Conjugator().conjugate('hablar','present_perfect','indicative','yo')
>>> he hablado
```
### Indicative Past_Anterior

```python
Conjugator().conjugate('hablar','past_anterior','indicative','yo')
>>> hube hablado
```
### Indicative Future_Perfect

```python
Conjugator().conjugate('hablar','future_perfect','indicative','yo')
>>> habré hablado
```
### Conditional Simple

```python
Conjugator().conjugate('hablar','simple_conditional','conditional','yo')
>>> hablaría
```
### Conditional Perfect

```python
Conjugator().conjugate('hablar','perfect','conditional','yo')
>>> habría hablado
```
### Imperative Afferative

```python
Conjugator().conjugate('hablar','affirmative','imperative','tu')
>>> habla
```
### Imperative Negative

```python
Conjugator().conjugate('hablar','negative','imperative','tu')
>>> hables
```
### Subjunctive Present

```python
Conjugator().conjugate('hablar','present','subjunctive','yo')
>>> hable
```
### Subjunctive Imperfect

```python
Conjugator().conjugate('hablar','imperfect','subjunctive','yo')
>>> hablara
```
### Subjunctive Imperfect_se

```python
Conjugator().conjugate('hablar','imperfect_se','subjunctive','yo')
>>> hablase
```
### Subjunctive Future

```python
Conjugator().conjugate('hablar','future','subjunctive','yo')
>>> hablare
```

## Developing
if you would like to help develop spanishconjugator, follow succeeding code

Whilst in command line create a folder in which you would like to work (name only reccommended)

`$ mkdir spanish_conjugator_enviroment`

change directory into the enviroment you have just made

`$ cd spanish_conjugator_enviroment`

install virtualenv

`$ pip install virtualenv`

create a virtual enviroment from path of python3

`$ virtualenv -p $(which python3) my_venv`

activate virtual enviroment

`$ source my_venv/bin/activate`

> tip: once you want to disactivate your virtual enviroment simply run `$ deactivate`

Clone Spanish-Conjugator

`$ git clone https://github.com/Benedict-Carling/spanish-conjugator.git`

Install developer dependencies for unit test e.g pytest and for other library tools

`pip install -e .[dev]`

## Developing - Testing

We have chosen to use the library pytest for our unit test
At this point in the developing guide you can check the code works by running it against out current unit tests located in the `/tests` folder

`$ pytest`

output should show the different tenses implemented should pass their unit tests as below.(27/08/2020)
![alt text](https://github.com/Benedict-Carling/spanish-conjugator/blob/master/images/pytest.png?raw=true)

## Developing - Submission

To submit code to this repositry please fork and submit a pull request 🚀

# Alternative Versions
Check out the Javascript npm version of the library if you are working in a node or browser enviroment

https://github.com/Benedict-Carling/spanish-conjugatorjs



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Benedict-Carling/spanish-conjugator",
    "name": "spanishconjugator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Benedict Carling",
    "author_email": "bencarling1@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e8/53/0b0e0094bf5726cc3c6c868dda68cce7294b4454c9821a77481362214fdc/spanishconjugator-2.3.2025.tar.gz",
    "platform": null,
    "description": "# Spanish Conjugator \ud83c\uddea\ud83c\uddf8\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Imperial-iGEM/DJANGO-Assembly-Methods/Django%20CI)\n![GitHub repo size](https://img.shields.io/github/repo-size/Benedict-Carling/spanish-conjugator)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/spanishconjugator)\n![GitHub top language](https://img.shields.io/github/languages/top/Benedict-Carling/spanish-conjugator)\n![GitHub](https://img.shields.io/github/license/Benedict-Carling/spanish-conjugator)\n![PyPI](https://img.shields.io/pypi/v/spanishconjugator)\n\n\nA class Conjugator containing a function conjugate which conjugates spanish verbs by tense, mood and pronoun. \n\n## Installation\n`pip install spanishconjugator`\n\n## Example usage\nExample python usage; the `conjugate` function of the `Conjugator` Class takes 4 parameters being root-verb, tense, mood, pronoun respectively\n\n```python\nfrom spanishconjugator import Conjugator\nimperfect_conjugation = Conjugator().conjugate('hablar','imperfect','indicative','yo')\nprint(imperfect_conjugation)\n>>> hablaba\n```\n## Tenses, Moods and Pronouns implemented\n\nAll pronouns are implemented\n```yo, tu, usted, nosotros, vosotros, ustedes```\n\nAll moods currently implemented are\n```indicative, conditional```\n\nAll tenses currently implemented are\n```present, imperfect, preterite, future, present_perfect, past_anterior, future_perfect, conditional_simple```\n\nExaple usage of different moods/tenses with hablar and yo\n\n### Indicative Present\n\n```python\nConjugator().conjugate('hablar','present','indicative','yo')\n>>> hablo\n```\n\nIn case of indicative present, 4th param pronoun is optional.\n```python\nfrom spanishconjugator import Conjugator\npresent_indicative_conjugation = Conjugator().conjugate('hablar','present','indicative')\nprint(present_indicative_conjugation)\n>>> {'el/ella/usted': 'habla', 'ellos/ellas/ustedes': 'hablan', 'tu': 'hablas', 'vosotros': 'habl\u00c3\u00a1is', 'yo': 'hablo', 'nosotros': 'hablamos'}\n```\n\n### Indicative Imperfect\n\n```python\nConjugator().conjugate('hablar','imperfect','indicative','yo')\n>>> hablaba\n```\n### Indicative Preterite\n\n```python\nConjugator().conjugate('hablar','preterite','indicative','yo')\n>>> habl\u00e9\n```\n### Indicative Future\n\n```python\nConjugator().conjugate('hablar','future','indicative','yo')\n>>> hablar\u00e9\n```\n### Indicative Present_Perfect\n\n```python\nConjugator().conjugate('hablar','present_perfect','indicative','yo')\n>>> he hablado\n```\n### Indicative Past_Anterior\n\n```python\nConjugator().conjugate('hablar','past_anterior','indicative','yo')\n>>> hube hablado\n```\n### Indicative Future_Perfect\n\n```python\nConjugator().conjugate('hablar','future_perfect','indicative','yo')\n>>> habr\u00e9 hablado\n```\n### Conditional Simple\n\n```python\nConjugator().conjugate('hablar','simple_conditional','conditional','yo')\n>>> hablar\u00eda\n```\n### Conditional Perfect\n\n```python\nConjugator().conjugate('hablar','perfect','conditional','yo')\n>>> habr\u00eda hablado\n```\n### Imperative Afferative\n\n```python\nConjugator().conjugate('hablar','affirmative','imperative','tu')\n>>> habla\n```\n### Imperative Negative\n\n```python\nConjugator().conjugate('hablar','negative','imperative','tu')\n>>> hables\n```\n### Subjunctive Present\n\n```python\nConjugator().conjugate('hablar','present','subjunctive','yo')\n>>> hable\n```\n### Subjunctive Imperfect\n\n```python\nConjugator().conjugate('hablar','imperfect','subjunctive','yo')\n>>> hablara\n```\n### Subjunctive Imperfect_se\n\n```python\nConjugator().conjugate('hablar','imperfect_se','subjunctive','yo')\n>>> hablase\n```\n### Subjunctive Future\n\n```python\nConjugator().conjugate('hablar','future','subjunctive','yo')\n>>> hablare\n```\n\n## Developing\nif you would like to help develop spanishconjugator, follow succeeding code\n\nWhilst in command line create a folder in which you would like to work (name only reccommended)\n\n`$ mkdir spanish_conjugator_enviroment`\n\nchange directory into the enviroment you have just made\n\n`$ cd spanish_conjugator_enviroment`\n\ninstall virtualenv\n\n`$ pip install virtualenv`\n\ncreate a virtual enviroment from path of python3\n\n`$ virtualenv -p $(which python3) my_venv`\n\nactivate virtual enviroment\n\n`$ source my_venv/bin/activate`\n\n> tip: once you want to disactivate your virtual enviroment simply run `$ deactivate`\n\nClone Spanish-Conjugator\n\n`$ git clone https://github.com/Benedict-Carling/spanish-conjugator.git`\n\nInstall developer dependencies for unit test e.g pytest and for other library tools\n\n`pip install -e .[dev]`\n\n## Developing - Testing\n\nWe have chosen to use the library pytest for our unit test\nAt this point in the developing guide you can check the code works by running it against out current unit tests located in the `/tests` folder\n\n`$ pytest`\n\noutput should show the different tenses implemented should pass their unit tests as below.(27/08/2020)\n![alt text](https://github.com/Benedict-Carling/spanish-conjugator/blob/master/images/pytest.png?raw=true)\n\n## Developing - Submission\n\nTo submit code to this repositry please fork and submit a pull request \ud83d\ude80\n\n# Alternative Versions\nCheck out the Javascript npm version of the library if you are working in a node or browser enviroment\n\nhttps://github.com/Benedict-Carling/spanish-conjugatorjs\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A python library to conjugate spanish words with parameters tense, mood and pronoun",
    "version": "2.3.2025",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "6dc1afbc4df96cd26c001265d137f4ac",
                "sha256": "0b731d535693f0c30a0bff441d54ad793b998444f80a62798e7b7f2979abbd4a"
            },
            "downloads": -1,
            "filename": "spanishconjugator-2.3.2025-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6dc1afbc4df96cd26c001265d137f4ac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19899,
            "upload_time": "2022-05-21T20:29:06",
            "upload_time_iso_8601": "2022-05-21T20:29:06.113535Z",
            "url": "https://files.pythonhosted.org/packages/16/a2/791fe7cbcb2dc6576ed3fd83e761fae8499302707a7c5e379cd918cb310c/spanishconjugator-2.3.2025-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "369b5499e8b1ce576e3c51e846c112ad",
                "sha256": "dc8fff046c91d68db955b549139a1be20c01b82d62777a8269ac813434d2b66a"
            },
            "downloads": -1,
            "filename": "spanishconjugator-2.3.2025.tar.gz",
            "has_sig": false,
            "md5_digest": "369b5499e8b1ce576e3c51e846c112ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12974,
            "upload_time": "2022-05-21T20:29:08",
            "upload_time_iso_8601": "2022-05-21T20:29:08.191254Z",
            "url": "https://files.pythonhosted.org/packages/e8/53/0b0e0094bf5726cc3c6c868dda68cce7294b4454c9821a77481362214fdc/spanishconjugator-2.3.2025.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-21 20:29:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Benedict-Carling",
    "github_project": "spanish-conjugator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "21.2.0"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "21.0"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "py",
            "specs": [
                [
                    "==",
                    "1.10.0"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "2.4.7"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "6.2.5"
                ]
            ]
        },
        {
            "name": "toml",
            "specs": [
                [
                    "==",
                    "0.10.2"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.37.0"
                ]
            ]
        }
    ],
    "lcname": "spanishconjugator"
}
        
Elapsed time: 0.34309s