Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement high level API for electricity #202

Open
redfrexx opened this issue Jan 16, 2025 · 0 comments
Open

Implement high level API for electricity #202

redfrexx opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
prio3 Lowest Priority: Do later

Comments

@redfrexx
Copy link
Member

redfrexx commented Jan 16, 2025

Implement high level API for electricity. See issue #190

from co2calculator import Energy, HeatingFuel, Unit

# Calculate co2 emissions 
energy_heating = Energy().from_heating(fuel_type=HeatingFuel.OIL, consumption=100, unit=Unit.LITER).calculate()
energy_electricity = Energy().from_electricity(consumption=100).calculate()

# Print result
energy_heating.co2e
energy_heating.consumption
energy_heating.emission_factor
energy_heating.emission_factor.source
@redfrexx redfrexx added the prio3 Lowest Priority: Do later label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio3 Lowest Priority: Do later
Projects
None yet
Development

No branches or pull requests

2 participants