Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

FRC Team API Practice - Team 2658

🎯 Purpose

This is a practice project for learning Python and REST APIs. You'll create a simple API that returns information about Team 2658 E-motion.

🤖 About Team 2658 - E-motion

  • Team Number: 2658
  • Team Name: E-motion
  • Location: California
  • Competition: FIRST Robotics Competition (FRC)

📚 What You'll Learn

  • Python basics (dictionaries, functions, conditionals)
  • REST API concepts (routes, endpoints, JSON responses)
  • Async programming basics (don't worry too much about this yet!)
  • Testing APIs in the browser

✅ Your Task

Open app.py and complete these TODOs:

1. Fill in the team_data dictionary

Replace the 0s and empty strings with real information:

  • team_number: 2658
  • team_name: E-motion
  • school: Your school name
  • city: Your city
  • state: Your state
  • founded_year: When was Team 2658 founded?
  • Add more fields if you want! (team motto, colors, number of members, etc.)

2. Complete the three endpoint functions

  • get_team(): Return all team data as JSON
  • get_field(field): Return a specific field from team_data
  • field_count(): Return the number of fields in team_data

🚀 How to Run

First Time Setup

# Create a virtual environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Run the API

python app.py

The API will start at http://localhost:5000

🧪 Test Your Endpoints

Open these URLs in your browser after completing the TODOs:

  1. Home: http://localhost:5000/

    • Should return: {"message": "Welcome to Team 2658 API!"}
  2. Get All Team Data: http://localhost:5000/team

    • Should return: All the team_data dictionary as JSON
  3. Get Specific Field: http://localhost:5000/info/team_name

    • Should return: Just the team name
    • Try other fields: /info/team_number, /info/city, etc.
  4. Count Fields: http://localhost:5000/count

    • Should return: The number of fields in team_data

💡 Tips

  • Use jsonify() to convert Python dictionaries to JSON responses
  • Check if a field exists before accessing it: if field in team_data:
  • Use len() to count items in a dictionary
  • The async and await keywords are for asynchronous programming (Quart's special feature)

🆘 Need Help?

CONTACT A LEAD

🎓 What's Next?

After completing this project, you can:

  • Add more endpoints (e.g., /pathways to list the four pathways)
  • Add POST endpoints to update team data
  • Connect this to a database
  • Add authentication

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages