Skip to main content

An interactive command-line tool for learning Swedish through quizzes and exercises. Features vocabulary practice and grammar drills to help English speakers master Swedish efficiently.

Project description

Swedishelf

Installation

Linux

Download dictionary

Download the JSON dictionary folkets_sv_en_public.json from here.

Store the file in one of the following locations:

  • Global installation (recommended): /home/<YOUR_USERNAME>/.config/swedishelf/ - This makes the dictionary available system-wide for all your swedishelf sessions. (You may need to create the .config and swedishelf directories if they don't exist)
  • Local installation: Place the file in the directory where you plan to run swedishelf - The dictionary will only be available when running swedishelf from that specific directory.

Install audio dependency

Install ffplay (part of the FFmpeg package). The following example uses Ubuntu:

sudo apt update
sudo apt install ffmpeg -y

Verify that ffplay is installed correctly:

ffplay -version

Install swedishelf

Install swedishelf:

pip install swedishelf

Enjoy!

Windows

Download dictionary

Download the JSON dictionary folkets_sv_en_public.json from here.

Store the file in one of the following locations:

  • Global installation (recommended): C:\Users\<YOUR_USERNAME>\AppData\Roaming\swedishelf\ - This makes the dictionary available system-wide for all your swedishelf sessions. (You may need to enable viewing of hidden folders to access AppData, and create the swedishelf directory if it doesn't exist)
  • Local installation: Place the file in the directory where you plan to run swedishelf - The dictionary will only be available when running swedishelf from that specific directory.

Configure UTF-8 Support

Before installing swedishelf, you need to enable UTF-8 support on Windows:

  1. Open Control PanelClock and RegionRegion
  2. Click the Administrative tab → Change system locale
  3. Check the box for "Beta: Use Unicode UTF-8 for worldwide language support"
  4. Restart your system

Install swedishelf

After restarting your system, install swedishelf:

pip install swedishelf

Enjoy!

Usage

To use swedishelf, simply run the command swedishelf in your terminal. This will start an interactive session where you can practice your Swedish language skills.

Options

You can customize your experience with the following options:

  • -d or --dic: Specify dict file, will use default dict if not specified.
  • -n or --num: Number of questions for this round.
  • -m or --mute: If mute, will not play audio.
  • -c or --choices: Number of choices for each question, the bigger, the harder.
  • -v or --version: Show version and exit.
  • --help: Show CLI help and exit.

Example

Here's an example of how to use swedishelf with the default settings, open a terminal and run:

$ swedishelf

This will start a session with 20 questions, using the default dictionary file.

FAQs

Q: In what order does swedishelf search for the dictionary file?

Swedishelf searches for the dictionary file in the following priority order:

  1. Custom dictionary path (specified with -d or --dict option)
  2. Current working directory (the directory where you run the swedishelf command)
  3. System-wide user config directory (varies by operating system):
    • Linux: /home/<YOUR_USERNAME>/.config/swedishelf/
    • Windows: C:\Users\<YOUR_USERNAME>\AppData\Roaming\swedishelf\

Q: Why doesn't the program show the next question immediately after I have answered one?

A: The audio of the question you just answered is playing, and swedishelf is downloading the audio for the next question at this time without blocking. The download duration depends on the network conditions. If you run the program with the -m or --mute option, this delay will not occur.

Contributing

If you'd like to contribute to swedishelf, please fork the repository and submit a pull request with your changes. You can also report issues or suggest new features on the issue tracker.

Licensing

Swedishelf is licensed under the MIT License. See the LICENSE file for more information.

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

swedishelf-0.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

swedishelf-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swedishelf-0.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for swedishelf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4bead1262e10b64e16832266633eca1fa1b3ae76127a1ad578b8a616d23874fd
MD5 46e2840d0c6593ca881d7b8e2d2f20a4
BLAKE2b-256 84407f240212e18bd1baa7e99c4b20aee7e6048823d92cb4302173ca2c2e26f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swedishelf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for swedishelf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 435b45428e4d6cab3fba6e534b45c37b6a63d99b8dcbf5746931d3170933b277
MD5 7975565710c7ad8213dfc78a27440ba1
BLAKE2b-256 4adf363f1a0db41f1fbd9147cecc403c6c732a063dd65a67ce70a7869e78b546

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