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
Release history Release notifications | RSS feed
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80f2abafd4a763d0b3d9a88f8df11034b728c63926d3f195b4c8acf335f579ee |
|
MD5 | 2cc44b3ad45ac8796a1eccd695ffb597 |
|
BLAKE2b-256 | e4fea5e0ec3d521a476bd06e83f06e613e9e87e81cc345f9f181f0ed3ead9c54 |
Close
Hashes for netlink_sharepoint_alchemy-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 425e9c370673b80c31092d4912c39408710cdf405f78fe7c3c4c96b6b88b8898 |
|
MD5 | 57f5c8f6873d5ad0a9ed4ba728bd73b0 |
|
BLAKE2b-256 | 5ad5ba2753ecf7268fe6310233b8a9b4891a9f94dc3c635768bc4a1aa7592012 |