A console ui interface
Project description
Schnittstelle
Installation
pip install schnittstelle
Import
# completer
from schnittstelle import Completer, CompleterStyle, RunnableCompleter
# loader
from schnittstelle import Loader, LoaderStyle, RunnableLoader
# decorators
from schnittstelle import decorators
Completer
[✓] complete
[X] fail
While completer is drawing to print use
completer.print('string to print')
-
Use
withstatementRecommended
with Completer(message='Dummy bar') as completer: # code pass
The object will auto complete when on exiting
withstatementYou may also exit using
completer.completeorcompleter.fail()Decorator
from schnittstelle import decorators @decorators.Completer(message='foo bar') def foo(s): # code
Everytime the function is called Completer will appear
In case of exception it is caught and runs the fail method of completer
Using this method you're not able to access completer class itself
Inline
completer = Completer().init() # code completer.complete() # or completer.fail()
Exit the completer using
completer.completeorcompleter.fail()Runnable
Not recommended
def foo(s): # code runnable = RunnableCompleter(foo, message='foo bar') runnable.run('foo')
All arguments go into run method
In case of exception it is caught and runs the fail method of completer
Using this method you're not able to access completer class itself
-
Configuration
-
Takes in class CompleterStyle
CompleterStyle
Static Constuctors
defaultdefault settingsAttributes
prefixcharacter before char
default: [
postfixcharacter after char
default: ]
successcolor of character when successful
default: GREEN
errorcolor of character when unsuccessful
default: RED
infocolor of character in info messages
default: BLUE
-
Loader
This is the progress bar class of package
[== ] Dummy bar
While the progress bar is in progress to print use
loader.print('string to print')
-
Use
withstatementRecommended
with Loader(message='Dummy bar') as loader: # code pass
The bar will auto complete when on exiting
withstatementYou may also exit using
loader.completeorloader.fail()Decorator
from schnittstelle import decorators @decorators.Loader(message='foo bar') def foo(s): # code
Everytime the function is called loader will appear
In case of exception it is caught and runs the fail method of loader
Using this method you're not able to access loader class itself
Inline
loader = Loader().init() # code loader.complete() # or loader.fail()
Exit the progress bar using
loader.completeorloader.fail()Runnable
Not recommended
def foo(s): # code runnable = RunnableLoader(foo, message='foo bar') runnable.run('foo')
All arguments go into run method
In case of exception it is caught and runs the fail method of loader
Using this method you're not able to access loader class itself
-
Configurations
To change the configurations at runtime use
loader.brush.[configuration]syntaxconfigurations need to be passed into class initiator as keyword arguments
-
value
Current value of progress
If this value is less than 0, the progress bar is
indeterminate -
total
Total progress for the bar
-
message
Message label to display on progress bar
In the above example it is Dummy bar
-
frequency
Number of refreshes per second
This will determine the
speedof the progress bar as wellIf frequency is too low, progress bar might not show progress as intended
defaultis 20 refreshes per sec -
Takes in class LoaderStyle
LoaderStyle
Static Constuctors
defaultdefault settingsasciionly containing ascii charsAttributes
widthwidth of the progress bar
default: 5
cursor_widthFill width of indeterminate progress bar
default: 3
fillFill indicator charactor
default: FULL_BLOCK
emptyempty indicator charactor
default: SPACE
prefixcharacter before progress bar
default: [
postfixcharacter after progress bar
default: ]
-
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file schnittstelle-0.1.0.tar.gz.
File metadata
- Download URL: schnittstelle-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12a90f360d63f9cbed239ab3cfde6edbb936f00238a00c4a869ed9034c7e2dcf
|
|
| MD5 |
b7248f323f5d84a3a8f4a2f8642bbac6
|
|
| BLAKE2b-256 |
1b9a539f5dbbe426a1184b27ceccdfc05fd8dc44c2eb32a96ff0a8a5fe9e1cf4
|
File details
Details for the file schnittstelle-0.1.0-py3-none-any.whl.
File metadata
- Download URL: schnittstelle-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d6b0e535d48559162f9b3431ce6db0e4004a59dbf3aee4ab61640c439c60ab5
|
|
| MD5 |
635ab6c17013a929a00c045af109ab11
|
|
| BLAKE2b-256 |
90d300fe6cfe8623e59d1a36a5025800cad230b253f35c2ff023847ce278f938
|