中文 | English
Forked from OmnivoreQL
This is a Python client for the Omnivore API.
pip install omnivore_apiAfter installation, the omnivore command is available directly in your terminal.
omnivore initPrompts for your API token and endpoint URL, then writes ~/.config/omnivore-api/config.yaml.
# Save a URL (optionally with labels)
omnivore save-url https://example.com
omnivore save-url https://example.com --label reading --label python
# List articles in your inbox
omnivore get-articles
omnivore get-articles --limit 20 --query "in:inbox" --format markdown
# Get your profile
omnivore get-profile
# List all labels
omnivore get-labelsAll commands output JSON to stdout, so you can pipe to jq:
omnivore get-labels | jq '.[].name'Import the package and create a client instance:
from omnivore_api import OmnivoreAPI
omnivore = OmnivoreAPI("your_api_token_here", "your_api_url_here")profile = omnivore.get_profile()
saved_page = omnivore.save_url("https://www.google.com")
saved_page_with_label = omnivore.save_url("https://www.google.com", ["label1", "label2"])
articles = omnivore.get_articles()
username = profile['me']['profile']['username']
slug = articles['search']['edges'][0]['node']['slug']
article = omnivore.get_article(username, slug)
subscriptions = omnivore.get_subscriptions()
labels = omnivore.get_labels()
from omnivore_api import CreateLabelInput
omnivore.create_label(CreateLabelInput("label1", "#00ff00", "This is label description"))- Main Omnivore graphql schema is in: schema.graphql
- To contribute to this project: CONTRIBUTING.md
- To more know about Release process: RELEASE.md, PYPI.md
This project is licensed under the MIT License - see the LICENSE file for details.