Ohmslaw

Latest version: v1.2.0

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

Scan your dependencies

63.31658291457286

>>>


you can calculate the resistors in series, passing the values ​​in the series() method:

python
>>>from ohmslaw import Ohms
>>>
>>>R1, R2, R3 = 280, 450, 100
>>>
>>>o = Ohms()
>>>
>>>series = o.series(R1, R2, R3)
>>>
>>>print("Resistors in series = ", series)
Resistors in series = 830
>>>



**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v1.0.0...v1.1.0

1.2.0

Release Notes


With this new method you find the appropriate combination for your component

python
>>> from ohmslaw import Ohms
>>>
>>> o = Ohms()
>>>
>>> SOURCE_VOLTAGE = 48
>>> COMPONENT_VOLTAGE = 3
>>> COMPONENT_CURRENT = 0.02 Desired current for the component (e.g., LED)
>>>
>>> resistors = [200, 44, 350, 3, 1200, 500]
>>>
>>> best_combination, resulting_voltage = o.best_combination(SOURCE_VOLTAGE, COMPONENT_VOLTAGE, COMPONENT_CURRENT, resistors)
>>>
>>> print(f"Best combination of resistors: {best_combination}")
Best combination of resistors: (3,)
>>> print(f"Resulting voltage on the component: {resulting_voltage:.2f}V")
Resulting voltage on the component: 0.94V
>>>



**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v1.1.0...v1.2.0

1.1.0

Release Notes

In this version, methods have been added, now you can calculate resistors in series and in parallel

To return resistor value in parallel, simply pass the resistors as an argument in the parallel method

python
>>>from ohmslaw import Ohms
>>>
>>>R1, R2, R3 = 280, 450, 100
>>>
>>>o = Ohms()
>>>
>>>parallel = o.parallel(R1, R2, R3)
>>>
>>>print("Resistor in parallel = ", parallel)

1.0.0

Release Notes:

Initial version with
* calculation to find the values ​​of Voltage, Amperage, Resistance, and Find the Value of a resistor for an electrical circuit

example

current multiplied by resistance = voltage

python
>>> o = Ohms()
>>> results = o.volts(I=12, R=4)
>>>
>>> print(results)
48
>>>



**Full Changelog**: https://github.com/JuanBindez/ohmslaw/commits/v1.0.0

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.