{"id":13722256,"url":"https://github.com/systemcatch/eiapy","last_synced_at":"2025-03-22T10:31:40.306Z","repository":{"id":31402475,"uuid":"127765154","full_name":"systemcatch/eiapy","owner":"systemcatch","description":"A simple wrapper for the U.S. Energy Information Administration API","archived":false,"fork":false,"pushed_at":"2022-07-18T11:16:01.000Z","size":40,"stargazers_count":23,"open_issues_count":10,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T19:41:14.137Z","etag":null,"topics":["api-wrapper","eia","energy-data","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/eiapy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemcatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-02T14:10:48.000Z","updated_at":"2024-10-04T13:30:52.000Z","dependencies_parsed_at":"2022-08-07T16:16:00.146Z","dependency_job_id":null,"html_url":"https://github.com/systemcatch/eiapy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemcatch%2Feiapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemcatch%2Feiapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemcatch%2Feiapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemcatch%2Feiapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemcatch","download_url":"https://codeload.github.com/systemcatch/eiapy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243612434,"owners_count":20319333,"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":["api-wrapper","eia","energy-data","python"],"created_at":"2024-08-03T01:01:26.506Z","updated_at":"2025-03-22T10:31:40.287Z","avatar_url":"https://github.com/systemcatch.png","language":"Python","funding_links":[],"categories":["Energy Systems"],"sub_categories":["Energy Data Accessibility and Integration"],"readme":"# eiapy\n[![PyPI](https://img.shields.io/pypi/v/eiapy.svg)](https://pypi.org/project/eiapy/) [![PyPI - License](https://img.shields.io/pypi/l/eiapy.svg)](https://pypi.org/project/eiapy/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eiapy.svg)](https://pypi.org/project/eiapy/)  \n\nPython 3 wrapper for the U.S. Energy Information Administration API.  \n\n### Quick start\n```bash\npip install eiapy\n```\n\nGet the last 5 measurements of the electricity flow between California and Mexico.\n\n```python3\n\u003e\u003e\u003e from eiapy import Series\n\u003e\u003e\u003e cal_to_mex = Series('EBA.CISO-CFE.ID.H')\n\u003e\u003e\u003e cal_to_mex.last(5)\n{'request': {'command': 'series', 'series_id': 'EBA.CISO-CFE.ID.H'},\n 'series': [{'data': [['20180401T07Z', -11],\n                      ['20180401T06Z', -16],\n                      ['20180401T05Z', -11],\n                      ['20180401T04Z', -7],\n                      ['20180401T03Z', -5]],\n             'description': 'Timestamps follow the ISO8601 standard '\n                            '(https://en.wikipedia.org/wiki/ISO_8601). Hourly '\n                            'representations are provided in Universal Time.',\n             'end': '20180401T07Z',\n             'f': 'H',\n             'name': 'Actual Net Interchange for California Independent System '\n                     'Operator (CISO) to Comision Federal de Electricidad '\n                     '(CFE), Hourly',\n             'series_id': 'EBA.CISO-CFE.ID.H',\n             'start': '20150701T00Z',\n             'units': 'megawatthours',\n             'updated': '2018-04-02T08:43:16-0400'}]}\n\n```\n\nFurther examples can be found [in this gist](https://gist.github.com/systemcatch/019cf50302093b9b51838c62b99623df).\n\nTo find more details about the API go to the EIA's [Open Data](https://www.eia.gov/opendata/) page. To find interesting data (and identifiers) [browse the data sets](https://www.eia.gov/opendata/qb.php).\n\nFor specific information about the [real-time grid display](https://www.eia.gov/beta/electricity/gridmonitor/dashboard/electric_overview/US48/US48) please see [this guide](https://www.eia.gov/realtime_grid/docs/userguide-knownissues.pdf).\n\nGo [here](https://www.eia.gov/opendata/register.cfm#terms_of_service) to see the\nAPI terms of service and [here](https://www.eia.gov/about/copyrights_reuse.cfm)\nfor an explanation of copyright and reuse of their data.\n\n### Setting up your API key\nAn API key is needed to access the EIA's data, you can get one [here](https://www.eia.gov/opendata/register.php). eiapy needs this key to be manually set in the operating system environmental variables.\n\n**Mac \u0026 Linux**  \nOpen a terminal and enter the following;\n```bash\nexport EIA_KEY=type_your_api_key_here\n```\nTo set it permanently follow the instructions on this [stackexchange question](https://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables).\n\n**Windows**  \nOpen a Command Prompt and enter the following;\n```bat\nsetx EIA_KEY \"type_your_api_key_within_the_quotes\"\n```\n\n### Notes on API behaviour\n- When providing invalid time limits for a series data request an empty data list is returned.\n- For data requests num \u0026 start cannot be used together but num \u0026 end can.\n- When an invalid series id is passed this is the response.\n```python3\n{'request': {'series_id': 'eba.ciso-cfe.id.', 'command': 'series', 'num': '5'},\n 'data': {'error': 'invalid series_id. For key registration, documentation, and\n examples see https://www.eia.gov/developer/'}}\n```\n- The API expects timestamps in ISO 8601 format (YYYYMMDDTHHZ) with Z meaning UTC, [bad timestamps](https://github.com/systemcatch/eiapy/issues/16) will not raise errors.\n\n### Changelog\n**0.1.6**\n- Changed URLs to https as http is no longer supported by EIA.\n- Added python 3.9 and 3.10 to classifiers, removed 3.5.\n\n**0.1.5**\n- Added Python 3.8 to supported versions.\n- Updated readme with advice about bad timestamps.\n- Disabled broken Relation class.\n- Made handling of no api key more human friendly.\n\n**0.1.4**\n- Fixed broken Search `repr`.\n- Added Python 3.7 to supported versions.\n- Mention real-time grid in readme.\n\n**0.1.3**\n- Simplify construction and use of the Search class.\n- Explain how to set up the API key.\n- Added gist of examples to readme.\n\n**0.1.2**\n- Rename several methods for extra clarity.\n- data -\u003e get_data\n- get -\u003e get_updates\n\n**0.1.1**  \n- Started using requests session functionality to improve performance.\n- Fixed a mistake in the MultiSeries class that stopped it working entirely.\n- Added a version attribute to the package.\n- Overhaul of readme.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemcatch%2Feiapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemcatch%2Feiapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemcatch%2Feiapy/lists"}