Skip to content

Commit

Permalink
Sphinx Docs
Browse files Browse the repository at this point in the history
- Add Sphinx doc files
- Add doc build instructions.
- Import Evergy class in __init__.py
- Cleanup README
  • Loading branch information
lawrencefoley authored Sep 18, 2021
1 parent a0edbdd commit 1d38266
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 5 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[flake8]
max-line-length=127
per-file-ignores = __init__.py:F401
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties
/venv/
/docs/_build/
evergy/__pycache__/*
1 change: 1 addition & 0 deletions .idea/kcpl.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
## Meter Data Utility for Evergy (previously known as Kansas City Power and Light)
# Evergy Client
A simple utility that you can use to login to your Evergy account and retrieve you meter readings.
> **Note: This is an unofficial utility that uses Evergy's non-public API.**
> Previously known as "KCPL"
## Install
```
pip install git+git://github.com/lawrencefoley/evergy.git
pip install --upgrade git+git://github.com/lawrencefoley/evergy.git
```

## Usage

```python
# Import the package
from evergy.evergy import Evergy
from evergy import Evergy

# Login
evergy = Evergy("username", "password")
Expand Down Expand Up @@ -41,3 +44,9 @@ git commit -m "Bump version"
git tag -a v1.0.1 -m "v1.0.1"
git push --tags
```

### Build Docs
Windows PowerShell:
```powershell
.\make.bat clean; .\make.bat html
```
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
59 changes: 59 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#

import os
import sys
sys.path.insert(0, os.path.abspath('..'))

import evergy

# -- Project information -----------------------------------------------------

project = 'Evergy'
copyright = '2021, Lawrence Foley'
author = 'Lawrence Foley'

# The full version, including alpha/beta/rc tags
version = evergy.__version__
release = evergy.__version__


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['myst_parser']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_suffix = ['.md']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../README.md
```
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions evergy/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "1.0.2"

from .evergy import Evergy
2 changes: 2 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
isort==5.9.3
flake8==3.9.2
sphinx==4.2.0
myst-parser==0.15.2
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from os import path

from setuptools import find_packages, setup

import evergy
here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
Expand All @@ -13,7 +13,7 @@

setup(
name="evergy",
version="1.0.2",
version=evergy.__version__,
description="A utility that reads electric utility meter data from Evergy.com",
long_description=long_description,
url="https://github.com/lawrencefoley/evergy",
Expand Down

0 comments on commit 1d38266

Please sign in to comment.