shareplum | Pythonic SharePoint | Content Management System library
kandi X-RAY | shareplum Summary
kandi X-RAY | shareplum Summary
Pythonic SharePoint
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a new list
- Sends an HTTP POST request
- Return the URL for a given service
- Return headers for the given SOAP action
- Update list items
- Return the value of the field
- Convert data to internal format
- Generate headers for a SOAP action
- Compute a dictionary with all the keys in a dictionary
- Check in a file
- Checkout a file
- Get cookies from SecurityCenter
- Get the JSON representation of the list
- Delete folder from server
- Creates a new folder
- Creates a new Field
- Gets the site information
- Gets the collection for a list
- Get list of templates
- Returns a list of site templates
- Get list of attachments
- Gets information about the current list
- Finds the differences between two dictionaries
- Get a specific version collection
- Get list of users
- Returns the context information
shareplum Key Features
shareplum Examples and Code Snippets
Community Discussions
Trending Discussions on shareplum
QUESTION
I am trying to insert this value into SQL Server table and I'm not sure is this supposed to be a list or a dictionary.
For some context I am pulling the data from a Sharepoint list using shareplum with code like this
...ANSWER
Answered 2021-Apr-16 at 12:30convert your list of dictionaries to a list or tuple of the dictionary values.
I've done it below using list comprehension to iterate through the list and the values()
method to extract the values from a dictionary
QUESTION
Unable to upload the file in SharePoint, since yesterday the code is working fine used stored file in Sharepoint now am getting the below error:
Exception: ('Error authenticating against Office 365. Error from Office 365:', 'AADSTS50055: The password is expired.')
The same thing happened for the other two accounts even.
The function uploadMeta_file(filepath_meta)
to call Sharepoint
...File "c:\Users\Desktop\work\sample\cookiepopup-kana-api.venv\lib\site-packages\shareplum\office365.py", line 80, in get_security_token raise Exception('Error authenticating against Office 365. Error from Office 365:', message[0].text) Exception: ('Error authenticating against Office 365. Error from Office 365:', 'AADSTS50055: The password is expired.')
ANSWER
Answered 2021-Jan-27 at 08:08Like you mentioned there is MFA enabled for your account. Looks like you have not handled the same in your application.
There 2 ways to go about this.
Provide Interactive logon UI for handling the MFA.
Create a service account which has the MFA disabled. Thereby using this account to access the Sharepoint Online, you will not encounter the above issue.
Using App Only Authentication
What are Sharepoint app only ?
App only authentication - will not require user credentials but you can get the data by authenticating the App. And Also, app authentication will indirectly bypass MFA (App only authentication are not subjected to MFA).
More information : https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
I was reading through the Shareplum Tutorials - Unfortunately, but could not get the way to do the App Only Authentication. But you could double check at your end.
If your goal is to use python, you can also use the below library :
https://pypi.org/project/Office365-REST-Python-Client/#Working-with-SharePoint-API
To perform the app only authentication :
QUESTION
Error Screenshot:
Hello Everyone,
I am trying to set up a connection to SharePoint list so I can read/write data to SharePoint. Below is the following code that I have ran to form a connection using SharePlum library. I am running the same exact code as the library suggests with my credentials and url but I get this error which I can't see to find online anywhere. I would really appreciate if you can help me fix this. Thanks.
...ANSWER
Answered 2020-Jul-24 at 07:08It seems that you're trying to connect to SP online. Please specify Version parameter then try it again.
QUESTION
I have accessed a list in SharePoint Online with Python and want to save the list data to a file (csv or json) to transform it and sort some metadata for a migration
I have full access to the Sharepoint site I am connecting(client ID, secret..).
...ANSWER
Answered 2020-Jun-23 at 21:40Idea 1
It's hard to tell what can go wrong without the error trace. But I suspect it's likely to do with malformed data that you are passing as the argument. See here from the documentation to know exactly what's expected.
Do also consider updating your question with relevant stack error traces.
Idea 2
JSONDecodeError: Extra data: line 1 column 5 (char 4)
This error simply means that the Json
string is not a valid format. You can validate JSON strings by using this service. This often tells you the point of error which you can then use it to manually fix the problem.
This error could also be caused if the object that is being parsed is a python object. You can avoid this by jsonifying
each line as you go
QUESTION
Using Python with Django and accessing my SharePoint list via SharePlum.
In SharePoint the description field is Rich Text. When I bring that into my template file using Django it is still showing tags. For example:
...ANSWER
Answered 2020-Jun-10 at 20:50Found the answer. I went into SharePoint List Settings on Office 365 and changed it from Enhanced Rich Text to just Rich Text and it is showing properly now in my web app.
That was a good enough answer for my needs.
QUESTION
I need to save a sharepoint list as an excel/ csv file. To do so, I have followed following two SO links,
Get SharePoint List with Python
SharePlum error : "Can't get User Info List"
My code look like this,
...ANSWER
Answered 2020-May-27 at 01:05Sample demo to use Office365-REST-Python-Client to get SharePoint list data and output as excel.
QUESTION
I am using SharePlum to work with Sharepoint files/folder operations. I am able to create a folder and uplaod files with Shareplum. But I am not able to download a file. The code runs without any problem. I am not sure where the file gets downloaded.
...ANSWER
Answered 2020-May-27 at 02:02Sample demo:
QUESTION
What I want is uploading file to specific directory in the sharepoint via API and using python.
Here is my code:
...ANSWER
Answered 2020-May-13 at 09:44Please take a reference of below sample, i have tested it on my SPO environment.
QUESTION
'm trying to upload a file using Python Script, when Run the code it gives me no Error but was not able to upload the file in my sharepoint folder.
...ANSWER
Answered 2019-Nov-28 at 07:10Modify the code as below.
QUESTION
I have created a code to pull data from sharepoint and it works like charm on my local environment (Spyder Python 3.6). But when I try to deploy it on production environment (Python 2.7.12), it fails for a missing package cryptography. When I try to add cryptography from github to library of Python 2.7, it fails missing the file _constant_time. But when I try to copy library files from anaconda (python 3.6 ) to production (python 2.7), the _constant_time file is there but it now shows cannot import lib error.
Why is there difference in files on github and anaconda for cryptography library and how to fix the issue? PS- I can't change the version of production from Python 2.7
...ANSWER
Answered 2019-Jun-29 at 01:14The simple answer: Cryptography has several different builds between what your production server would recognize and what you tried to grab from Github (As an example, Anaconda has several 2.7.x build options of cryptography, 15 to be precise https://anaconda.org/anaconda/cryptography/files) which makes sense because you are trying to use two different Python languages and forcing them to interact but they don't understand each other.
Think of your problem like this: Imagine trying to have a conversation in English (or any language for that matter) with someone from the 1800s - technically you two are speaking the same language but you wouldn't understand each other as over the course of two hundred years because the language has evolved in complexity and meaning. For reference, Python 2.7.0 was released in July 2010, Python 3.7 was released 2017.
There is a hard way and a easier way to resolve this problem.
The harder way is: Find the exact Python build of production server, download that 2.7.x version from Github or Anaconda. Then delete your current version of cryptography, install the compatible version of cryptography. Then make sure Anaconda recognizes the new branch, implement it your code and it should make it work on your production server. You will have to do some trial and error to get it right because other packages may have dependence issues with your older version of cryptography. Which given what you presented as your solution is what I believe you attempted.
However, to avoid your current frustration, there is an easier way: build a virtual environment for Python 2.7.x on your machine that matches the production server.
I would specifically use virtualenv, pip install your packages, then implement your code through it. That way your code and the production server use the same Python. I will add this small caveat: You may need to rewrite some of your code to make it work, because again, you built the code using the language of 2017, but you are conversing with the Python of 2010.
I'll get you started down the path with how to setup it up below, but I highly recommend reading the Python.org virtual environment page to educate yourself for future development (there are numerous articles and reference guides as well out there but start with the source): (https://docs.python.org/3/tutorial/venv.html)
To set up the virtual environment - pull up terminal and type the following below:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shareplum
You can use shareplum like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page