# netlink-sharepoint-alchemy
Integration of Sharepoint and SQL Alchemy
Use the pre-configured Base for Tables that reflect a Sharepoint list, and the ready-made
ORM mapped `User` to access the users of the Sharepoint.
```python
from netlink.sharepoint.alchemy import Base, User
```
`id` is part of `Base`.
Define a mapped list / table like this:
```python
from netlink.sharepoint.alchemy import Base
from sqlalchemy import Column
from sqlalchemy import String
from netlink.alchemy import UnsignedInteger
class Action(Base):
__tablename__ = 'action'
_sharepoint_list_title = "Action"
# fmt: off
action = Column(String, nullable=False, doc='Title')
deadline = Column(UnsignedInteger, nullable=True, doc='Deadline')
comment = Column(String, nullable=True, doc='Comment')
# fmt: on
```
Load data from Sharepoint (non-working, concept only)
```python
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from netlink.sharepoint.base import Site
from netlink.sharepoint.alchemy import Base, User
class ActionControl(Base):
pass
if __name__ == '__main__':
engine = create_engine(f"sqlite+pysqlite:///test.sqlite3", future=True)
Base.metadata.create_all(engine)
sharepoint = Site()
session = Session(engine)
User.bind_to_sharepoint(sharepoint)
User.load_from_sharepoint_list(session)
ActionControl.bind_to_sharepoint(sharepoint)
ActionControl.load_from_sharepoint_list(session)
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/netlink_python/netlink-sharepoint-alchemy",
"name": "netlink-sharepoint-alchemy",
"maintainer": null,
"docs_url": null,
"requires_python": "<=3.12,>=3.8",
"maintainer_email": null,
"keywords": "sharepoint",
"author": "Bernhard Radermacher",
"author_email": "bernhard.radermacher@netlink-consulting.com",
"download_url": "https://files.pythonhosted.org/packages/45/c2/0ce9323df9447eb43eeb08abbbbd055ee8b7be5b44ded48ad3688619a2c5/netlink-sharepoint-alchemy-0.0.6.tar.gz",
"platform": null,
"description": "# netlink-sharepoint-alchemy\n\nIntegration of Sharepoint and SQL Alchemy\n\n\nUse the pre-configured Base for Tables that reflect a Sharepoint list, and the ready-made \nORM mapped `User` to access the users of the Sharepoint.\n\n```python\nfrom netlink.sharepoint.alchemy import Base, User\n```\n\n`id` is part of `Base`.\n\nDefine a mapped list / table like this:\n\n```python\nfrom netlink.sharepoint.alchemy import Base\nfrom sqlalchemy import Column\nfrom sqlalchemy import String\nfrom netlink.alchemy import UnsignedInteger\n\n\nclass Action(Base):\n __tablename__ = 'action'\n _sharepoint_list_title = \"Action\"\n\n # fmt: off\n action = Column(String, nullable=False, doc='Title')\n deadline = Column(UnsignedInteger, nullable=True, doc='Deadline')\n comment = Column(String, nullable=True, doc='Comment')\n # fmt: on\n```\n\nLoad data from Sharepoint (non-working, concept only)\n\n```python\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import Session\n\nfrom netlink.sharepoint.base import Site\nfrom netlink.sharepoint.alchemy import Base, User\n\n\nclass ActionControl(Base):\n pass\n\n\nif __name__ == '__main__':\n engine = create_engine(f\"sqlite+pysqlite:///test.sqlite3\", future=True)\n Base.metadata.create_all(engine)\n sharepoint = Site()\n session = Session(engine)\n\n User.bind_to_sharepoint(sharepoint)\n User.load_from_sharepoint_list(session)\n\n ActionControl.bind_to_sharepoint(sharepoint)\n ActionControl.load_from_sharepoint_list(session)\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Integrate Sharepoint and SQL Alchemy",
"version": "0.0.6",
"project_urls": {
"Homepage": "https://gitlab.com/netlink_python/netlink-sharepoint-alchemy",
"Repository": "https://gitlab.com/netlink_python/netlink-sharepoint-alchemy"
},
"split_keywords": [
"sharepoint"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8946633a24b5afc01af2115aa7f7b8ae666610c8d7f44631138b49ad17afcad3",
"md5": "221d84c2495c537d9cf0f1909c3370bc",
"sha256": "33b5e31a2af0e8ffc836b541d0b26197b024790ceb3d62ee4b18e8526d8816b2"
},
"downloads": -1,
"filename": "netlink_sharepoint_alchemy-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "221d84c2495c537d9cf0f1909c3370bc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<=3.12,>=3.8",
"size": 3921,
"upload_time": "2024-05-16T07:35:59",
"upload_time_iso_8601": "2024-05-16T07:35:59.081863Z",
"url": "https://files.pythonhosted.org/packages/89/46/633a24b5afc01af2115aa7f7b8ae666610c8d7f44631138b49ad17afcad3/netlink_sharepoint_alchemy-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "45c20ce9323df9447eb43eeb08abbbbd055ee8b7be5b44ded48ad3688619a2c5",
"md5": "135da6e0dfe5251b36f1d4183d639f46",
"sha256": "a6c0e6ec44b0b1710393f1d68f129c5344ce48a50b86205e7d76a6180e34246a"
},
"downloads": -1,
"filename": "netlink-sharepoint-alchemy-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "135da6e0dfe5251b36f1d4183d639f46",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<=3.12,>=3.8",
"size": 3856,
"upload_time": "2024-05-16T07:35:57",
"upload_time_iso_8601": "2024-05-16T07:35:57.888394Z",
"url": "https://files.pythonhosted.org/packages/45/c2/0ce9323df9447eb43eeb08abbbbd055ee8b7be5b44ded48ad3688619a2c5/netlink-sharepoint-alchemy-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-16 07:35:57",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "netlink_python",
"gitlab_project": "netlink-sharepoint-alchemy",
"lcname": "netlink-sharepoint-alchemy"
}