netlink-sharepoint-base


Namenetlink-sharepoint-base JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://gitlab.com/netlink_python/netlink-sharepoint-base
SummaryBasic Tools for interaction with Sharepoint Sites
upload_time2024-02-13 08:11:39
maintainer
docs_urlNone
authorBernhard Radermacher
requires_python>=3.8,<3.12
licenseMIT
keywords sharepoint
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # netlink-sharepoint-base

## Basic Tools for interaction with Sharepoint Sites

This has been moved from `netlink-sharepoint`

For now only **Lists** are considered.

## `sharepoint_list_info`

Script to help mapping

```shell
Usage: sharepoint_list_info.py [OPTIONS] [NAME]...

  Print information about SharePoint List(s)

  NAME is not provided, all lists are returned.

Options:
  -u, --url           TEXT  Sharepoint URL
  -i, --client-id     TEXT  Client ID
  -s, --client-secret TEXT  Client Secret
  -t, --toml          FILE  TOML file with 'url', 'client_id', and 'client_secret'
  -f, --fields              include fields
  --hidden                  include hidden lists (and fields)
```

## `netlink.sharepoint.base.Site`

Main class representing a Sharepoint site. Can either be used directly providing the parameters

- url
- client_id
- client_secret

or inherited from

```python
from netlink.sharepoint.base import Site as _Site


class Site(_Site):
    _url = "https://somewhere.sharepoint.com/sites/something"
    _client_id = "00000000-0000-0000-0000-000000000000"
    _client_secret = "abcdefghijklmnopqrstuvwxyz01234567890+/abcd="
```

### url

_read-only_

### users

_read-only (always a copy of the actual data)_

Dict of the users of the site.

| Column | Type | Description |
|--------|:-----:|-----|
| id | int | reference key for AuthorID, EditorID, etc. |
| family_name | str | a.k.a. last name |
| given_name | str | a.k.a. first name |
| name | str | {family_name}, {given_name} |
| email | str | |

**Note** This is based on a default Sharepoint setup. This might not work for you.

### get_list(name)

Returns a Sharepoint List object (`office365.sharepoint.lists.list.List`) by **name**.

### get_lists(hidden=False)

Returns a list of Sharepoint List objects (`office365.sharepoint.lists.list.List`). If `hidden` is `True`, internal
Lists are included.

### get_list_items(name)

Returns list of all items (`office365.sharepoint.listitems.listitem.ListItem`) from **name**d Sharepoint List.

### get_list_columns(name, hidden=False)

Returns list of columns (a.k.a. Fields) of the **name**d Sharepoint List. If `hidden` is `True`, internal columns are
included.

### commit()

Send all pending updates to Sharepoint.

## `netlink.sharepoint.base.List`

Class representing a Sharepoint List. This is a `collections.abc.Mapping`. Contents are mapped with the unique `id` of
the item in the Sharepoint List.

When inherited from, class attribute

- `_title` must be set.

- `_map` should be set, but can be overridden. This maps the python name (best to use a valid attribute-name)
  to the respective internal Sharepoint name. Do not map 'id' or 'ID', this is done automatically as the primary key.

- `_upper_case` can be set to be used in `normalize` to enforce that the respective columns are set to uppercase.

- `_required` can be set to ensure that the respective columns are not empty (as defined by Python: `None`, empty
  string, or numeric zero).

At this point very optimistic (as in none-at-all) locking is used.

The item itself keeps information if data has been changed.

### load()

Loads all items from the Sharepoint List.

### rollback()

Clears all local entries and calls `load`. At this time there is no difference, but when adding items will be supported,
this would clear them.

### get(item, buffered=True)

Loads (if nor already loaded) item based on unique `id`. If `buffered` is `False`, read from Sharepoint is forced.

### commit()

Commit all changed items to Sharepoint.

### normalize()

Processes `_upper_case` for all items.

Consider overriding this to set columns based on other columns.

### validate()

Processes `_required` for all items.

Consider overriding this to check list-wide constraints, like composite unique keys.

## Item

This is a special class that gets build dynamically for each List. It is a `collections.abc.MutableMapping`.

It handles keeping state of changes and processes the actual mapping between Python and Sharepoint columns (fields).

### commit(lazy=False)

Update the internal `office365.sharepoint.listitems.listitem.ListItem` with any pending changes. If `lazy` is `True`,
changes are not sent to Sharepoint, providing the option to send on List or Site level.

## License

MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/netlink_python/netlink-sharepoint-base",
    "name": "netlink-sharepoint-base",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.12",
    "maintainer_email": "",
    "keywords": "sharepoint",
    "author": "Bernhard Radermacher",
    "author_email": "bernhard.radermacher@netlink-consulting.com",
    "download_url": "https://files.pythonhosted.org/packages/65/8f/474e3c92aba15964634e8400f21c9ccbe5a554acd46325ed5499cb168894/netlink-sharepoint-base-0.0.7.tar.gz",
    "platform": null,
    "description": "# netlink-sharepoint-base\n\n## Basic Tools for interaction with Sharepoint Sites\n\nThis has been moved from `netlink-sharepoint`\n\nFor now only **Lists** are considered.\n\n## `sharepoint_list_info`\n\nScript to help mapping\n\n```shell\nUsage: sharepoint_list_info.py [OPTIONS] [NAME]...\n\n  Print information about SharePoint List(s)\n\n  NAME is not provided, all lists are returned.\n\nOptions:\n  -u, --url           TEXT  Sharepoint URL\n  -i, --client-id     TEXT  Client ID\n  -s, --client-secret TEXT  Client Secret\n  -t, --toml          FILE  TOML file with 'url', 'client_id', and 'client_secret'\n  -f, --fields              include fields\n  --hidden                  include hidden lists (and fields)\n```\n\n## `netlink.sharepoint.base.Site`\n\nMain class representing a Sharepoint site. Can either be used directly providing the parameters\n\n- url\n- client_id\n- client_secret\n\nor inherited from\n\n```python\nfrom netlink.sharepoint.base import Site as _Site\n\n\nclass Site(_Site):\n    _url = \"https://somewhere.sharepoint.com/sites/something\"\n    _client_id = \"00000000-0000-0000-0000-000000000000\"\n    _client_secret = \"abcdefghijklmnopqrstuvwxyz01234567890+/abcd=\"\n```\n\n### url\n\n_read-only_\n\n### users\n\n_read-only (always a copy of the actual data)_\n\nDict of the users of the site.\n\n| Column | Type | Description |\n|--------|:-----:|-----|\n| id | int | reference key for AuthorID, EditorID, etc. |\n| family_name | str | a.k.a. last name |\n| given_name | str | a.k.a. first name |\n| name | str | {family_name}, {given_name} |\n| email | str | |\n\n**Note** This is based on a default Sharepoint setup. This might not work for you.\n\n### get_list(name)\n\nReturns a Sharepoint List object (`office365.sharepoint.lists.list.List`) by **name**.\n\n### get_lists(hidden=False)\n\nReturns a list of Sharepoint List objects (`office365.sharepoint.lists.list.List`). If `hidden` is `True`, internal\nLists are included.\n\n### get_list_items(name)\n\nReturns list of all items (`office365.sharepoint.listitems.listitem.ListItem`) from **name**d Sharepoint List.\n\n### get_list_columns(name, hidden=False)\n\nReturns list of columns (a.k.a. Fields) of the **name**d Sharepoint List. If `hidden` is `True`, internal columns are\nincluded.\n\n### commit()\n\nSend all pending updates to Sharepoint.\n\n## `netlink.sharepoint.base.List`\n\nClass representing a Sharepoint List. This is a `collections.abc.Mapping`. Contents are mapped with the unique `id` of\nthe item in the Sharepoint List.\n\nWhen inherited from, class attribute\n\n- `_title` must be set.\n\n- `_map` should be set, but can be overridden. This maps the python name (best to use a valid attribute-name)\n  to the respective internal Sharepoint name. Do not map 'id' or 'ID', this is done automatically as the primary key.\n\n- `_upper_case` can be set to be used in `normalize` to enforce that the respective columns are set to uppercase.\n\n- `_required` can be set to ensure that the respective columns are not empty (as defined by Python: `None`, empty\n  string, or numeric zero).\n\nAt this point very optimistic (as in none-at-all) locking is used.\n\nThe item itself keeps information if data has been changed.\n\n### load()\n\nLoads all items from the Sharepoint List.\n\n### rollback()\n\nClears all local entries and calls `load`. At this time there is no difference, but when adding items will be supported,\nthis would clear them.\n\n### get(item, buffered=True)\n\nLoads (if nor already loaded) item based on unique `id`. If `buffered` is `False`, read from Sharepoint is forced.\n\n### commit()\n\nCommit all changed items to Sharepoint.\n\n### normalize()\n\nProcesses `_upper_case` for all items.\n\nConsider overriding this to set columns based on other columns.\n\n### validate()\n\nProcesses `_required` for all items.\n\nConsider overriding this to check list-wide constraints, like composite unique keys.\n\n## Item\n\nThis is a special class that gets build dynamically for each List. It is a `collections.abc.MutableMapping`.\n\nIt handles keeping state of changes and processes the actual mapping between Python and Sharepoint columns (fields).\n\n### commit(lazy=False)\n\nUpdate the internal `office365.sharepoint.listitems.listitem.ListItem` with any pending changes. If `lazy` is `True`,\nchanges are not sent to Sharepoint, providing the option to send on List or Site level.\n\n## License\n\nMIT\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Basic Tools for interaction with Sharepoint Sites",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://gitlab.com/netlink_python/netlink-sharepoint-base",
        "Repository": "https://gitlab.com/netlink_python/netlink-sharepoint-base"
    },
    "split_keywords": [
        "sharepoint"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f673d801bc0100320d380333f3db779c911db10eef7c102ad386b504c1975bd0",
                "md5": "c453a636865a2706783369bdf9f49ce2",
                "sha256": "53a2381f816a7b5ab4a22cad925a525e362ee0825f7577e992e8ce649675efcb"
            },
            "downloads": -1,
            "filename": "netlink_sharepoint_base-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c453a636865a2706783369bdf9f49ce2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.12",
            "size": 8577,
            "upload_time": "2024-02-13T08:11:41",
            "upload_time_iso_8601": "2024-02-13T08:11:41.176521Z",
            "url": "https://files.pythonhosted.org/packages/f6/73/d801bc0100320d380333f3db779c911db10eef7c102ad386b504c1975bd0/netlink_sharepoint_base-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "658f474e3c92aba15964634e8400f21c9ccbe5a554acd46325ed5499cb168894",
                "md5": "15ac19bb7a6941069b46b8b31185dba6",
                "sha256": "0d1cbe6a3f454dc8c2957c0435f6126f562379002ea8288e381fac89a5acd256"
            },
            "downloads": -1,
            "filename": "netlink-sharepoint-base-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "15ac19bb7a6941069b46b8b31185dba6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.12",
            "size": 7189,
            "upload_time": "2024-02-13T08:11:39",
            "upload_time_iso_8601": "2024-02-13T08:11:39.527358Z",
            "url": "https://files.pythonhosted.org/packages/65/8f/474e3c92aba15964634e8400f21c9ccbe5a554acd46325ed5499cb168894/netlink-sharepoint-base-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-13 08:11:39",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "netlink_python",
    "gitlab_project": "netlink-sharepoint-base",
    "lcname": "netlink-sharepoint-base"
}
        
Elapsed time: 0.19509s