Skip to content

Commit

Permalink
Merge pull request #1 from AdamFinkle/package_and_publish
Browse files Browse the repository at this point in the history
Restructured, integration tested, and packaged for PyPI.
  • Loading branch information
AdamFinkle committed Jun 21, 2024
2 parents 0e9e3b7 + 5ecfb7d commit e777bfc
Show file tree
Hide file tree
Showing 43 changed files with 774,808 additions and 195 deletions.
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
*.pyc
# Documentation
doc/*.png

# Python
*.pyc
__pycache__/

# Environments
venv/

# PyCharm
.idea/

# Distribution / packaging
build/
dist/
*.egg-info/
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
This is some python code to parse an Energy Service Provider Interface
(ESPI), or "Green Button" XML file into Python objects.
# Green Button Objects

This Python code parses an Energy Service Provider Interface
(ESPI), or "Green Button", XML file into Python objects.

Run `parse_feed()` from the `parse.py` file to get a list of `UsagePoint`
objects. From there you should be able to explore all of the data in the
Expand All @@ -9,3 +11,18 @@ entities).

There's a bit of documentation in the `doc` directory about the ESPI
standard, mostly figured out from public sources and actual ESPI files.

Forked from the original repository [greenbutton-objects](https://github.com/asciipip/greenbutton-python)
and packaged to be published on PyPI.


## Development
Simple steps for development setup:

1. Clone the git repository.
3. Navigate to any directory and create a [virtual environment](https://docs.python.org/3/library/venv.html#creating-virtual-environments) and activate it
4. The following commands can be run from inside the top-level greenbutton_objects folder while the virtual environment is active
2. `pip install -e .` builds the [python egg](https://stackoverflow.com/questions/2051192/what-is-a-python-egg) for greenbutton_objects and then installs greenbutton_objects
3. `pip install -r requirements-dev.txt` which installs the libraries required to develop greenbutton_objects

Then, you should be able to run `pytest`, also from any directory, and see the test run successfully.
45 changes: 0 additions & 45 deletions parse.py

This file was deleted.

53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "greenbutton_objects"
version = "2024.6.21"
description = "Parse Green Button XML files into Python objects."
readme = "README.md"
authors = [{ name = "Adam Finkle", email = "77808710+AdamFinkle@users.noreply.github.com" },
{ name = "Ethan Strominger", email = "ethanstrominger2@gmail.com" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: Apache 2.0",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
keywords = ["feed", "reader", "tutorial"]
requires-python = ">=2.7"

[project.optional-dependencies]
dev = [
"black",
"bumpver",
"isort",
"mypy",
"pip-tools",
"pydocstyle",
"pytest"
]

[project.urls]
Homepage = "https://github.com/AdamFinkle/greenbutton_objects"
[tool.bumpver]
current_version = "2024.6.21"
version_pattern = "YYYY.MM.DD"
commit_message = "bump version {old_version} -> {new_version}"
tag_message = "{new_version}"
tag_scope = "default"
pre_commit_hook = ""
post_commit_hook = ""
commit = true
tag = true
push = true

[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
]
"README.md" = [
"{version}",
"{pep440_version}",
]
66 changes: 66 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
#
black==24.4.2
# via greenbutton_objects (pyproject.toml)
build==1.2.1
# via pip-tools
bumpver==2023.1129
# via greenbutton_objects (pyproject.toml)
click==8.1.7
# via
# black
# bumpver
# pip-tools
colorama==0.4.6
# via bumpver
iniconfig==2.0.0
# via pytest
isort==5.13.2
# via greenbutton_objects (pyproject.toml)
lexid==2021.1006
# via bumpver
looseversion==1.3.0
# via bumpver
mypy==1.10.0
# via greenbutton_objects (pyproject.toml)
mypy-extensions==1.0.0
# via
# black
# mypy
packaging==24.1
# via
# black
# build
# pytest
pathspec==0.12.1
# via black
pip-tools==7.4.1
# via greenbutton_objects (pyproject.toml)
platformdirs==4.2.2
# via black
pluggy==1.5.0
# via pytest
pydocstyle==6.3.0
# via greenbutton_objects (pyproject.toml)
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pytest==8.2.2
# via greenbutton_objects (pyproject.toml)
snowballstemmer==2.2.0
# via pydocstyle
toml==0.10.2
# via bumpver
typing-extensions==4.12.2
# via mypy
wheel==0.43.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --strip-extras pyproject.toml
#
135 changes: 0 additions & 135 deletions resources.py

This file was deleted.

Empty file.
File renamed without changes.
Loading

0 comments on commit e777bfc

Please sign in to comment.