https://github.com/protonmail/pyprotonrebar
https://github.com/protonmail/pyprotonrebar
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/protonmail/pyprotonrebar
- Owner: ProtonMail
- License: other
- Created: 2024-02-20T12:39:40.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-21T14:15:03.000Z (almost 2 years ago)
- Last Synced: 2025-04-22T19:57:43.496Z (about 1 year ago)
- Language: Python
- Size: 31.3 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
========
Overview
========
Interact with the RackN Digital Rebar API (in a way that's useful *to
us*).
* Free software: Apache Software License 2.0
Installation
============
::
pip install pyprotonrebar
You can also install the in-development version with::
pip install git+ssh://git@github.com/ProtonMail/pyprotonrebar.git@main
Documentation
=============
While primarily intended as common code for
https://github.com/ProtonMail/proton.rackndr, it can also be used as is.
For example, to use the project to create a new Param:
.. code-block:: python
import pyprotonrebar.pyrackndr
TOKEN = pyprotonrebar.pyrackndr.fetch_token_requests(
'superuser',
'user:pass',
'https://localhost:8092')
AUTH = TOKEN['header']
rebar_object = pyprotonrebar.pyrackndr.RackNDr(
'https://localhost:8092',
AUTH,
'params')
data = pyprotonrebar.CONSTANTS['params'].copy()
data['Description'] = 'new-param description goes here'
data['Documentation'] = 'new-param documentation goes here'
data['Name'] = 'new-param'
data['Secure'] = False
data['Schema'] = {
'type': 'string',
'default': 'hello'
}
rebar_object.create(data)
Development
===========
To run all the tests run::
tox
Note, to combine the coverage data from all the tox environments run:
.. list-table::
:widths: 10 90
:stub-columns: 1
- - Windows
- ::
set PYTEST_ADDOPTS=--cov-append
tox
- - Other
- ::
PYTEST_ADDOPTS=--cov-append tox