Skip to main content

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 named table_name in a schema named schemaname.

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


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)

Uploaded Source

Built Distribution

dbcreator-0.0.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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