semvec/pypi-packages huggingface dataset:
sharepoint-stuff 0.0.6
Package that adds a range of functionality for working with sharepoint sites - under constant development
Keywords: python,sharepoint,upload,sharepoint site,download,office,office365,microsoft,microsoft365,azure,site

# sharepoint-stuff

A package that adds a range of functionality for working with sharepoint sites from python e.g. uploading and downloading of files, creation of folders, etc. Under constant development and change as of January 2023.

## Installation

Run the following to install:

```python
python -m pip install sharepoint-stuff
```

## Usage

```python
from sharepoint_stuff import getCTX, uploadFile

# Initial authentication is necessary for all other functions in this package

ctx = getCTX("SHAREPOINT_URL", "USERNAME", "PASSWORD")

# then you can use that ClientContext (ctx) to authenticate for all the other functions, for example:

# the sharepoint relative url is relative to the name of your site so if you were in the directory -
# https://contoso.sharepoint.com/sites/MAIN_SITE/Shared%20Documents/important_docs then your relative url is "Shared Documents/important_docs/"

# the filepath should include the filename, this is so that the name of the file on sharepoint can be declared seperately to the name of the
# file on the system
uploadFile(ctx, "FILENAME_FOR_SHAREPOINT", "FILEPATH_ON_SYSTEM", "SHAREPOINT_RELATIVE_URL")
```
sculpting 1.0.1
Library for sculpting objects from others
Requires Python: >=3.11
Keywords: library,tools,mapping,utils,data-mapping,annotations,mutability,object-mapping,attribute-mapping,method-mapping,imutability,utils-library

## Sculpting
Library for sculpting objects from others

### Installing
```pip install sculpting```

### Examples
Create an object based on another
```python
from dataclasses import dataclass

from pyhandling import by, then
from sculpting import Sculpture


@dataclass
class User:
    id: int
    username: str
    password: str


original = User(0, "William", "1234")

sculture = Sculpture(
    original,
    name="username",
    password_hash=(getattr |by| "password") |then>> hash
)
```

which is mapped with the original
```python
sculture.name
sculture.password_hash
```
```
William
1670106271132722890
```

even with its modification
```python
sculture.name = "Not William"
original.username
```
```
Not William
```

which can be custom
```python
from sculpting import AttributeMap, changing_attribute_map_for
from sculpting.tools import setting_of_attr


transforming_sculpture = Sculpture(
    original,
    id_of_others=AttributeMap(
        getattr |by| "id_of_others",
        setting_of_attr("id_of_others", value_transformer=tuple)
    ),
    # Shortcut for recording above
    synonym_for_id_of_others=changing_attribute_map_for("id_of_others", tuple)
)

transforming_sculpture.synonym_for_id_of_others = range(1, 5)
original.id_of_others
```
```
(1, 2, 3, 4)
```

using standard tools
```python
from datetime import datetime
from time import sleep

from pyhandling import close, operation_by, eventually, returnly
from sculpting import read_only_attribute_map_as
from sculpting.tools import once


standard_tool_sculpture_from = (
    close(Sculpture)(
        id=read_only_attribute_map_as((getattr |by| 'id') |then>> operation_by('*', 2)),
        creation_time=once(eventually(datetime.now))
    )
    |then>> returnly(getattr |by| "creation_time")
)

standard_tool_sculpture = standard_tool_sculpture_from(original)
print(datetime.now().time(), "- at initialization")

sleep(3)

print(standard_tool_sculpture.creation_time.time(), "- at getting")
```
```
16:10:16.045444 - at initialization
16:10:16.045444 - at getting
```