eiapy
A simple wrapper for the U.S. Energy Information Administration API.
https://github.com/systemcatch/eiapy
Category: Energy Systems
Sub Category: Energy Data Accessibility and Integration
Keywords
api-wrapper eia energy-data python
Last synced: about 1 hour ago
JSON representation
Repository metadata
A simple wrapper for the U.S. Energy Information Administration API
- Host: GitHub
- URL: https://github.com/systemcatch/eiapy
- Owner: systemcatch
- License: mit
- Created: 2018-04-02T14:10:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-18T11:16:01.000Z (almost 3 years ago)
- Last Synced: 2025-04-17T22:43:08.256Z (10 days ago)
- Topics: api-wrapper, eia, energy-data, python
- Language: Python
- Homepage: https://pypi.org/project/eiapy/
- Size: 39.1 KB
- Stars: 24
- Watchers: 1
- Forks: 9
- Open Issues: 10
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
README.md
eiapy
Python 3 wrapper for the U.S. Energy Information Administration API.
Quick start
pip install eiapy
Get the last 5 measurements of the electricity flow between California and Mexico.
>>> from eiapy import Series
>>> cal_to_mex = Series('EBA.CISO-CFE.ID.H')
>>> cal_to_mex.last(5)
{'request': {'command': 'series', 'series_id': 'EBA.CISO-CFE.ID.H'},
'series': [{'data': [['20180401T07Z', -11],
['20180401T06Z', -16],
['20180401T05Z', -11],
['20180401T04Z', -7],
['20180401T03Z', -5]],
'description': 'Timestamps follow the ISO8601 standard '
'(https://en.wikipedia.org/wiki/ISO_8601). Hourly '
'representations are provided in Universal Time.',
'end': '20180401T07Z',
'f': 'H',
'name': 'Actual Net Interchange for California Independent System '
'Operator (CISO) to Comision Federal de Electricidad '
'(CFE), Hourly',
'series_id': 'EBA.CISO-CFE.ID.H',
'start': '20150701T00Z',
'units': 'megawatthours',
'updated': '2018-04-02T08:43:16-0400'}]}
Further examples can be found in this gist.
To find more details about the API go to the EIA's Open Data page. To find interesting data (and identifiers) browse the data sets.
For specific information about the real-time grid display please see this guide.
Go here to see the
API terms of service and here
for an explanation of copyright and reuse of their data.
Setting up your API key
An API key is needed to access the EIA's data, you can get one here. eiapy needs this key to be manually set in the operating system environmental variables.
Mac & Linux
Open a terminal and enter the following;
export EIA_KEY=type_your_api_key_here
To set it permanently follow the instructions on this stackexchange question.
Windows
Open a Command Prompt and enter the following;
setx EIA_KEY "type_your_api_key_within_the_quotes"
Notes on API behaviour
- When providing invalid time limits for a series data request an empty data list is returned.
- For data requests num & start cannot be used together but num & end can.
- When an invalid series id is passed this is the response.
{'request': {'series_id': 'eba.ciso-cfe.id.', 'command': 'series', 'num': '5'},
'data': {'error': 'invalid series_id. For key registration, documentation, and
examples see https://www.eia.gov/developer/'}}
- The API expects timestamps in ISO 8601 format (YYYYMMDDTHHZ) with Z meaning UTC, bad timestamps will not raise errors.
Changelog
0.1.6
- Changed URLs to https as http is no longer supported by EIA.
- Added python 3.9 and 3.10 to classifiers, removed 3.5.
0.1.5
- Added Python 3.8 to supported versions.
- Updated readme with advice about bad timestamps.
- Disabled broken Relation class.
- Made handling of no api key more human friendly.
0.1.4
- Fixed broken Search
repr
. - Added Python 3.7 to supported versions.
- Mention real-time grid in readme.
0.1.3
- Simplify construction and use of the Search class.
- Explain how to set up the API key.
- Added gist of examples to readme.
0.1.2
- Rename several methods for extra clarity.
- data -> get_data
- get -> get_updates
0.1.1
- Started using requests session functionality to improve performance.
- Fixed a mistake in the MultiSeries class that stopped it working entirely.
- Added a version attribute to the package.
- Overhaul of readme.
Owner metadata
- Name: Chris
- Login: systemcatch
- Email:
- Kind: user
- Description:
- Website: https://systemcat.ch
- Location: United Kingdom
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/30196510?u=c9bf3c150620efb0e501aa4551fc6a717b41020f&v=4
- Repositories: 10
- Last ynced at: 2024-04-16T01:12:58.524Z
- Profile URL: https://github.com/systemcatch
GitHub Events
Total
- Watch event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Fork event: 1
Committers metadata
Last synced: 7 days ago
Total Commits: 30
Total Committers: 2
Avg Commits per committer: 15.0
Development Distribution Score (DDS): 0.033
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
systemcatch | 3****h | 29 |
igor-udovenko | 9****o | 1 |
Committer domains:
Issue and Pull Request metadata
Last synced: about 1 hour ago
Total issues: 13
Total pull requests: 16
Average time to close issues: 7 months
Average time to close pull requests: 9 days
Total issue authors: 3
Total pull request authors: 4
Average comments per issue: 0.62
Average comments per pull request: 0.13
Merged pull request: 14
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- systemcatch (11)
- bjacksonKOps (1)
- aholden10 (1)
Top Pull Request Authors
- systemcatch (13)
- shuuji3 (1)
- igor-udovenko (1)
- areed1192 (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 445 last-month
- Total dependent packages: 1
- Total dependent repositories: 14
- Total versions: 7
- Total maintainers: 1
pypi.org: eiapy
A simple wrapper for the U.S. Energy Information Administration (EIA) API.
- Homepage: https://github.com/systemcatch/eiapy
- Documentation: https://eiapy.readthedocs.io/
- Licenses: MIT
- Latest release: 0.1.6 (published about 3 years ago)
- Last Synced: 2025-04-26T13:31:41.190Z (1 day ago)
- Versions: 7
- Dependent Packages: 1
- Dependent Repositories: 14
- Downloads: 445 Last month
-
Rankings:
- Dependent packages count: 3.271%
- Dependent repos count: 3.926%
- Average: 9.79%
- Forks count: 11.986%
- Stargazers count: 12.894%
- Downloads: 16.872%
- Maintainers (1)
Dependencies
- requests *
Score: 10.352905748172756