Spanish Verb Conjugator
A lightweight Python library for conjugating Spanish verbs across a comprehensive range of tenses and moods. This tool is designed for developers, language learners, and anyone in need of a quick and reliable way to get Spanish verb conjugations.
Features
- Wide Tense Coverage: Supports indicative, subjunctive, and imperative moods, including simple and perfect tenses.
- Irregular Verbs: Includes a built-in list of common irregular verbs and their special conjugations.
- Vosotros Support: Provides conjugations for the
vosotros/vosotraspronoun, commonly used in Spain. This can be disabled for a Latin American Spanish focus. - Easy to Use: A simple and intuitive API for getting the conjugations you need.
Installation
You can install the library using pip:
pip install spanish-conjugator
Usage
The library is easy to use. Simply import the Conjugator, Tense, and Pronoun classes, and you're ready to start conjugating.
Basic Example
Here's how to get a specific conjugation for a verb:
from spanish_conjugator import Conjugator, Tense, Pronoun
# Initialize the conjugator
conjugator = Conjugator()
# Get the 'yo' form of 'hablar' in the present tense
verb = "hablar"
tense = Tense.PRESENT
pronoun = Pronoun.YO
conjugation = conjugator.get_specific_conjugation(verb, tense, pronoun)
print(f"The conjugation of '{verb}' for '{pronoun.value}' in the {tense.value} tense is: {conjugation}")
# Output: The conjugation of 'hablar' for 'yo' in the present tense is: hablo
Getting All Conjugations for a Tense
You can also get all pronoun conjugations for a specific tense:
# Get all present tense conjugations for 'comer'
conjugations = conjugator.get_tense_conjugations("comer", Tense.PRESENT)
for pronoun, form in conjugations.items():
print(f"{pronoun}: {form}")
Getting All Conjugations for a Verb
To get a complete dictionary of all supported tenses for a verb:
all_conjugations = conjugator.get_all_conjugations("vivir")
# Print the future tense conjugations
future_tense = all_conjugations.get(Tense.FUTURE)
if future_tense:
for pronoun, form in future_tense.items():
print(f"{pronoun}: {form}")
Disabling 'Vosotros'
If you want to exclude the vosotros/vosotras pronoun, initialize the Conjugator with use_vosotros=False:
# Conjugator for Latin American Spanish (without vosotros)
la_conjugator = Conjugator(use_vosotros=False)
conjugations = la_conjugator.get_tense_conjugations("ser", Tense.PRESENT)
print("vosotros/vosotras" in conjugations)
# Output: False
Supported Tenses
The library supports the following tenses:
- Indicative: Present, Preterite, Imperfect, Conditional, Future, Present Perfect, Pluperfect, Conditional Perfect, Future Perfect
- Subjunctive: Present, Imperfect, Present Perfect, Pluperfect
- Imperative: Affirmative
Supported Irregular Verbs
A list of common irregular verbs is included. Some examples are:
acertaragradecerapareceratraerdecirhacerirolerpedirperderpoderponerreirsersonreirtenervolarvolver
And many more.
Metadata
Release files for my-personal-spanish-conjugation-generator 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| my_personal_spanish_conjugation_generator-0.1.1.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| my_personal_spanish_conjugation_generator-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.1 kB
Release files / my_personal_spanish_conjugation_generator-0.1.1.tar.gz
| Download URL | my_personal_spanish_conjugation_generator-0.1.1.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6213e0faa7efe645f954f130282b749732616fb356bbc0cef9025c41ba6f2b9
|
|
BLAKE2b-256 checksum How to use checksums |
bfd149468e3f295ad355197f05fce4386290f803361797df7f5d933649b5e2ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / my_personal_spanish_conjugation_generator-0.1.1-py3-none-any.whl
| Download URL | my_personal_spanish_conjugation_generator-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7dcbcbb1b385936a7b085616ae2436b57008d3186a8ee8ec942ec9757611025a
|
|
BLAKE2b-256 checksum How to use checksums |
c22c0c7fdedc27981f50a158ef2e4157e91035816ae7830e0c93bef7cb334a03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|