Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juanbindez/ohmslaw
Python3 library for calculations using Ohm's law
https://github.com/juanbindez/ohmslaw
calculator ohms ohms-law
Last synced: 3 days ago
JSON representation
Python3 library for calculations using Ohm's law
- Host: GitHub
- URL: https://github.com/juanbindez/ohmslaw
- Owner: JuanBindez
- License: gpl-2.0
- Created: 2024-05-16T01:07:58.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T17:25:44.000Z (4 months ago)
- Last Synced: 2024-10-11T21:58:52.291Z (about 1 month ago)
- Topics: calculator, ohms, ohms-law
- Language: Python
- Homepage: https://ohmslaw.readthedocs.io
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ohmslaw
![PyPI - Downloads](https://img.shields.io/pypi/dm/ohmslaw)
![PyPI - License](https://img.shields.io/pypi/l/ohmslaw)
[![Documentation Status](https://readthedocs.org/projects/ohmslaw/badge/?version=latest)](https://ohmslaw.readthedocs.io/en/latest/?badge=latest)
![GitHub Tag](https://img.shields.io/github/v/tag/JuanBindez/ohmslaw?include_prereleases&link=https%3A%2F%2Fgithub.com%2FJuanBindez%2Fohmslaw%2Ftags)### Python3 library for calculations using Ohm's law
#### Ohms law is an important and fundamental rule to remember when working with resistors and electronics in general. It defines the relationship between the components’ current I in amps (A), voltage V in volts (V) and resistance R in ohms (Ω). Ohm’s law consists of three mathematical equations that explain the relationship between current, voltage and resistance. If you know two of these values.
## Quickstart:
### install
pip install ohmslaw
### import
```python
from ohmslaw import Ohms
```### 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
>>>
```### current multiplied by resistance = voltage
```python
>>> o = Ohms()
>>> results = o.volts(I=12, R=4)
>>>
>>> print(results)
48
>>>```
### voltage Divided by resistance = current
```python
>>> o = Ohms()
>>> results = o.current(V=12, R=4)
>>>
>>> print(results)
3.0
>>>
```### voltage divided by current = resistance
```python
>>> o = Ohms()
>>> results = o.resistance(V=48, I=4)
>>>
>>> print(results)
12.0
>>>```
### Watts
```python
>>> o = Ohms()
>>> results = o.watts(I=2, R=15)
>>>
>>> print(results)
60
>>>```