Prefect collection for scheduled X/Twitter data workflows with Xquik
Project description
Prefect tasks for Xquik X/Twitter data workflows
Prefect Guide · Releases · Xquik API Reference · Prefect Docs
Guide: https://docs.xquik.com/guides/prefect
Run scheduled X/Twitter data reads in Prefect 3 flows with a reusable
XquikCredentials block, async tasks, retries, and normal Prefect deployment
patterns.
Use prefect-xquik when a workflow needs public X/Twitter signals for research,
monitoring, enrichment, dashboards, or alerts without maintaining scraper code in
each flow.
What You Can Schedule
| Workflow Need | Prefect Task | Xquik Endpoint |
|---|---|---|
| Search recent or top posts | search_tweets |
GET /x/tweets/search |
| Look up a specific post | get_tweet |
GET /x/tweets/{id} |
| Search public users | search_users |
GET /x/users/search |
| Look up a user profile | get_user |
GET /x/users/{id} |
| Fetch a user's timeline | get_user_tweets |
GET /x/users/{id}/tweets |
| Read regional or global trends | get_trends |
GET /x/trends |
Install
pip install prefect-xquik
For local development:
uv sync
uv run ruff format --check .
uv run ruff check .
uv run pytest
uv build
uv run twine check dist/*
Register Blocks
prefect block register -m prefect_xquik
Create a block in the Prefect UI or with Python:
from prefect_xquik import XquikCredentials
credentials = XquikCredentials(api_key="<xquik-api-key>")
credentials.save("xquik", overwrite=True)
Store API keys in Prefect blocks, not in flow source files.
Example Flow
from prefect import flow
from prefect_xquik import XquikCredentials, get_trends, search_tweets
@flow
async def social_signal_flow() -> dict:
credentials = XquikCredentials.load("xquik")
tweets = await search_tweets(
credentials,
query='"prefect" OR "workflow orchestration"',
query_type="Latest",
limit=25,
)
trends = await get_trends(credentials, woeid=1, count=10)
return {"tweets": tweets, "trends": trends}
Task Imports
from prefect_xquik import (
get_trends,
get_tweet,
get_user,
get_user_tweets,
search_tweets,
search_users,
)
Tasks return the raw Xquik JSON response as a Python dictionary. Configure
Prefect runtime behavior with with_options:
from prefect_xquik import search_tweets
search_recent_tweets = search_tweets.with_options(
name="Search Recent X Posts",
retries=2,
retry_delay_seconds=10,
)
API Contract
The credentials block sends x-api-key and the current xquik-api-contract
header. The default contract is 2026-04-29, matching the public OpenAPI
contract used to build this collection.
Documentation
Development
uv sync
uv run ruff format --check .
uv run ruff check .
uv run pytest
uv build
uv run twine check dist/*
This repository follows Prefect's external collection layout so it can be moved
under src/integrations/prefect-xquik later if Prefect maintainers request it.
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 prefect_xquik-0.1.5.tar.gz.
File metadata
- Download URL: prefect_xquik-0.1.5.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1fbcbf6c21927fc4e6b913199364011b15f008d11560274c6b4ec10032535a
|
|
| MD5 |
25ce8223f411f65304716393e8740bf4
|
|
| BLAKE2b-256 |
1e4302bf08db5f663d6795ee20dadbef95272f26cf4b7c160172bb095f92918c
|
Provenance
The following attestation bundles were made for prefect_xquik-0.1.5.tar.gz:
Publisher:
publish.yml on Xquik-dev/prefect-xquik
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prefect_xquik-0.1.5.tar.gz -
Subject digest:
3d1fbcbf6c21927fc4e6b913199364011b15f008d11560274c6b4ec10032535a - Sigstore transparency entry: 1547098174
- Sigstore integration time:
-
Permalink:
Xquik-dev/prefect-xquik@73784acf971dbdf1b0715472ebb694f3073cbcfc -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73784acf971dbdf1b0715472ebb694f3073cbcfc -
Trigger Event:
release
-
Statement type:
File details
Details for the file prefect_xquik-0.1.5-py3-none-any.whl.
File metadata
- Download URL: prefect_xquik-0.1.5-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
264e43c6106a83ec24572f365ade00466ef4f7dfcea05708b474af66da1d3a2b
|
|
| MD5 |
ae2a0c371e7cf719ddf1047ba6b59681
|
|
| BLAKE2b-256 |
384e9585425057ddda4b2e31ba4016267c4a58656ddc455324714bc4a3ed9767
|
Provenance
The following attestation bundles were made for prefect_xquik-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on Xquik-dev/prefect-xquik
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prefect_xquik-0.1.5-py3-none-any.whl -
Subject digest:
264e43c6106a83ec24572f365ade00466ef4f7dfcea05708b474af66da1d3a2b - Sigstore transparency entry: 1547098177
- Sigstore integration time:
-
Permalink:
Xquik-dev/prefect-xquik@73784acf971dbdf1b0715472ebb694f3073cbcfc -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73784acf971dbdf1b0715472ebb694f3073cbcfc -
Trigger Event:
release
-
Statement type: