Skip to main content

A configurable learning tool

Project description

flashcards-json

Configurable learning tool for help with memorization

Displays a series of flashcards--screens with information about a given subject. Users can view the cards one at a time, either randomly or by entering the number of a specific card. Cards can also be viewed in groups, based on selected topics.

If you choose to view a single card, you'll initially see just a hint about its contents. This hint is like the "front" of the card, designed to spur your memory. Press the forward slash key (/) to flip the card over and see all the details about its subject.

All flashcards information is defined in a JSON-formatted text file, which must be specified on the command line:

$ python flashcards.py [source-file.json]

CONFIGURATION

The JSON file that defines your deck of flashcards needs to contain one parent dictionary with at least three child entries. The first required entry is a simple string...

"name" : (a string value)

...which serves as the overall name for your flashcard collection.

The second required entry is an array of child dictionaries...

"data" : [ (an array of dictionaries) ]

...where you define various properties for each one of your cards. You can define as many properties as you want, for as many cards as you need, as long as each key in each dictionary is a string and each value in each dictionary is a JSON data primitive. There's only one required key in all of these child dictionaries--title. It's the string that the system will use to identify the card.

The third and final required entry in your parent dictionary is an array of strings...

"display_template" : [ (an array of strings) ]

...in which each string is a line of text that will be displayed when your card is viewed. The strings can have replacement tokens, of the form {card['property']}. When the system calls the card's display() method, these tokens will be replaced with the properties you defined in the dictionary for the card.

There's also one optional entry you can make in your parent dictionary, which you can use to make the system automatically assign a number to each card:

"numbered" : ( true|false )

If the "numbered" key is present, and set to true, the deck will have a numerical key that can be used to access specific cards. The first key is 1. By default, the deck is unnumbered.

For a basic example of a flashcards configuration file, see planets.json.

ADVANCED CONFIGURATION

The same properties can sometimes be shared by multiple flashcards in a given deck. A collection of United States presidents, for example, will have several presidents who were Republicans and several other presidents who were Democrats. You might want to view all of these cards at the same time. But how? The answer is in yet another (optional) configuration element in the JSON dictionary...

"topics" : [ (an array of dictionaries) ]

...where you define each topic that multiple cards have in common.

Now here's where things get a little more complicated. The key in each dictionary is a simple string to identify the topic. But the value in each dictionary is yet another dictionary, with four required entries:

"character" : (a single character, identifying a menu option for this topic)
"prompt" : (a string containing the text for the description in the menu)
"detail" : [ (an array of strings containing text to be appended to the output when the card is displayed. Replacement tokens can be used here.) ]
"members" : [ (an array of strings, containing the title properties of the
cards that have this topic in common.)
]

For an example of an advanced flashcards configuration file, see colonies.json.

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

flashcards_json-1.0.4.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

flashcards_json-1.0.4-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file flashcards_json-1.0.4.tar.gz.

File metadata

  • Download URL: flashcards_json-1.0.4.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for flashcards_json-1.0.4.tar.gz
Algorithm Hash digest
SHA256 e29dd8f2aa227fbf26c23c3881856cadbdcdbcdc0221ba7ef7288cb5e9167feb
MD5 4afeabaa8c47be03f69f02e3000a67d6
BLAKE2b-256 b6c98f8b0cadb145a1c1eebc4f240cba46db72570424186b79821e98f05ce7d0

See more details on using hashes here.

File details

Details for the file flashcards_json-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for flashcards_json-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4909f47e3cb979adfab6b5ef8cc3ee41d85e3585fb8c58ea1a3505ce42767ac5
MD5 cc7c4a5f452b96678277f47792d272f7
BLAKE2b-256 9b2048665ed67f2ea56a67cdb2499ef300242c900e3e6c5751f41d1dfd067e0b

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