Metadata-Version: 2.4
Name: sqlbear
Version: 0.1.18
Summary: Wrapper for sqlalchemy engine that provides functions for handoff with pandas
Home-page: https://github.com/readytowin2298/sqlbear
Author: Your Name
Author-email: David Ames <readytowin2298@gmail.com>
License: MIT License
        
        Copyright (c) 2025 David A.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/readytowin2298/sqlbear
Project-URL: Repository, https://github.com/readytowin2298/sqlbear
Project-URL: Issues, https://github.com/readytowin2298/sqlbear/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: pandas>=1.2
Requires-Dist: sqlalchemy>=1.4
Requires-Dist: pytz>=2025
Dynamic: author
Dynamic: classifier
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

SQLBear
========

SQLBear is a lightweight wrapper around SQLAlchemy and Pandas to simplify SQL interactions.

Installation
------------
.. code-block:: bash

    pip install sqlbear

Usage
-----
.. code-block:: python

    from sqlbear import SQLBear
    from datetime import datetime
    # Connects to sqlite database
    connection_str = "sqlite:///example.db"
    sqlbear = SQLBear(connection_str)
    # Query account and user tables
    df = sqlbear.read_sql_query("SELECT * FROM users JOIN account ON users.account = account.id WHERE lastUpdated > DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)")
    # Perform some transformation
    df['added_to_report'] = datetime.now()
    # Write to new or existing sql table, handling new columns, mismatched sql types, timezone issues if present, and duplicates across the user_id column
    nob_bear.put_table(
        'account_users',
        'user_id',
        df,
        ['id','user_id']
    )

Features
--------
- Efficient SQL querying with progress bars
- Automatic handling of time zones and schema updates
- Simple table insertion and schema validation
