
-----------------
# Sessionize: intutive Python SQL table manipulation toolkit
[](https://pypi.org/project/sessionize/)
## What is it?
**Sessionize** is a Python package that has an intuitive API that utilizes SqlAlchemy to connect to and manipulate records in SQL tables.
## Main Features
Here are just a few of the things that Sessionize does well:
- Quickly and easily start a SQL session to insert, delete, and update records in SQL tables.
- Roll back any changes durring SQL session inside a context manager.
- Additional SQL migration functions for changing or adding primary keys, adding or dropping columns, renaming column and more.
## Where to get it
The source code is currently hosted on GitHub at:
https://github.com/eddiethedean/sessionize
```sh
# PyPI
pip install sessionize
```
## Dependencies
- [sqlalchemy - Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL](https://www.sqlalchemy.org/)
- [alembic - a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python](https://alembic.sqlalchemy.org/)
## Example
```sh
import sqlalchemy as sa
from sessionize import SessionTable
# Create SqlAlchemy engine to connect to database.
engine = sa.create_engine('sqlite:///foo.db')
# Create SessionTable to start session of table changes.
st = SessionTable('people', engine)
# Make changes to SessionTable:
# Add 1 to each value in the age column.
st['age'] + 1
# Update the first record with new values.
st[0] = {'id': 1, 'name': 'Olive', 'age': 18}
# Delete the last record.
del st[-1]
# Commit SessionTable to push changes to SQL table.
st.commit()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/eddiethedean/sessionize",
"name": "sessionize",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Odos Matthews",
"author_email": "odosmatthews@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e0/74/e4722ea3925cdd69eba457ee3892a93f625d8c32022fd3ff28075bd605a3/sessionize-0.0.18.tar.gz",
"platform": null,
"description": "\n-----------------\n\n# Sessionize: intutive Python SQL table manipulation toolkit\n[](https://pypi.org/project/sessionize/)\n\n## What is it?\n\n**Sessionize** is a Python package that has an intuitive API that utilizes SqlAlchemy to connect to and manipulate records in SQL tables.\n\n## Main Features\nHere are just a few of the things that Sessionize does well:\n\n - Quickly and easily start a SQL session to insert, delete, and update records in SQL tables.\n - Roll back any changes durring SQL session inside a context manager.\n - Additional SQL migration functions for changing or adding primary keys, adding or dropping columns, renaming column and more.\n\n## Where to get it\nThe source code is currently hosted on GitHub at:\nhttps://github.com/eddiethedean/sessionize\n\n```sh\n# PyPI\npip install sessionize\n```\n\n## Dependencies\n- [sqlalchemy - Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL](https://www.sqlalchemy.org/)\n- [alembic - a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python](https://alembic.sqlalchemy.org/)\n\n## Example\n```sh\nimport sqlalchemy as sa\nfrom sessionize import SessionTable \n\n# Create SqlAlchemy engine to connect to database.\nengine = sa.create_engine('sqlite:///foo.db')\n\n# Create SessionTable to start session of table changes.\nst = SessionTable('people', engine)\n\n# Make changes to SessionTable:\n# Add 1 to each value in the age column.\nst['age'] + 1\n# Update the first record with new values.\nst[0] = {'id': 1, 'name': 'Olive', 'age': 18}\n# Delete the last record.\ndel st[-1]\n\n# Commit SessionTable to push changes to SQL table.\nst.commit()\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Make changes to sql tables using SqlAlchmey sessions",
"version": "0.0.18",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "985ab0161558c3344ebd8c056938fcaa8fe5f8784fe798840bac016d493a9cb5",
"md5": "134b831008daeb54f2d3c15318f4a3b6",
"sha256": "799466c6b09e6332472f6f1877aa9ee985a51aa07a42f8fec2a26a4dc5b82f8a"
},
"downloads": -1,
"filename": "sessionize-0.0.18-py3-none-any.whl",
"has_sig": false,
"md5_digest": "134b831008daeb54f2d3c15318f4a3b6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 29313,
"upload_time": "2023-01-25T19:53:44",
"upload_time_iso_8601": "2023-01-25T19:53:44.198421Z",
"url": "https://files.pythonhosted.org/packages/98/5a/b0161558c3344ebd8c056938fcaa8fe5f8784fe798840bac016d493a9cb5/sessionize-0.0.18-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e074e4722ea3925cdd69eba457ee3892a93f625d8c32022fd3ff28075bd605a3",
"md5": "1adfe614ab03120615f0e01dc2bd1605",
"sha256": "3b05fcf120d0e0af96a47e0651bf9b9dfb79cf4ef9ab7277b5978bc502f72219"
},
"downloads": -1,
"filename": "sessionize-0.0.18.tar.gz",
"has_sig": false,
"md5_digest": "1adfe614ab03120615f0e01dc2bd1605",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 19147,
"upload_time": "2023-01-25T19:53:47",
"upload_time_iso_8601": "2023-01-25T19:53:47.837533Z",
"url": "https://files.pythonhosted.org/packages/e0/74/e4722ea3925cdd69eba457ee3892a93f625d8c32022fd3ff28075bd605a3/sessionize-0.0.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-25 19:53:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "eddiethedean",
"github_project": "sessionize",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "sessionize"
}