tahrir.utils.badge module¶
- tahrir.utils.badge.badge_json_generator(badge, withasserts=True)[source]¶
Serialize a badge for the JSON API.
When withasserts is False, returns compact data for listings.
- tahrir.utils.badge.convert_name_to_id(name)[source]¶
Convert a badge name into a valid badge ID.
- Parameters:
name (string) – The badge name to convert to an ID
- tahrir.utils.badge.organize_badges_by_tags(serialized_badges)[source]¶
Helper function to organize badges by tags using indices.