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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3150618e06a06ca96ae3322ea5347d732a412422e22b3b67a02dc2a175b6ea19 |
|
MD5 | a83318b32af0b9ff5300c2ddd37a22e5 |
|
BLAKE2b-256 | de3f334c47b303f2121a682f401779dedd1fd3b8cfe7459ae799229e3ea6c0fe |
Close
Hashes for netlink_sharepoint_alchemy-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 124954f1276a8307cf1bc9936e9e5c228040acb905b82b50b72704b1b369f74e |
|
MD5 | 59bfb03e647998b29030ec3c348f5e96 |
|
BLAKE2b-256 | 1af7a76bc492fbc7b2e22efc3f46750f9c7b4f68212e3e7653a24c5029a7cff9 |