this package helps you to manage files in your solid pod
https://solidproject.org/users/get-a-pod
compatible with python 3+
pip install git+https://github.com/zoreu/pysolidpod
from pysolidpod import solid
solid = solid.api()
solid.login('https://yourpod.inrupt.net/', 'username', 'password')
text = 'text example'
solid.put('https://yourpod.inrupt.net/public/example.txt', text)
# replace mode
solid.put('https://yourpod.inrupt.net/public/example.txt', text, replace=True)
solid.create_folder('https://yourpod.inrupt.net/public/new_folder')
# create folder persistently
solid.create_folder('https://yourpod.inrupt.net/public/new_folder/sub_folder/sub_sub_folder')
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(dir_path, 'example.pdf')
solid.upload('https://yourpod.inrupt.net/public', file_path)
# upload in replace mode
solid.upload('https://yourpod.inrupt.net/public', file_path, replace=True)
# delete file
solid.delete('https://yourpod.inrupt.net/public/file.txt')
#delete folder
solid.delete('https://yourpod.inrupt.net/public/folder/')
# notice: solid does not allow deleting folders directly containing files
items = solid.read_folder('https://yourpod.inrupt.net/public/')
# show links
items = solid.read_folder('https://yourpod.inrupt.net/public/', show_links=True)
r = solid.get('https://yourpod.inrupt.net/private/example.txt')
print(r.text) # example text
private - display files only with login
public - show files to everyone