Skip to main content

Export "Saved Stories" from Apple News to SQLite

Project description

apple-news-to-sqlite

Export Apple News Saved Stories to SQLite

Install

pip install apple-news-to-sqlite

Usage

apple-news-to-sqlite articles.db

apple-news-to-sqlite --dump

CLI Help

Usage: apple_news_to_sqlite [OPTIONS] [DB_PATH]

  Export your Apple News saved stories/articles to a SQLite database

  Example usage:

      apple_news_to_sqlite articles.db

  This will populate articles.db with an "articles" table containing information
  about your saved articles.

  Note: the contents of the articles themselves are not stored in the database,
  only metadata about the article such as title, author, url, etc.

Options:
  --version  Show the version and exit.
  --dump     Output saved stories to standard output
  --schema   Create database schema and exit
  --help     Show this message and exit.

Using apple-news-to-sqlite in your own Python code

get_saved_articles() returns a list of dictionaries, each representing a saved article with the following keys (all strings):

* id
* url
* title
* description
* image
* author
>>> from apple_news_to_sqlite import get_saved_articles
>>> articles = get_saved_articles()

Thanks

Thanks to Simon Willison who inspired this project with his excellent "everything-to-sqlite" dogsheep project.

Thanks Simon also for the excellent tools sqlite-utils and Datasette.

Thanks also to Dave Bullock who inspired this project and helped tremendously with the reverse engineering and initial code.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apple_news_to_sqlite-0.1.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

apple_news_to_sqlite-0.1.0-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page