{"id":21170208,"url":"https://github.com/dcarpintero/st-newsapi-connector","last_synced_at":"2025-07-09T19:32:25.160Z","repository":{"id":185826103,"uuid":"673670591","full_name":"dcarpintero/st-newsapi-connector","owner":"dcarpintero","description":"Streamlit Data Connector to NewsAPI. Available as a PyPi package.","archived":false,"fork":false,"pushed_at":"2024-01-16T22:33:42.000Z","size":18633,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-13T14:19:28.071Z","etag":null,"topics":["newsapi","python","streamlit","streamlit-component","streamlit-connection"],"latest_commit_sha":null,"homepage":"https://newsapi-connector.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcarpintero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-08-02T06:53:18.000Z","updated_at":"2024-10-07T13:21:23.000Z","dependencies_parsed_at":"2024-01-17T01:12:50.356Z","dependency_job_id":"1aea881f-b7b4-4cb9-8ecf-5c5e6ec4967f","html_url":"https://github.com/dcarpintero/st-newsapi-connector","commit_stats":null,"previous_names":["dcarpintero/st-newsapi-connector"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fst-newsapi-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fst-newsapi-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fst-newsapi-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fst-newsapi-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcarpintero","download_url":"https://codeload.github.com/dcarpintero/st-newsapi-connector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225587775,"owners_count":17492632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["newsapi","python","streamlit","streamlit-component","streamlit-connection"],"created_at":"2024-11-20T15:57:08.791Z","updated_at":"2024-11-20T15:57:09.413Z","avatar_url":"https://github.com/dcarpintero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Open_inStreamlit](https://img.shields.io/badge/Open%20In-Streamlit-red?logo=Streamlit)](https://newsapi-connector.streamlit.app/)\n[![Python](https://img.shields.io/badge/python-%203.8-blue.svg)](https://www.python.org/)\n[![PyPi](https://img.shields.io/pypi/v/st-newsapi-connector)](https://pypi.org/project/st-newsapi-connector/)\n[![Build](https://img.shields.io/github/actions/workflow/status/dcarpintero/st-newsapi-connector/codecov.yml?branch=main)](https://pypi.org/project/st-newsapi-connector/)\n[![CodeFactor](https://www.codefactor.io/repository/github/dcarpintero/st-newsapi-connector/badge)](https://www.codefactor.io/repository/github/dcarpintero/st-newsapi-connector)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/dcarpintero/st-newsapi-connector/blob/main/LICENSE)\n\n# 📰 Streamlit-NewsAPI Data Connector\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/st-newsapi-connector.png\"\u003e\n\u003c/p\u003e\n\nStreamlit Data Connector component that extends Streamlit to easily integrate the [NewsAPI](https://newsapi.org/) in Streamlit Apps. Works with Streamlit \u003e= 1.28. \n\n## 🚀 Quickstart\n\n1. Clone the repository:\n```\ngit clone git@github.com:dcarpintero/st-newsapi-connector.git\n```\n\n2. Create and Activate a Virtual Environment:\n\n```\nWindows:\n\npy -m venv .venv\n.venv\\scripts\\activate\n\nmacOS/Linux\n\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\n3. Install dependencies:\n\n```\npip install -r requirements.txt\n```\n\n4. Launch Web Application\n\n```\nstreamlit run ./app.py\n```\n\n## 📄 Minimal Integration\n\n```python\n# src/app.py\n\nimport streamlit as st\nfrom st_newsapi_connector.connection import NewsAPIConnection\n\nconn_newsapi = st.connection(\"NewsAPI\", type=NewsAPIConnection)\n\n# Retrieves News Articles on a specific topic from the NewsAPI\ndf = conn_newsapi.everything(topic=\"AI, LLMs\")\nst.dataframe(df)\n\n# Retrieves Top-Headlines in a country and category from the NewsAPI\ndf = conn_newsapi.top_headlines(country='US', category='Science')\nst.dataframe(df)\n```\n\n```toml\n# .streamlit/secrets.toml\n\nNEWSAPI_KEY = 'your-newsapi-key'\nNEWSAPI_BASE_URL = 'https://newsapi.org/v2/'\n```\n\n```txt\n# requirements.txt\n\npandas==1.5.1\npycountry==22.3.5\nrequests==2.31.0\nstreamlit==1.30.1\n```\n\n## 👩‍💻 Streamlit Web App\n\nDemo Web App deployed to [Streamlit Cloud](https://streamlit.io/cloud) and available at https://newsapi-connector.streamlit.app/ \n\n## 📚 References\n\n- [Streamlit BaseConnection](https://docs.streamlit.io/library/api-reference/connections/st.connections.baseconnection)\n- [Streamlit Connection](https://docs.streamlit.io/library/api-reference/connections/st.connection)\n- [Get Started with Streamlit Cloud](https://docs.streamlit.io/streamlit-community-cloud/get-started)\n- [NewsAPI Dcoumentation](https://newsapi.org/docs)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcarpintero%2Fst-newsapi-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcarpintero%2Fst-newsapi-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcarpintero%2Fst-newsapi-connector/lists"}