Skip to main content

No project description provided

Project description

FlashCardGenerator

FlashCardGenerator is a Python library for creating customizable flashcards in PDF format. It's designed to be easy to use while offering flexibility in flashcard design and layout.

Features

  • Create double-sided flashcards with customizable content
  • Support for additional information on the front of the card
  • Markdown-style formatting (bold, italic, underline)
  • Configurable card layout (size, number per row, etc.)
  • PDF output for easy printing and sharing

Installation

To install FlashCardGenerator, run the following command:

pip install flashcard-generator

Quick Start

Here's a simple example to get you started:

from flashcard_generator import FlashCardGenerator

generator = FlashCardGenerator()
generator.set_filename("my_flashcards.pdf") \
         .add_entry("Bonjour", "Hello", "Casual greeting") \
         .add_entry("Merci", "Thank you", "**Important** phrase") \
         .add_entry("Au revoir", "Goodbye", "*Formal* farewell") \
         .generate()

This will create a PDF file named "my_flashcards.pdf" with three flashcards.

API Usage

Creating a FlashCardGenerator

generator = FlashCardGenerator()

Configuration Methods

  • set_filename(filename: str) -> Self: Set the output PDF filename
  • set_cards_per_row(count: int) -> Self: Set the number of cards per row
  • set_page_size(size: tuple) -> Self: Set the page size (default is A4)
  • set_margins(top: float, bottom: float) -> Self: Set top and bottom margins
  • set_card_height(height: float) -> Self: Set the height of each card

Adding Entries

generator.add_entry(original: str, translation: str, extra: str = "") -> Self
  • original: The text on the front of the card
  • translation: The text on the back of the card
  • extra: Additional information to display on the front (optional)

Generating the PDF

generator.generate()

This method creates the PDF file with all the added flashcards.

Markdown Formatting

You can use basic Markdown formatting in your flashcard text:

  • **bold** for bold text
  • *italic* for italic text
  • __underline__ for underlined text

Example

Here's a more detailed example showcasing various features:

from flashcard_generator import FlashCardGenerator
from reportlab.lib.units import cm

generator = FlashCardGenerator()
generator.set_filename("language_flashcards.pdf") \
         .set_cards_per_row(4) \
         .set_card_height(2.5*cm) \
         .add_entry("Bonjour", "Hello", "Casual greeting") \
         .add_entry("Merci", "Thank you", "**Important** phrase") \
         .add_entry("Au revoir", "Goodbye", "*Formal* farewell") \
         .add_entry("S'il vous plaît", "Please", "__Polite__ request") \
         .add_entry("Oui", "Yes") \
         .add_entry("Non", "No") \
         .generate()

This will create a PDF with 4 cards per row, each card 2.5 cm high, and include 6 flashcards with various formatting styles.

Contributing

Contributions to FlashCardGenerator are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

flashcard_generator-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

flashcard_generator-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file flashcard_generator-0.1.0.tar.gz.

File metadata

  • Download URL: flashcard_generator-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.19 Linux/6.1.0-18-amd64

File hashes

Hashes for flashcard_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ddf0221e1151fd79465b5b88a3d5749acea414bc2305e76a66d14fcc1b2b06c
MD5 1692e9c0aea4a6d5cd4fdd9a76905a74
BLAKE2b-256 286a2f2c167b3f263099784bba7d32f7ad86133d71bb7cc5ade0d1ad2451a898

See more details on using hashes here.

File details

Details for the file flashcard_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flashcard_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49b8de81d4b2ac7cd1492322b681207561c777b6a2f1e878b82424bf28d409a7
MD5 0775e59bcb17b8a7db0e5c88d4ff8b0d
BLAKE2b-256 b611f2b70dd99a1f8b9ea6ff668be1bda4f78e60a44995e4aa79448ee33dffed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page