Skip to main content

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)

Uploaded Source

Built Distribution

pysaltcorn-0.3.1-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page