Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
streamlit-quantity-text-input
Advanced tools
Streamlit input field that uses the pint library for parsing quantities
This Python module gives you a Streamlit text input field (like st.text_input
) for entering and processing concentrations, volumes, amounts ect. in free-text, yet in an input-safe manner.
The quantity_text_input field uses the pint library to parse the user's input as a quantity (volume, speed, concentration etc.).
$ pip install streamlit-quantity-text-input
from streamlit_quantity_text_input import quantity_text_input
vol = quantity_text_input(
"Please input a volume:",
mandatory_dimension="volume",
output_unit="ml",
lower_limit="0 l")
print(f"You input volume is: {vol if vol else 'pending'}")
Check out the accompanying demo.py
for a more detailed example and documentation.
Wanted but not yet planned:
Test cases: Unit tests, perhaps via the doctest module.
Flag: relaxed_time_input
. Implement a flag to allow a much broader range of types of time inputs to be parsed correctly, consistently (e.g. 1h45
, 1hrs3minutes
, 2wks60'45"
etc.). Bonus points for offering a solution that also addresses Danish spellings (perhaps as a pre-parser).
Fool-profing the math parser: The pint library treats scalars and units equally, which can lead to some unexpected parsing when mixing scalars and units (1 m / 2 s
parses into 1*m/2*s
=½ m*s
, not ½ m/s
). Presumably, this can be fixed by tokenizing the input string and 'gluing' scalars and their abutting unit(s) together with parenthesis (((1*m)/(2*s))
). However, writing the tokenizer could be non-trivial.
See LICENSE.txt
New as of April 2024.
FAQs
Streamlit input field that uses the pint library for parsing quantities
We found that streamlit-quantity-text-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.