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.1.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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bellman_tools-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e3ca6f8a5e3925ebc5fc1f1cd5fed6c60f65d02bd4fe93780d2cb7510ef4b008
MD5 b3f68ee0147388ad6292142cf0e6f2eb
BLAKE2b-256 0269ea6454c4b2ad0acc49e62b091e170061b5e099d1b82755430e7664d781a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bellman_tools-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 afdee708892b481b900fcabdb344a69f3ffa4fcd3e583b4e3b6915fe70fbf05e
MD5 c821963988c06a6eb49bf6b939552c7e
BLAKE2b-256 d6de1943e1a8c9797ed1905f66e93cd578e9498ff44d360f07161182dd4aeceb

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