Python library for Saltcorn API
Project description
PySaltcorn
This is python client interface for Saltcorn REST API.
Installation
$ pip3 install pysaltcorn==0.3.1
Usage
>>> import io, pysaltcorn; from pprint import pp
>>> cl = pysaltcorn.SaltcornClient("https://url-encoded-email:password@tenant.saltcorn.com")
>>> cl.login_session()
>>> cl.files_upload({'filename.txt': io.StringIO('file content\n')}, '/foldername/')
True
>>> pp(cl.files_list())
[{'filename': 'foldername',
'location': '/root/.local/share/saltcorn/netbox/foldername',
'uploaded_at': '2023-06-08T12:20:25.323Z',
'size_kb': 4,
'user_id': None,
'mime_super': '',
'mime_sub': '',
'min_role_read': 10,
's3_store': False,
'isDirectory': True}]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pysaltcorn-0.3.1.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for pysaltcorn-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60ae34f9e626200ae55f8445df6c63d0de4c0f864c5f8b658c9d969ad946c732 |
|
MD5 | 528af69b3af17f90b728774c1d563d23 |
|
BLAKE2b-256 | 75eb1b11fddbc99aef69acf9b3e5134201d951b09940744a67ba00f214223804 |