Categorized list of hobbies
Project description
hobby-by-category-py 🎨⚡🏕️
A comprehensive Python package providing categorized hobby data. Perfect for forms, recommendation systems, and hobby discovery apps.
Features
- 300+ hobbies across 10 categories
- Easy-to-use API for accessing hobby data
- Python 3.6+ compatible
- Zero dependencies
- Active maintenance
Installation
pip install hobby-by-category
Basic Usage
python
from hobby_by_category import get_hobbies_by_category, get_random_hobby
# Get all creative hobbies
creative_hobbies = get_hobbies_by_category("creative_and_artistic")
print(creative_hobbies)
# Get a random outdoor activity
random_outdoor = get_random_hobby("outdoor_and_adventure")
print(random_outdoor)
Available Categories
creative_and_artistic - Painting, Drawing, Photography, etc.
outdoor_and_adventure - Hiking, Camping, Rock Climbing, etc.
sports_and_fitness - Running, Yoga, Swimming, etc.
intellectual_and_learning - Reading, Chess, Astronomy, etc.
tech_and_gaming - Coding, Gaming, VR, etc.
music_and_performance - Instruments, Singing, DJing, etc.
collecting - Coins, Vinyl, Comics, etc.
food_and_drink - Cooking, Brewing, Mixology, etc.
social_and_community - Volunteering, Board Games, etc.
relaxation_and_mindfulness - Meditation, Journaling, etc.
API Reference
Data Structure
Access the raw hobby data dictionary:
python
from hobby_by_category import HOBBY_DATA
Utility Functions
Function Description Example
get_all_categories() Returns all category names ['creative_and_artistic', ...]
get_hobbies_by_category(category) Returns hobbies for specific category get_hobbies_by_category('tech_and_gaming')
get_random_hobby(category=None) Returns random hobby (optional category filter) get_random_hobby('food_and_drink')
Example Implementations
Flask Form Processing
python
from flask import Flask, request
from hobby_by_category import get_hobbies_by_category
app = Flask(__name__)
@app.route('/submit-hobby', methods=['POST'])
def submit_hobby():
category = request.form['category']
hobby = request.form['hobby']
if hobby not in get_hobbies_by_category(category):
return "Invalid hobby selection", 400
# Process valid hobby
return "Hobby saved successfully", 200
Django Form
python
from django import forms
from hobby_by_category import get_all_categories, get_hobbies_by_category
class HobbyForm(forms.Form):
category = forms.ChoiceField(choices=[(c, c.replace('_', ' ').title()) for c in get_all_categories()])
hobby = forms.ChoiceField(choices=[])
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if 'category' in self.data:
category = self.data['category']
self.fields['hobby'].choices = [(h, h) for h in get_hobbies_by_category(category)]
Development
Building from Source
bash
git clone https://github.com/therealMAO247/hobby-by-category-py.git
cd hobby-by-category-py
pip install -e .
Testing
bash
python -m unittest discover
Contributing
Contributions are welcome! Please:
Fork the repository
Create a new branch for your feature
Submit a pull request
License
MIT © 2025, Michael Anan Onimisi <@therealMAO247>.
MIT © 2025, Ahoiza Technologies <www.ahoizatechnologies.com>.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hobby_by_category-1.0.0.tar.gz.
File metadata
- Download URL: hobby_by_category-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
105c958ab5d259842200030d2b5a43ae35bf2d4cbdad8b7be1fb2415b19f4717
|
|
| MD5 |
72527b4e16d8d691a5eeaca76fcea978
|
|
| BLAKE2b-256 |
3649863029d5f960c4ed18a631d6f090253185042fdfdd8ad99ca5e0993fe4e2
|
File details
Details for the file hobby_by_category-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: hobby_by_category-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bcbe812d870df121ec6adaa4e4690d5b30288c9e207a9f0db0036c89ba39eda
|
|
| MD5 |
660153c2ff99f3c68af6261cce2a3a53
|
|
| BLAKE2b-256 |
cd8e3fa07cf5ca945b1123ceb469e57cf9ecb1185141f7df480e2394902e58b0
|