Name | sqlalchemybulk JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | Perform CRUD operations with SQLAlchemy |
upload_time | 2024-08-23 19:31:23 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
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. |
keywords |
database
sqlalchemy
upsert
bulk
orm
crud
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
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": null,
"name": "sqlalchemybulk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "database, sqlalchemy, upsert, bulk, orm, crud",
"author": null,
"author_email": "sudonorm <sudonorm@protonmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f0/8d/860fcf96525910b9f7673250de3aafda7c267e9c8a04f2e5b7619c54fcc2/sqlalchemybulk-0.1.4.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.4",
"project_urls": {
"repository": "https://github.com/sudonorm/sqlalchemy-bulk"
},
"split_keywords": [
"database",
" sqlalchemy",
" upsert",
" bulk",
" orm",
" crud"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9eda2033e9987be74a47e59cd90e47fd7a156464c4cab9d2475a38a8a389ee88",
"md5": "d7ddc7b133d4900b313c79d3610982ba",
"sha256": "2f5b76f0a1a090b22f5938daf9e83d3e0492683c265571e28b4171fe18f53dc2"
},
"downloads": -1,
"filename": "sqlalchemybulk-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7ddc7b133d4900b313c79d3610982ba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 18343,
"upload_time": "2024-08-23T19:31:21",
"upload_time_iso_8601": "2024-08-23T19:31:21.842513Z",
"url": "https://files.pythonhosted.org/packages/9e/da/2033e9987be74a47e59cd90e47fd7a156464c4cab9d2475a38a8a389ee88/sqlalchemybulk-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f08d860fcf96525910b9f7673250de3aafda7c267e9c8a04f2e5b7619c54fcc2",
"md5": "82118f83e895a508d7f5e1da81cdd4ed",
"sha256": "675229b1d2479764bbbda2302915087f30b3de426f75f53bbb6884c2a1697834"
},
"downloads": -1,
"filename": "sqlalchemybulk-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "82118f83e895a508d7f5e1da81cdd4ed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16833,
"upload_time": "2024-08-23T19:31:23",
"upload_time_iso_8601": "2024-08-23T19:31:23.615887Z",
"url": "https://files.pythonhosted.org/packages/f0/8d/860fcf96525910b9f7673250de3aafda7c267e9c8a04f2e5b7619c54fcc2/sqlalchemybulk-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-23 19:31:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sudonorm",
"github_project": "sqlalchemy-bulk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "sqlalchemybulk"
}