Package to create a database out of files
Project description
dbcreator
The dbcreator
library provides an interface for creating lightweight databases from files. It currently supports duckdb and s3 parquet files, though there are plans to add sqlite and other source file locations and types in the future.
Usage
Creating DuckDB Database from Parquet Files
from flexpath import create_duckdb_database_from_local_parquet
# Example for creating database from S3 Parquet files
create_duckdb_database_from_s3_parquet('target_db.duckdb', FlexPath("s3://bucket-name/prefix"), create_tables=True)
The library assumes a specific file naming convention for schema and table name extraction. For example, a file named
s3://bucket-name/prefix/folder/schemaname_table_name.parquet
will be parsed as a table namedtable_name
in a schema namedschemaname
.
DuckDBConnection
from flexpath import DuckDBConnection
with DuckDBConnection('my_database.duckdb') as con:
# Perform database operations using 'con'
FlexPath
from flexpath import FlexPath
# Example for local path
local_path = FlexPath("/local/path/to/file.parquet")
# Example for S3 path
s3_path = FlexPath("s3://bucket-name/prefix/to/file.parquet")
Installation
pip install dbcreator
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
dbcreator-0.0.2.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for dbcreator-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b471994c363bc3c5e02f4714534c16763b1c9eab277cb207fdff539cc69b08 |
|
MD5 | 4808f21acd6d8468d0c6b8aa0a0f306f |
|
BLAKE2b-256 | 1bce163bce7162042143237cbe71b51df838d95c8d5aec8de0348b417fda872d |