Integrate Sharepoint and SQL Alchemy
Project description
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.
from netlink.sharepoint.alchemy import Base, User
id
is part of Base
.
Define a mapped list / table like this:
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)
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for netlink-sharepoint-alchemy-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2b4d4f249ab9133963507f63daee6032feccb57c34797424ede00978e7c4e3e |
|
MD5 | c5ddbd6b093c65d1ea8314d16441a103 |
|
BLAKE2b-256 | fd3cc047c84ddd95ba57a8c5c7da84c76485045558897b1f358fbf4f859b8470 |
Close
Hashes for netlink_sharepoint_alchemy-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b157748aef19b54e98316b594896e010006422384df81356af7dc84670a06a4 |
|
MD5 | 10a0fd71a5bea7ce41e7ecf6cb161808 |
|
BLAKE2b-256 | 8a4a6f14148ad388d0d40bca6bd23377465ebfd50acdba918a59bf556c0e55e0 |