Skip to content

Feat: Add export to CSV functionality#139

Open
debug-soham wants to merge 1 commit into
ranahaani:masterfrom
debug-soham:feature/export-to-csv
Open

Feat: Add export to CSV functionality#139
debug-soham wants to merge 1 commit into
ranahaani:masterfrom
debug-soham:feature/export-to-csv

Conversation

@debug-soham
Copy link
Copy Markdown

Description

This PR introduces the export_to_csv() feature as requested in issue #133 .

This new method allows users to easily export a list of fetched news articles into a CSV file, which is useful for data analysis, storage, or sharing.

Changes Made

  • Added the export_to_csv() method to the GNews class in gnews/gnews.py.
  • Implemented error handling for empty article lists and file I/O.
  • Added two new unit tests (test_export_to_csv and test_export_to_csv_empty) in tests/test_gnews.py.
  • Updated README.md to include a section and example for the new feature.

Test

The new functionality is covered by the added unit tests. All 10 tests in the suite pass successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants