This Python package calculates the estimated flux of electrons or protons trapped in the Earth's radiation belt. It is a Python wrapper for the NASA AE8/AP8 model in the IRBEM package. It provides an Astropy-friendly interface, allowing you to specify the location using Astropy coordinates, the time in Astropy time, and the energy using Astropy units. You can pass it a single time and location, or arrays of times and locations.
pip install aep8
>>> from astropy.coordinates import EarthLocation
>>> from astropy.time import Time
>>> from astropy import units as u
>>> from aep8 import flux
>>> loc = EarthLocation.from_geodetic(15 * u.deg, -45 * u.deg, 300 * u.km)
>>> time = Time('2025-01-01 18:37:22')
>>> energy = 10 * u.MeV
>>> flux(loc, time, energy, kind='integral', solar='max', particle='p')
<Quantity 3.04495297 1 / (s cm2)>