Boilerplate news aggregation application build for Reddit and NewsAPI. Main idea is to use lightweight development frameworks like FastAPI rather than heavy weight lifting with Django/ Flask. Further information can be found in Problem Statement document.
Request Demo
·
Report Bug
·
Request Feature
The application is built in accordance with Problem Statement document. All of the features are implemented. All the contraints are implemented, along with project documentation and unit-tests.
Current version of this project does not implement cache server or job queue to minimize performance dependence on external APIs.
- Get list of registered APIs
- Loop over APIs
- Make JSON object of configurations for each API
- Write JSON parsers for each API
- Combine result in uniform format to display
- Return results
Every Request to API should be async; put the request in job tracker, get results and push back responses
api.route('/news')
def get_top_news():
- Get all available APIs
- Call each API for getting top 10 news in JSON; Listing Function for Each API
- Aggregate news from all APIs, discard empty responses
api.route('/news?query=bitcoin')
def get_search_results():
- Get all available APIs
- Call each API with search query to get top 10 results in JSON; Searching Function for Each API
- Aggregate results from all APIs, discard empty responses
- News_API json parser for listing responses; should return only required fields; ["title", "link", "source"]
- Reddit_API json parser for listing results
- Make a new file for new-API in
src/external_api/
- Take
src/external_api/sample_api.py
as reference - Prepare API Mapping object
- Write JSON parser for that API
- Register your API in API_COLLECTION in
src/api_helper.py
To run this project, should install project dependencies:
- Python3
- pip
- Intsall Python packages
- Clone the repo
git clone https://github.com/umairqadir97/news-aggregator-with-fastapi.git
- Open terminal in project folder
cd news-aggregator-with-fastapi
- Install python packages
pip3 install -r requirements.txt
-
Create your configurations file
src/config.py
. Takesrc/sample_config.py
as example -
Run server
python3 api.py
pytest
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b amazing_features
) - Commit your Changes (
git commit -m 'Add some Amazing Features'
) - Push to the Branch (
git push origin amazing_features
) - Open a Pull Request
- Writing more unit tests
- Code review
- Feature Enhancement
Distributed under the MIT License. See LICENSE
for more information.
Muhammad Umair Qadir - Email
LinkedIn: LinkedIn