iceduck
DuckDB wrapper with iceberg writer
usage
duckdb
import iceduck as duckdb
with duckdb.connect() as con:
con.sql("CREATE TABLE test (i INTEGER)")
con.sql("INSERT INTO test VALUES (42)")
df = con.execute("select * from test").fetch_df()
print(df)
duckdb with Iceberg ( using local sqllite catalog )
Create a local folder
mkdir warehouse
import iceduck as duckdb
with duckdb.connect() as con:
con.sql("CREATE TABLE test (i INTEGER)")
con.sql("INSERT INTO test VALUES (42)")
warehouse_path = "./warehouse"
params = {
'type': 'sql',
"uri": f"sqlite:///{warehouse_path}/pyiceberg_catalog.db",
"warehouse": f"file://{warehouse_path}",
}
catalog = con.load_catalog(name='local', **params)
#create a namespace
if catalog._namespace_exists("default"):
print("Namespace already exists")
else:
print("Creating namespace")
catalog.create_namespace("default")
query_result = con.execute("select * from test")
result = query_result.upsert_iceberg('default.test_iceberg')
print(result)
Read iceberg table
import iceduck as duckdb
with duckdb.connect() as con:
warehouse_path = "./warehouse"
params = {
'type': 'sql',
"uri": f"sqlite:///{warehouse_path}/pyiceberg_catalog.db",
"warehouse": f"file://{warehouse_path}",
}
catalog = con.load_catalog(name='local', **params)
table = catalog.load_table("default.test_iceberg")
print(table.scan().to_arrow())
Metadata
Release files for iceduck 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iceduck-0.1.0.tar.gz | 9.0 kB | Without provenance | Details for iceduck-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iceduck-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for iceduck-0.1.0-py3-none-any.whl |
Total release size: 17.4 kB
Release files / iceduck-0.1.0.tar.gz
| Download URL | iceduck-0.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52cd2a95af12abfa74bd120f368c5ab793f612f3e26b4e97ebf102ce76601ed7
|
|
BLAKE2b-256 checksum How to use checksums |
f6103d0a799044edab4170043922340f98528159e955fca5bd29852e9fe88f30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.18
|
Release files / iceduck-0.1.0-py3-none-any.whl
| Download URL | iceduck-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af2062f882b2e90555d614b0904823f12732e3f12a3214fc700cfe9c431be123
|
|
BLAKE2b-256 checksum How to use checksums |
47cbc29e253ef03dd29713352bccc0dd7235197dce60bcb36145b8105c43a399
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.18
|
Security for iceduck 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.