Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Tinybird SDK for Python 🐦

License

NotificationsYou must be signed in to change notification settings

localstack/verdin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PyPI VersionCI StatusCoverage StatusPyPI LicenseCode style: black

Verdin is atiny bird, and also aTinybird SDK for Python.

Install

pip install verdin

Requirements

Python 3.10+

Usage

Run an SQL Query

# the tinybird module exposes all important tinybird conceptsfromverdinimporttinybirdclient=tinybird.Client("p.mytoken")query=client.sql("select * from my_datasource__v0")# run the query with `FORMAT JSON` and receive a QueryJsonResultresponse:tinybird.QueryJsonResult=query.json()# print records returned from the pipeprint(response.data)

You can also run, e.g.,query.get(format=OutputFormat.CSV) to get the raw response with CSV data.

Query a Pipe

fromverdinimporttinybirdclient=tinybird.Client("p.mytoken")pipe=client.pipe("my_pipe")# query the pipe using dynamic parametersresponse:tinybird.PipeJsonResponse=pipe.query({"key":"val"})# print records returned from the pipeprint(response.data)

Append to a DataSource

fromverdinimporttinybirdclient=tinybird.Client("p.mytoken")# will access my_datasource__v0datasource=client.datasource("my_datasource",version=0)# query the pipe using dynamic parametersdatasource.append([    ("col1-row1","col2-row1"),    ("col1-row2","col2-row2"),])

Queue and batch records into a DataSource

Verdin provides a way to queue and batch data continuously:

fromqueueimportQueuefromthreadingimportThreadfromverdinimporttinybirdfromverdin.workerimportQueuingDatasourceAppenderclient=tinybird.Client("p.mytoken")records=Queue()appender=QueuingDatasourceAppender(records,client.datasource("my_datasource"))Thread(target=appender.run).start()# appender will regularly read batches of data from the queue and append them# to the datasource. the appender respects rate limiting.records.put(("col1-row1","col2-row1"))records.put(("col1-row2","col2-row2"))

Develop

Create the virtual environment, install dependencies, and run tests

make venvmake test

Run the code formatter

make format

Upload the pypi package using twine

make upload

About

A Tinybird SDK for Python 🐦

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp