{"id":23085974,"url":"https://github.com/ericoc/utilities","last_synced_at":"2025-04-03T15:30:08.315Z","repository":{"id":267732378,"uuid":"902144069","full_name":"ericoc/utilities","owner":"ericoc","description":"Philadelphia (electrical, natural gas, and water) utilities usage graphs and tables!","archived":false,"fork":false,"pushed_at":"2025-03-30T03:39:02.000Z","size":5786,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T04:24:35.305Z","etag":null,"topics":["analytics","datatables","django","django-rest-framework","drf","highcharts","javascript","openpyxl","philadelphia","philly","python","python3","utilities"],"latest_commit_sha":null,"homepage":"https://utilities.ericoc.com/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericoc.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-12T01:55:26.000Z","updated_at":"2025-03-30T03:39:05.000Z","dependencies_parsed_at":"2025-01-16T00:39:45.162Z","dependency_job_id":"524d68df-4bed-4efa-af49-2f0ae7291522","html_url":"https://github.com/ericoc/utilities","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"bba54b8d1c8770b2d298f730ebb95700c23ea17a"},"previous_names":["ericoc/utilities"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Futilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Futilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Futilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Futilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericoc","download_url":"https://codeload.github.com/ericoc/utilities/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247027498,"owners_count":20871554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","datatables","django","django-rest-framework","drf","highcharts","javascript","openpyxl","philadelphia","philly","python","python3","utilities"],"created_at":"2024-12-16T18:13:57.659Z","updated_at":"2025-04-03T15:30:08.273Z","avatar_url":"https://github.com/ericoc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utilities\n\nThe Philadelphia electrical, natural gas, and water utilities websites each\nallow for a residential account holder to access (and export!) their own usage\ndata.\n\n## Electric\n### Pennsylvania Electric Company (\"PECO\")\nA ZIP (`.zip`) archive containing a comma-separated values (`.csv`) file, of\nelectricity used in kilowatt-hours (kWh), can be downloaded from the\n\"[My Green Button Data](https://secure.peco.com/MyAccount/MyBillUsage/Pages/Secure/GreenButtonConnectDownloadMyData.aspx)\"\npage of the \"My Usage\" section of the PECO website:\n![Export Pennsylvania Electric Company Electric Usage Screenshot](apps/electric/export.png)\n\nThe export CSV file from PECO is named based upon the dates exported, like so:\n\u003e `peco_electric_usage_interval_data_Service 1_1_2023-07-04_to_2023-07-04.csv`\n\nThe PECO file begins with a header that includes account information:\n\u003e ```\n\u003e Name,WILLIAM PENN\n\u003e Address,\"1 S BROAD ST, PHILADELPHIA PA 19112\"\n\u003e Account Number,1776xxxxxx\n\u003e Service,Service 1\n\u003e ```\n\nEach row of the PECO CSV export file has kilowatt-hours (kWh) of electricity\nused, as well as the start and end of the hour measured:\n\u003e ```\n\u003e TYPE,DATE,START TIME,END TIME,USAGE (kWh),NOTES\n\u003e ...\n\u003e Electric usage,2024-12-17,18:00,18:59,0.46\n\u003e Electric usage,2024-12-17,19:00,19:59,0.44\n\u003e Electric usage,2024-12-17,20:00,20:59,0.41\n\u003e Electric usage,2024-12-17,21:00,21:59,0.51\n\u003e Electric usage,2024-12-17,22:00,22:59,1.08\n\u003e Electric usage,2024-12-17,23:00,23:59,2.92\n\u003e ```\n\nThe `electric_fill` Django management command imports this file into the database:\n\u003e ```\n\u003e $ python3 manage.py electric_fill\n\u003e 1 CSV file(s) found.\n\u003e ...\n\u003e Created:        Tuesday, December 17, 2024 @ 06 PM (2024-12-17 18:00:00-05:00) [0.46 kWh]\n\u003e Created:        Tuesday, December 17, 2024 @ 07 PM (2024-12-17 19:00:00-05:00) [0.44 kWh]\n\u003e Created:        Tuesday, December 17, 2024 @ 08 PM (2024-12-17 20:00:00-05:00) [0.41 kWh]\n\u003e Created:        Tuesday, December 17, 2024 @ 09 PM (2024-12-17 21:00:00-05:00) [0.51 kWh]\n\u003e Created:        Tuesday, December 17, 2024 @ 10 PM (2024-12-17 22:00:00-05:00) [1.08 kWh]\n\u003e Created:        Tuesday, December 17, 2024 @ 11 PM (2024-12-17 23:00:00-05:00) [2.92 kWh]\n\u003e Total:          24\n\u003e Done.\n\u003e ```\n\nThe `electric_weekend` Django management command does some calculations based\nupon the data to compare electric usage on weekdays vs. weekends:\n\u003e ```\n\u003e $ python3 manage.py electric_weekend\n\u003e From:           Sat Jan 21 23:00:00 2023 (2023-01-21 23:00:00-05:00) [2 years ago]\n\u003e To:             Sun Jan 19 23:00:00 2025 (2025-01-19 23:00:00-05:00) [4 days, 22 hours ago]\n\u003e Weekdays:       8,075.9400 total kWh / 12,480 total hours = average 0.6471 kWh over 1 year, 5 months.\n\u003e Weekends:       3,655.5800 total kWh / 5,015 total hours = average 0.7289 kWh over 6 months, 3 weeks.\n\u003e Total:          11,731.5200 kWh / 17,495 hours = average 0.6706 kWh over 1 year, 11 months.\n\u003e ```\n\n## Natural Gas\n### Philadelphia Gas Works (\"PGW\")\nAn Excel (`.xlsx`) spreadsheet file of natural gas, used in hundreds of cubic\nfeet (CCF), each (billing) month can be downloaded from the\n\"[usage section](https://myaccount.pgworks.com/portal/usages.aspx?type=GU)\"\nof the Philadelphia Gas Works (PGW) website;\n![Export Philadelphia Gas Works Natural Gas Usage Screenshot](apps/natural_gas/export.png)\n\nThe Excel spreadsheet from PGW is named by the date it was exported\n(such as `UsageDataMMDDYYYY.xlsx`):\n\u003e `UsageData12142024.xlsx`\n\nThe PGW file also begins with a header that includes account information:\n\u003e ```\n\u003e Service Point Number: 1776xxxxxx            \n\u003e Period: Jan 2021 To Jun 2021            \n\u003e Property: 1 S BROAD ST (xxxxx1776)\n\u003e ```\n\nEach row of the PGW file includes hundreds of cubic feet (CCF) of natural gas\nused each billing month:\n\u003e ```\n\u003e Bill Month    Units Consumed (CCF)    Period Start    Period End\n\u003e Jan, 2021     50.00                   12/18/20        01/21/21\n\u003e Feb, 2021     73.00                   01/21/21        02/22/21\n\u003e Mar, 2021     45.00                   02/22/21        03/22/21\n\u003e Apr, 2021     17.00                   03/22/21        04/21/21\n\u003e May, 2021     10.00                   04/21/21        05/20/21\n\u003e Jun, 2021     5.0                     05/20/21        06/18/21\n\u003e ```\n\nThe `gas_fill` Django management command imports this file into the database:\n\u003e ```\n\u003e $ python3 manage.py natural_gas_fill\n\u003e (venv) ➜ eric@pro:~/code/utilities git:(main) ✗ $ python3 manage.py natural_gas_fill                \n\u003e 1 spreadsheet(s) found.\n\u003e ...\n\u003e Created:        Saturday 2025 (2025-03-01) [33.0 CCF]\n\u003e Total:          1\n\u003e Done.\n\u003e ```\n\n## Water\n#### Philadelphia Water Department (\"PWD\")\nComma-separated values (\"CSV\" / `.csv`) file of water used, in gallons, daily.\n\nA CSV file can be downloaded by \"Gallons\" of water used \"Daily\" from the\n\"[Detailed Usage](https://secure8.i-doxs.net/CityOfPhiladelphiaWRB/Secure/Usage.aspx)\"\nsection of the Philadelphia Water Department (PWD) website:\n![Export Philadelphia Water Department Detailed Usage Screenshot](apps/water/export.png)\n\nThe water usage export `.csv` file is always named `ChartData.csv`.\n\nEach row of the PWD file includes the number of gallons of water used each day:\n\u003e ```\n\u003e Access Code, Time Interval, Consumption, Units\n\u003e 00145xxxx, 11/27/2024, 18.7013, Gallons\n\u003e 00145xxxx, 11/28/2024, 35.9065, Gallons\n\u003e 00145xxxx, 11/29/2024, 35.1584, Gallons\n\u003e 00145xxxx, 11/30/2024, 44.8831, Gallons\n\u003e 00145xxxx, 12/01/2024, 71.8130, Gallons\n\u003e 00145xxxx, 12/02/2024, 25.4338, Gallons\n\u003e 00145xxxx, 12/03/2024, 23.9377, Gallons\n\u003e ```\n\nThe `water_fill` Django management command imports this file into the database:\n\u003e ```\n\u003e $ python3 manage.py water_fill\n\u003e Created:        Wednesday, March 26, 2025 (2025-03-26) [18.7013 gallons]\n\u003e Created:        Thursday, March 27, 2025 (2025-03-27) [23.1896 gallons]\n\u003e Created:        Friday, March 28, 2025 (2025-03-28) [43.387 gallons]\n\u003e Created:        Saturday, March 29, 2025 (2025-03-29) [35.9065 gallons]\n\u003e Created:        Sunday, March 30, 2025 (2025-03-30) [35.1584 gallons]\n\u003e Created:        Monday, March 31, 2025 (2025-03-31) [56.1039 gallons]\n\u003e Total:          6\n\u003e Done.\n\u003e ```\n\nThe `water_weekend` Django management command does some calculations based\nupon the data to compare water usage on weekdays vs. weekends:\n\u003e ```\n\u003e $ python3 manage.py water_weekend\n\u003e From:           Thursday, September 15, 2022 (2022-09-15)\n\u003e To:             Tuesday, February 04, 2025 (2025-02-04)\n\u003e Weekdays:       20,831.0039 gallons / 622 week days = average 33.4904 gallons over 1 year, 8 months.\n\u003e Weekends:       13,859.1591 gallons / 247 weekend days = average 56.1100 gallons over 8 months.\n\u003e Total:          34,690.1630 gallons / 869 days = average 39.9196 gallons over 2 years, 4 months.\n\u003e ```\n\n## API\nHighcharts and DataTables are displayed using the JSON data from Django REST\nFramework endpoints for each data set:\n- Electric: [`https://utilities.ericoc.com/api/electric/`](https://utilities.ericoc.com/api/electric/)\n- Natural Gas: [`https://utilities.ericoc.com/api/natural_gas/`](https://utilities.ericoc.com/api/natural_gas/)\n- Water: [`https://utilities.ericoc.com/api/water/`](https://utilities.ericoc.com/api/water/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoc%2Futilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericoc%2Futilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoc%2Futilities/lists"}