Skip to main content

Spanish conjugation generator

Project description

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/vosotras pronoun, 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:

  • acertar
  • agradecer
  • aparecer
  • atraer
  • decir
  • hacer
  • ir
  • oler
  • pedir
  • perder
  • poder
  • poner
  • reir
  • ser
  • sonreir
  • tener
  • volar
  • volver

And many more.

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

Built Distribution

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

File details

Details for the file my_personal_spanish_conjugation_generator-0.1.1.tar.gz.

File metadata

File hashes

Hashes for my_personal_spanish_conjugation_generator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a6213e0faa7efe645f954f130282b749732616fb356bbc0cef9025c41ba6f2b9
MD5 4a7e06f04f27b15f34af795f4e9f5919
BLAKE2b-256 bfd149468e3f295ad355197f05fce4386290f803361797df7f5d933649b5e2ec

See more details on using hashes here.

File details

Details for the file my_personal_spanish_conjugation_generator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for my_personal_spanish_conjugation_generator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7dcbcbb1b385936a7b085616ae2436b57008d3186a8ee8ec942ec9757611025a
MD5 95b3201aff5dd9e598e368ca06f89505
BLAKE2b-256 c22c0c7fdedc27981f50a158ef2e4157e91035816ae7830e0c93bef7cb334a03

See more details on using hashes here.

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