sqlalchemybulk


Namesqlalchemybulk JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryPerform CRUD operations with SQLAlchemy
upload_time2024-01-17 12:37:54
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2024 sudonorm 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.
keywords database sqlalchemy upsert bulk orm crud
VCS
bugtrack_url
requirements pandas numpy SQLAlchemy alembic packaging bumpver build twine ipykernel notebook python-dotenv
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sqlalchemy-bulk
==================

*Perform Create, Update, Read, and Delete operations easily using the SQLAlchemy orm*

---

Installation
-------------

To install via pip::

    pip install sqlalchemybulk

Or download the source code and install manually::

    git clone https://github.com/sudonorm/sqlalchemy-bulk.git
    cd sqlalchemy-bulk/
    python -m pip install .

Or download the dource code and use the `setup.py` file::

    git clone https://github.com/sudonorm/sqlalchemy-bulk.git
    cd sqlalchemy-bulk/
    python setup.py install

Basic usage
-----------

.. code:: python

    from sqlalchemybulk.crud_helper_funcs import UploadData, DownloadData, DeleteData
    import pandas as pd
    from sqlalchemy import select, delete
    from tests.sample_data.dataModel import engine
    from tests.sample_data import dataModel

    ## Insert (Create) or Update
    upload_data = UploadData(engine=engine)
    returned_ids = upload_data.upload_info_atomic(dbTable='dataModel.Address', df=df, unique_idx_elements=['name', 'postalZip'], column_update_fields=['address', 'country', 'suptext', 'numberrange', 'currency', 'alphanumeric'])

    ## Download (Read)
    download_data = DownloadData(engine=engine)

    ### query full table
    query = select(dataModel.Address)
    result = download_data.download_info_using_session(statement=query)

    ### query with filter
    query = select(dataModel.Address).where(dataModel.Address.postalZip == "3778")
    result = download_data.download_info_using_session(statement=query)

    ## Delete
    delete_data = DeleteData(engine=engine)
    query = delete(dataModel.Address).where(dataModel.Address.postalZip == "15143")
    delete_data.delete_data_on_condition(dbTable="dataModel.Address", statement=query)

Bugs, requests, questions, etc.
-------------------------------

Please create an `issue on GitHub <https://github.com/sudonorm/sqlalchemy-bulk/issues>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sqlalchemybulk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "database,sqlalchemy,upsert,bulk,orm,crud",
    "author": "",
    "author_email": "sudonorm <sudonorm@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d9/9e/6c90c5d765eac39c79c2bff898272711b84ea6a7a63f2a44f6dd65af5152/sqlalchemybulk-0.1.2.tar.gz",
    "platform": null,
    "description": "sqlalchemy-bulk\n==================\n\n*Perform Create, Update, Read, and Delete operations easily using the SQLAlchemy orm*\n\n---\n\nInstallation\n-------------\n\nTo install via pip::\n\n    pip install sqlalchemybulk\n\nOr download the source code and install manually::\n\n    git clone https://github.com/sudonorm/sqlalchemy-bulk.git\n    cd sqlalchemy-bulk/\n    python -m pip install .\n\nOr download the dource code and use the `setup.py` file::\n\n    git clone https://github.com/sudonorm/sqlalchemy-bulk.git\n    cd sqlalchemy-bulk/\n    python setup.py install\n\nBasic usage\n-----------\n\n.. code:: python\n\n    from sqlalchemybulk.crud_helper_funcs import UploadData, DownloadData, DeleteData\n    import pandas as pd\n    from sqlalchemy import select, delete\n    from tests.sample_data.dataModel import engine\n    from tests.sample_data import dataModel\n\n    ## Insert (Create) or Update\n    upload_data = UploadData(engine=engine)\n    returned_ids = upload_data.upload_info_atomic(dbTable='dataModel.Address', df=df, unique_idx_elements=['name', 'postalZip'], column_update_fields=['address', 'country', 'suptext', 'numberrange', 'currency', 'alphanumeric'])\n\n    ## Download (Read)\n    download_data = DownloadData(engine=engine)\n\n    ### query full table\n    query = select(dataModel.Address)\n    result = download_data.download_info_using_session(statement=query)\n\n    ### query with filter\n    query = select(dataModel.Address).where(dataModel.Address.postalZip == \"3778\")\n    result = download_data.download_info_using_session(statement=query)\n\n    ## Delete\n    delete_data = DeleteData(engine=engine)\n    query = delete(dataModel.Address).where(dataModel.Address.postalZip == \"15143\")\n    delete_data.delete_data_on_condition(dbTable=\"dataModel.Address\", statement=query)\n\nBugs, requests, questions, etc.\n-------------------------------\n\nPlease create an `issue on GitHub <https://github.com/sudonorm/sqlalchemy-bulk/issues>`_.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 sudonorm  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. ",
    "summary": "Perform CRUD operations with SQLAlchemy",
    "version": "0.1.2",
    "project_urls": {
        "repository": "https://github.com/sudonorm/sqlalchemy-bulk"
    },
    "split_keywords": [
        "database",
        "sqlalchemy",
        "upsert",
        "bulk",
        "orm",
        "crud"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2287536b0c9833547ed175930561a1d4f3442956669030ded59175d72241a632",
                "md5": "0efedf53a2cbd2b12d1357ed23e8e1d3",
                "sha256": "1f1f40d10e4978a0f079efab3e8ee2975d875b41b36a718ff9ddfdb71de0adf9"
            },
            "downloads": -1,
            "filename": "sqlalchemybulk-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0efedf53a2cbd2b12d1357ed23e8e1d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 18284,
            "upload_time": "2024-01-17T12:37:52",
            "upload_time_iso_8601": "2024-01-17T12:37:52.549297Z",
            "url": "https://files.pythonhosted.org/packages/22/87/536b0c9833547ed175930561a1d4f3442956669030ded59175d72241a632/sqlalchemybulk-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d99e6c90c5d765eac39c79c2bff898272711b84ea6a7a63f2a44f6dd65af5152",
                "md5": "5214b9b59f078f761020f05cf4f57832",
                "sha256": "09ff6511e022c09099555dc98df92c2fe6b83f687d7451a2a52c57dd42e81e9d"
            },
            "downloads": -1,
            "filename": "sqlalchemybulk-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5214b9b59f078f761020f05cf4f57832",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 17416,
            "upload_time": "2024-01-17T12:37:54",
            "upload_time_iso_8601": "2024-01-17T12:37:54.624216Z",
            "url": "https://files.pythonhosted.org/packages/d9/9e/6c90c5d765eac39c79c2bff898272711b84ea6a7a63f2a44f6dd65af5152/sqlalchemybulk-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 12:37:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sudonorm",
    "github_project": "sqlalchemy-bulk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "SQLAlchemy",
            "specs": []
        },
        {
            "name": "alembic",
            "specs": []
        },
        {
            "name": "packaging",
            "specs": []
        },
        {
            "name": "bumpver",
            "specs": []
        },
        {
            "name": "build",
            "specs": []
        },
        {
            "name": "twine",
            "specs": []
        },
        {
            "name": "ipykernel",
            "specs": []
        },
        {
            "name": "notebook",
            "specs": []
        },
        {
            "name": "python-dotenv",
            "specs": []
        }
    ],
    "lcname": "sqlalchemybulk"
}
        
Elapsed time: 0.17513s