Skip to main content

bellman_tools

Project description

Bellman Tools (bellman_tools)

Python tools to upload data into SQL Server using SQL Alchemy

Installation

  • pip install bellman-tools

Usage

SQL Tools

To retrieve data from a SQL Server. You need first to add connection string to the .env file in the project root folder.

Example of the .env file:

DATABASE_CONNECTION_STRING="mssql+pyodbc://user:password@server_name:1433/{db}?driver=SQL+Server"

Then you can execute this python code :

from bellman_tools import sql_tools
SQL = sql_tools.Sql(db='DB')
df = SQL.load_dataframe_from_query("SELECT TOP 1 * FROM Test")

Notes on environment loading

  • bellman_tools.sql_tools looks for a .env file only in your current working directory (typically your project root) when it is imported. If it does not find one, it prints the current directory and continues.
  • Best practice is to set environment variables outside of your code (shell, CI/CD secrets, process manager). The .env loading is a convenience fallback.

Upload Tools

To upload data into a SQL Server database.

import pandas as pd
from bellman_tools import sql_tools, upload_tools

SQL = sql_tools.Sql(db='SAM')
UPLOAD = upload_tools.Upload(SQL)

from bellman_tools.database import Test

df = pd.DataFrame([dict(Test='Testing with Upload tools')])

UPLOAD.load_basic_df_to_db(
    df,
    SQL_Alchemy_Table=Test.Test,
)

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

bellman_tools-0.1.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bellman_tools-0.1.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file bellman_tools-0.1.3.tar.gz.

File metadata

  • Download URL: bellman_tools-0.1.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for bellman_tools-0.1.3.tar.gz
Algorithm Hash digest
SHA256 48a6fdca359a5efa26472707ddff6363d8f03486ff1a83df14a5a850e7de4147
MD5 6982667f15d858a4444f8d2f2cdf3880
BLAKE2b-256 4b95a51254da0eb52fa7e167808e86f9303e8bb7a992fc6b9885bd5ef94c23b6

See more details on using hashes here.

File details

Details for the file bellman_tools-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: bellman_tools-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for bellman_tools-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 14d39f84deaf5ebec24e7db51bea323500a496e54028070cf31ed382fd3ebb70
MD5 3a96945cb99c95e5bd67086e451e013d
BLAKE2b-256 101d4f563f53cc1bed9b2533dcac948710f8df2d18f60e85763da5e24d7c362b

See more details on using hashes here.

Supported by

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