Skip to content

Commit

Permalink
Add sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt343 committed Sep 15, 2024
1 parent 43d6318 commit 3355fb9
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,5 @@ data/
.~lock.*

.DS_Store

docs/generated
31 changes: 31 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import sys
import os
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'indigent-defense-stats'
copyright = '2024, Open Austin'
author = 'Open Austin'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

sys.path.insert(0, os.path.abspath('../src'))

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary']

templates_path = ['_templates']
exclude_patterns = ['src/tester']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
html_static_path = ['_static']
21 changes: 21 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. indigent-defense-stats documentation master file, created by
sphinx-quickstart on Sun Sep 15 15:44:02 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
indigent-defense-stats documentation
====================================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.

.. autosummary::
:toctree: generated

cleaner
orchestrator
parser
scraper
tools
updater
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ retry == 0.9.2
statistics == 1.0.3.5
xxhash == 3.5.0
flake8 == 7.1.0
sphinx == 8.0.*
6 changes: 6 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import cleaner
from . import otchestrator
from . import parser
from . import scraper
from . import tools
from . import updater
20 changes: 8 additions & 12 deletions src/orchestrator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import sys, os, csv

# Appends the parent directory of this handler script to the sys.path
current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
sys.path.append(parent_dir)

# Import all of the programs modules within the parent_dir
from scraper import scraper
from parser import parser
from cleaner import cleaner
from updater import updater
import scraper
import parser
import cleaner
import updater

class orchestrator:
class Orchestrator:
def __init__(self):
#Sets our base parameters
self.counties = []
self.start_date = '2024-07-01' #Update start date here
self.end_date = '2024-07-01' #Update start date here
def orchestrate(self, test):
def orchestrate(self, test: bool = False):

#This open the county data CSV to see which counties should be scraped, parsed, cleaned, and updated.
with open(
Expand All @@ -41,4 +36,5 @@ def orchestrate(self, test):
updater(c).update() #src/updater
print(f"Completed with scraping, parsing, cleaning, and updating of this county: {c}")

orchestrator().orchestrate()
if __name__ == '__main__':
Orchestrator().orchestrate()
1 change: 1 addition & 0 deletions src/scraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import importlib

class Scraper:
"""Scrape Odyssey html files into an output folder"""
def __init__(self):
pass

Expand Down

0 comments on commit 3355fb9

Please sign in to comment.