This project is part of the INFO6143 course at Fanshawe College. The goal is to create a Python application that retrieves MLB game data from a public API, processes the JSON data, and outputs the relevant information into a CSV file. This project emphasizes file handling and data extraction techniques in Python.
- Fetches MLB game data from provided URLs.
- Processes JSON data to extract specific fields.
- Outputs the extracted data into a CSV file with a predefined header.
- Handles multiple dates by reading URLs from a file.
- Python 3.x
- Requests library
- Clone this repository:
git clone https://github.com/Designated-AICoder/MLB-data-collection-INFO6143.git
- Navigate to the project directory:
cd Group_07_project02 - Install the required libraries:
pip install -r requirements.txt
- Ensure you have the
urls.txtfile in the same directory as your Python script. This file should contain the URLs to fetch data from, one per line. - Run the Python script:
python mlb_data_collection.py
- The output CSV file
MLBData.csvwill be generated in the same directory.
Group_07_project02/
├── urls.txt
├── mlb_data_collection.py
├── MLBData.csv
├── requirements.txt
└── README.md
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.