Blusutils

Latest version: v0.1.0

Safety actively analyzes 625051 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.0

Huzzah! blusutilspy got new release!
This is first minor release (because it looks like ready for v0.1).
You can get latest version on [PyPi](https://pypi.org/project/blusutils/).

0.0.2

Hey there! This is second minor release. It contatins some fixes, i. e. 'next' from DinfQueue now works properly, Metrics class (information units enum) renamed to a more understandable name and given a greater variety of units.

0.0.1.1

Hey there!

I finally made first release of **blusutils Python library**! No word yet on when the first big release will be, but I'm working on it.

Features of this release:
Switch/Case for Python older 3.10 and with any comparison modes:
py
from blusutils.syntax_constructions import switch

with switch(input('How are you?')) as case:
if case('good'):
...
elif case('bad'):
...
else: default
...


Download time calculation:
py
import blusutils
from blusutils.other import Metrics as metr

print(blusutils.other.calculate_downloading_time(10, 100, [metr.Megabytes, metr.Kilobytes]))
output: 0, 1, 42, 102 (0 hours, 1 minute, 42 seconds, 102 seconds in total to download 10 megabytes with speed 100 kilobytes)


Safeand anywhere raising of exceptions:
py
import blusutils

def ternary(inp: int):
return inp if isinstance(inp, int) else blusutils.other.anywhere_raise(TypeError('inp is not an integer'))
this simular to:
if not isinstance(inp, int):
raise TypeError('inp is not an integer')
return inp

def safe_error():
print(1+1)
blusutils.other.safe_raise(ValueError('Safe'))

def test():
print('Look here!')
safe_error() this will only print exception, but don't stop code
print('still working? okay...')
ternary('Not an integer!') exception


...and any more!

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.