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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6c0e6ec44b0b1710393f1d68f129c5344ce48a50b86205e7d76a6180e34246a |
|
MD5 | 135da6e0dfe5251b36f1d4183d639f46 |
|
BLAKE2b-256 | 45c20ce9323df9447eb43eeb08abbbbd055ee8b7be5b44ded48ad3688619a2c5 |
Close
Hashes for netlink_sharepoint_alchemy-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33b5e31a2af0e8ffc836b541d0b26197b024790ceb3d62ee4b18e8526d8816b2 |
|
MD5 | 221d84c2495c537d9cf0f1909c3370bc |
|
BLAKE2b-256 | 8946633a24b5afc01af2115aa7f7b8ae666610c8d7f44631138b49ad17afcad3 |