Python client + CLI for the Vivly social-data API (X / Reddit) with smart prompt-based routing.
Project description
vivly
Python client for the Vivly social-data API. One bearer key, two live sources: X (Twitter) and Reddit, plus a smart router that picks sources from a plain-language prompt.
Install
This is a beta release, so the --pre flag is required:
pip install --pre vivly==0.5.0b1
Authenticate
The client needs a personal access token (looks like vk_live_...). Two ways to
provide it:
# Option A: log in interactively (opens a browser, stores the token at
# ~/.config/vivly/config.json with 0600 perms)
vivly login
# Option B: set it yourself if you were handed a token
export VIVLY_API_KEY="vk_live_..."
A .env file in the working directory is auto-loaded. Resolution order:
explicit api_key= argument, then VIVLY_API_KEY (or legacy VIVLY_SKILL_KEY),
then .env, then ~/.config/vivly/config.json.
Usage
from vivly import VivlyClient
with VivlyClient() as v:
# Reddit: one-shot retrieval. Auto-discovers subreddits, searches them,
# and LLM-filters the results for relevance.
r = v.reddit.search("claude code agents", max_posts=10)
for post in r["posts"]:
print(post["score"], post["title"], post["url"])
# X / Twitter: blocking helper that starts a scrape, polls, and returns items.
# (Runs a paid third-party actor server-side; expect a few seconds to minutes.)
tweets = v.x.scrape('"san antonio" arena Spurs lang:en', max_items=50)
for t in tweets:
print(t["metrics"]["likes"], t["text"][:80])
# Smart router: describe what you want; it plans + runs the right sources.
result = v.route("what are people saying about claude code on reddit",
force_sources=["reddit"], max_items=20)
If you'd rather drive the X scrape yourself instead of the blocking helper:
started = v.x.scrape_start("query lang:en", max_items=50)
status = v.x.scrape_status(started["run_id"])
items = v.x.scrape_items(started["dataset_id"])
Errors
from vivly import VivlyError, AuthError, RateLimitError, NotFoundError
AuthError (401/403) usually means a missing, revoked, or mistyped token.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vivly-0.5.0b1.tar.gz.
File metadata
- Download URL: vivly-0.5.0b1.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d30bca1e926d0f29eeae4bcff0fcf542cf20d04b0c89ce508c6c3971eee21b42
|
|
| MD5 |
e05d1280b35d04d438e42738243218c5
|
|
| BLAKE2b-256 |
379bed217d7c6ce814e70f4c406562158358db7bf4fd2b65c6a6784fb9b65b1e
|
File details
Details for the file vivly-0.5.0b1-py3-none-any.whl.
File metadata
- Download URL: vivly-0.5.0b1-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b9c0e3112cc47ae1ff550fa28712ad2337620a6477b9fb10ecc5a84244f1447
|
|
| MD5 |
c9c6f387f510c2574ee85dcdc5ff15d0
|
|
| BLAKE2b-256 |
1bd71f7cc935976076266382c6b5d58846689288eab267398d56a6b1e802a0d3
|