Skip to main content

Control Southern company websites with this api

Project description

Southern Company API

CI Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License

Control Southern company websites with this api

Supported utilities

Utility Class Auth method
Georgia Power, Alabama Power, Mississippi Power SouthernCompanyAPI JWT
Nicor Gas (LDC=7) NicorGasAPI Cookie session

Usage

Southern Company electric utilities (Georgia Power, Alabama Power, Mississippi Power)

import asyncio
import aiohttp
from southern_company_api import SouthernCompanyAPI

async def main():
    async with aiohttp.ClientSession() as session:
        api = SouthernCompanyAPI("username", "password", session)
        await api.connect()
        for account in await api.accounts:
            usage = await account.get_daily_data(start, end, await api.jwt)
            print(usage)

asyncio.run(main())

Nicor Gas

import asyncio
import aiohttp
from southern_company_api import NicorGasAPI

async def main():
    async with aiohttp.ClientSession() as session:
        api = NicorGasAPI("username", "password", session)
        await api.connect()
        history = await api.get_usage_history()

        for period in history.billing_periods:
            print(period.date, period.therms, "therms")

        for day in history.daily_usage:
            print(day.date.date(), day.therms, "therms", day.cost, "cost")

        print("Projected bill:", history.projected_bill.low_amount,
              "–", history.projected_bill.high_amount)

asyncio.run(main())

Nicor Gas data types

Type Fields
NicorBillingPeriod date, meter_reading, reading_details, ccfs, therms, days_used
NicorDailyUsage date, therms, cost, avg_temp, day_of_week, is_weekend, read_type, meter_read, billing_period
NicorProjectedBill usage, low_amount, high_amount
NicorMeterInfo meter_number, meter_status, next_read_date

All date fields are timezone-aware UTC datetime objects. The parse_aspnet_date helper converts the ASP.NET /Date(ms)/ format used in the portal.

Installation

Install this via pip (or your favourite package manager):

pip install southern-company-api

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Luke
Luke

💻 🤔 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

This package was created with Copier and the browniebroke/pypackage-template project template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

southern_company_api-0.7.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

southern_company_api-0.7.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file southern_company_api-0.7.0.tar.gz.

File metadata

  • Download URL: southern_company_api-0.7.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for southern_company_api-0.7.0.tar.gz
Algorithm Hash digest
SHA256 bce8c9d48d2add8966347207c9b7ad1a734b3674d2b161fac1fed12686612c74
MD5 b19fd50be96cfa98d2cc31c94aa61d50
BLAKE2b-256 b6565bca452a9d215b7ad9f8cc86ea86cc59aa3ca74671bc8c0570b6b51aaf72

See more details on using hashes here.

File details

Details for the file southern_company_api-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for southern_company_api-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be7fecf6a516c1999546424f13185f754d6adc183f3d7b4e339f6de07b66c034
MD5 25455f7ed1f7f77b325b832ecd6d56a9
BLAKE2b-256 541906a09b5bcdfb95d1908d1f91585649bc1816f685ae2ac7398ef956ec4a08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page