https://github.com/mattmajestic/streamlit-news
π News API for Streamlit
https://github.com/mattmajestic/streamlit-news
news-api streamlit
Last synced: 7 months ago
JSON representation
π News API for Streamlit
- Host: GitHub
- URL: https://github.com/mattmajestic/streamlit-news
- Owner: mattmajestic
- Created: 2024-09-12T00:16:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-12T00:21:26.000Z (about 1 year ago)
- Last Synced: 2025-03-10T10:44:12.970Z (7 months ago)
- Topics: news-api, streamlit
- Language: Python
- Homepage: https://news-api.streamlit.app/
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: news_service.py
Awesome Lists containing this project
README
# π° Streamlit News
Welcome to the **Streamlit News App**, a simple and fun way to display the latest news using Python and Streamlit! This project is perfect for those getting started with Python and web development using the awesome **Streamlit** framework.
## π Features
- Fetch the latest news from the **News API**.
- Choose from different categories like `technology`, `sports`, `business`, `entertainment`, `politics`, and `health`.
- Securely enter your API key using the sidebar.
- Clean and interactive UI built with **Streamlit**.## π οΈ Getting Started
### π Prerequisites
- **Python 3.7+** installed. Download it from [here](https://www.python.org/downloads/).
- Basic understanding of Python.
- A **News API** key. Sign up and get one for free from [News API](https://newsapi.org/register).### π Usage
1) Enter your News API key in the sidebar.
2) Choose a category from the dropdown.
3) Click to fetch the latest news in that category.### π§βπ» Code Breakdown
Hereβs a simplified view of how the code works:1) Set up Streamlit with a title, favicon, and a sidebar for inputs like the API key and category.
2) Make a request to the News API based on the selected category.
3) Display the news dynamically on the page with formatted titles and descriptions.