From c8ae72f0725d58f45455c41ad4d5bfade195ff3c Mon Sep 17 00:00:00 2001 From: RichieHakim Date: Wed, 27 Mar 2024 14:37:41 -0400 Subject: [PATCH] rename url functions --- bnpm/sql_helpers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bnpm/sql_helpers.py b/bnpm/sql_helpers.py index 8166b1a..8002e37 100644 --- a/bnpm/sql_helpers.py +++ b/bnpm/sql_helpers.py @@ -6,7 +6,7 @@ import pandas as pd -def format_url( +def make_url( sql_type: str = "mysql", username: str = "root", password: str = "password", @@ -16,8 +16,8 @@ def format_url( quote_password: bool = False, ) -> str: """ - Formats a URL for a SQL database connection. - Works with MySQL, PostgreSQL, and SQLite. + Formats a URL for a SQL database connection.\n + Works with MySQL, PostgreSQL, and SQLite.\n RH 2024 Args: @@ -67,11 +67,12 @@ def format_url( raise ValueError("sql_type must be 'mysql', 'postgresql', or 'sqlite'") -def decompose_url( +def parse_url( url: str ) -> Dict[str, str]: """ - Decomposes a URL for a SQL database connection. + Parses / decomposes a URL for a SQL database connection into its components. + \n RH 2024 Args: