Skip to content

Earn Achievements πŸ† while learning how to code Python 🐍

License

Notifications You must be signed in to change notification settings

ranggakd/dev-achievements

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dev-achievements

Earn Achievements while learning how to code

Gamify your experience while learning to code and get achievements for different concepts as you use them. Start at a simple print statement and work your way up to functions and classes (and more to come).


Example

Just import the package at the top of your script (example):

# my_script.py

import dev_achievements


def cumulative_sum(x):
    # calculates sum of numbers from 0 to x
    total = 0
    for i in range(x):
        total += i
    return total


result = cumulative_sum(4)
print('value: ', result)

And run it in the terminal as you normally would:

$ python3 my_script.py

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Achievement Unlocked: Loops!     β”‚
β”‚ Achievement Unlocked: Functions! β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

value:  6

Usage

To install and use:

  1. Install the package with pip install dev-achievements
  2. Use import dev_achievements at the top of your script
  3. Run your python script as normal

To uninstall:

  1. Uninstall the package with pip uninstall dev-achievements
  2. Optionally, delete the directory ~/.dev_achievements to remove any achievement progress. Keep this directory to save progress through installs.

Some things to note

  1. Currently this only works on single file scripts - if you import your own module (e.g. for utility functions) that module will not be parsed (planning on fixing this though)
  2. Some achievements have dependencies, and will only be unlocked once previous ones have been unlocked
  3. Unlocked achievements will remain unlocked, so those "Achievement Unlocked" messages will only show once per achievement

Future plans and contributing

  1. The bare bones achievements are currently implemented (using "hello world", for loops, lists, functions, etc.) - more achievements are in development (see issue #1)
  2. More details on how to contribute (along with code docs to help with the development process) are coming soon

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Shell 1.7%