Metadata-Version: 2.4
Name: bohr-library
Version: 0.1.1
Summary: Python package to calculate energy levels, orbital radii, and electronic transitions for the Bohr model of hydrogen and hydrogen-like atoms, with educational visualizations.
Author-email: Angie Lorena Pineda Morales <anlopimo580@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Angie Lorena Pineda Morales
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/angielorenapm/Bohr_Library
Project-URL: Bug Tracker, https://github.com/angielorenapm/Bohr_Library/issues
Project-URL: Documentation, https://github.com/angielorenapm/Bohr_Library/wiki
Keywords: bohr,physics,atomic-model,hydrogen,education
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23
Requires-Dist: matplotlib>=3.7
Dynamic: license-file

# Bohr Library

## Description

Bohr Library is a compact educational Python package that implements the Bohr model for hydrogen and hydrogen-like atoms. It provides simple, well-documented tools to compute electron energy levels (eV), orbital radii (Å), and properties of electronic transitions (ΔE, photon frequency and wavelength). The package also includes utilities to generate visualizations (PNG) of energy levels and electron orbits for teaching and demonstration purposes.

## Current state

Version: **0.1.0**.

The repository contains readable, pedagogical scripts under `src/`: `energy.py` (energy-level calculator), `radius.py` (Bohr radii), `transition.py` (transition energies and photon properties), and `plot_orbits.py` (visualizer that saves PNG files). A simple `main.py` dispatches those scripts via an interactive menu. Several functions are already usable programmatically (for example `RadiusCalculator.calculate(...)` and `ModeloBohrTransiciones.calcular_energia_nivel(...)`).

Note: the radius module uses `scipy.constants` for physical constants. If you plan to install the package from PyPI or use it as a library, ensure `scipy` is available.

# Objectives

Short-term: keep the code readable and educational, provide a stable programmatic API (non-interactive wrappers), and publish the package on PyPI so users can install it with a single command.

# Usage (primary installation method: PyPI)

The recommended installation path is via PyPI. Install the package with pip and import the library from your Python scripts. This README provides a single, minimal example showing the PyPI installation method and one short usage snippet.

Install from PyPI:

```bash
pip install bohr-library
```

Single example after installing from PyPI (minimal, non-interactive):

```python
# simple_example.py
# After installing via: pip install bohr-library
from src.transition import ModeloBohrTransiciones
from src.radius import RadiusCalculator


Z = 1 # Hydrogen
n = 1 # ground state


trans = ModeloBohrTransiciones()
energy_ev = trans.calcular_energia_nivel(Z, n)


radius_calc = RadiusCalculator()
radius_A = radius_calc.calculate(Z, n)


print(f"Hydrogen n={n} energy: {energy_ev:.4f} eV")
print(f"Hydrogen n={n} Bohr radius: {radius_A:.4f} Å")
```

# Minimal API reference

`RadiusCalculator.calculate(Z, n)` — returns the Bohr radius for a hydrogen-like ion in Angstroms (Å).

`ModeloBohrTransiciones.calcular_energia_nivel(Z, n)` — returns the energy of level `n` in electronvolts (eV).

`AtomVisualizer.plot_energy_levels(energies, transitions=None, filename=None)` — saves an energy-level plot to `filename` if provided.

`AtomVisualizer.plot_orbits(radii, filename=None)` — saves an orbit plot to `filename` if provided.

# Requirements and compatibility

* Python: >= 3.8
* Required packages: `numpy`, `matplotlib`, and `scipy` (for `scipy.constants`) — install these before or while installing the package:

```bash
pip install numpy matplotlib scipy
```

# Known issues and recommendations

* Many scripts use interactive `input()` calls. For automation and testing, call the non-interactive methods directly (e.g., `calculate`, `calcular_energia_nivel`) or add small wrapper functions that accept arguments instead of reading from STDIN.
* Update `pyproject.toml` to include `scipy` in `dependencies` before publishing to PyPI.

# Contributing & License

The project metadata indicates an MIT license. Contributions are welcome via cloning the repository, creating a branch, and opening a pull request. Suggested improvements: add unit tests, provide non-interactive API wrappers, tidy packaging so installed import paths are consistent, and add documentation pages or notebooks.

---
