Skip to main content

Dagster resource for read-only X/Twitter data workflows through Xquik.

Project description

dagster-xquik

dagster-xquik provides a Dagster resource for read-only X/Twitter data workflows through the Xquik REST API.

Use it when Dagster assets or jobs need to:

  • Search public tweets
  • Fetch a tweet by ID
  • Search users
  • Fetch a user profile by ID or handle
  • Fetch user timeline tweets
  • Fetch regional trends

Installation

dagster-xquik is pending its first release through the Dagster community integrations release flow. Until that release is published, install it from a local checkout:

cd libraries/dagster-xquik
pip install -e .

After the first release is published, install the package from PyPI:

pip install dagster-xquik

Usage

Set XQUIK_API_KEY in the environment, then pass it through Dagster's EnvVar.

from dagster import AssetExecutionContext, EnvVar, asset, Definitions
from dagster_xquik import XquikResource


@asset
def recent_xquik_tweets(
    context: AssetExecutionContext,
    xquik: XquikResource,
) -> list[dict[str, object]]:
    response = xquik.get_client().search_tweets(q="xquik", limit=10)
    tweets = response.get("data", [])
    context.log.info("Fetched %s tweets", len(tweets))
    return tweets


defs = Definitions(
    assets=[recent_xquik_tweets],
    resources={
        "xquik": XquikResource(api_key=EnvVar("XQUIK_API_KEY")),
    },
)

Resource

from dagster import EnvVar
from dagster_xquik import XquikResource

xquik = XquikResource(api_key=EnvVar("XQUIK_API_KEY"))
client = xquik.get_client()

client.search_tweets(q="dagster", limit=25)
client.get_tweet("1912345678901234567")
client.search_users(q="dagster")
client.get_user("@dagster")
client.get_user_tweets("@dagster", limit=20)
client.get_trends(woeid=1, count=10)

XquikResource accepts:

Field Default Description
api_key Required Xquik API key. Use EnvVar("XQUIK_API_KEY") in Dagster definitions.
base_url https://xquik.com/api/v1 Xquik API base URL.
contract_version 2026-04-29 API contract header version.
timeout_seconds 30.0 HTTP request timeout.

Local Development

make install
make test
make ruff
make check
make build

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

dagster_xquik-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagster_xquik-0.0.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file dagster_xquik-0.0.2.tar.gz.

File metadata

  • Download URL: dagster_xquik-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dagster_xquik-0.0.2.tar.gz
Algorithm Hash digest
SHA256 193ebbc962d493d3b357e4f32c5302e6625c81497540b13abc5fd1db1ae11bee
MD5 89ca80eb40d28f45b2872ee43f25f14c
BLAKE2b-256 75463eb16337f907d761c3b5f89e6e7028f57fc0e9fabf44538451c31b3f1957

See more details on using hashes here.

File details

Details for the file dagster_xquik-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dagster_xquik-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dagster_xquik-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f44f1fa270fc994aafc180a5ba495a28b127101549900961b1d9803b68bf134
MD5 042f0c5f8d5b3945813387d59dc70397
BLAKE2b-256 12dbab36966dd0590f8874e48dcb8a65efa73c365c5e10b51cfe01b69855cd16

See more details on using hashes here.

Supported by

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