Pychievements: The Python Achievments Framework!
Pychievements is a framework for creating and tracking achievements within a Python application. It includes functions specifically for creating command line applications, though it is flexible enough to be used for any application such as web applications.
See the examples to get a good feel for what Pychievements offers. Documentation can be found RTD: http://pychievements.readthedocs.org/en/latest/
Features:
Create Achievements with any number of “goals” (based on levels) that can be reached
Flexible design makes it easy to customize the way levels are tracked
Easy to add new achievements later
Pluggable backend for storing tracked information in different formats to different locations
Achievements can be filtered by category or keywords
Easily specify “Icons” for individual goals within an achievement for dual states (achieved and unachieved)
Example
A simple achievement.
class MyAchievement(Achievement):
name = "My Achievement"
category = "achievements"
keywords = ("my", "achievement")
goals = (
{"level": 10, "name": "Level 1", "icon": icons.star, "description": "Level One"},
{"level": 20, "name": "Level 2", "icon": icons.star, "description": "Level Two"},
{"level": 30, "name": "Level 3", "icon": icons.star, "description": "Level Three"},
)
Increment a level for a user.
tracker.increment(user_id, MyAchievment)
Re-evaluating a level for a user based on arguments (requires the evaluate function to be defined or the Achievement).
tracker.evaluate(user_id, MyAchievement, some, extra, args)
Retrieve achievements.
tracker.achievements() # retrieves all registered achievements in the tracker tracker.achieved(uid, achievement) # all achieved goals by uid for achievement tracker.unachieved(uid, achievement) # all unachieved goals by uid for achievement tracker.current(uid, achievement) # goal currently being worked torwards by uid
Installation
To install pychievements, simply:
$ pip install pychievements
License
Pychievements is licensed under the MIT License, see the LICENSE.
Contribute
If you’d like to contribute, simply fork the repository, commit your changes to the master branch (or branch off of it), and send a pull request. Make sure you add yourself to AUTHORS.
Roadmap
More backends
More icons
History
0.1.0 (2014-08-31)
Initial Release!
Metadata
Release files for pychievements 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pychievements-0.1.2.tar.gz | 13.0 kB | Without provenance | Details |
Release files / pychievements-0.1.2.tar.gz
| Download URL | pychievements-0.1.2.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62eb7cf9dcfb7a4c29aecc12d41b965c52aa4c0406c6a175c2703ea58ede9460
|
|
BLAKE2b-256 checksum How to use checksums |
9e7b7ac1d5aca86a112070f5abceb272ab2f58dc9556edffca6444bd6847483b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pychievements 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.