A simple Python automation script that fetches user and post data from a public API, connects the data, and generates reports in JSON, TXT, and CSV formats.
python user_posts_report.pyExample:
Enter user id:
1- Fetches users data from API
- Fetches posts data from API
- Validates user input
- Handles API errors with try/except
- Connects users and posts by user ID
- Exports the result to:
report.jsonreport.txtreport.csv
- Python
- requests
- json
- csv
python user_posts_report.pyThen enter a user ID when prompted.
The script generates:
- user ID
- username
- post count
- first post title
- Purpose
This project was built as a practice project for Python automation, API handling, input validation, error handling, and file export.