Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Update doc string to be more exact
Browse files Browse the repository at this point in the history
Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
  • Loading branch information
cduhn17 and dav3r committed Nov 11, 2021
1 parent e5e2403 commit 58f02a9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/pe_reports/data/db_query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Query the PE postgres database."""
"""Query the PE PostgreSQL database."""

# Standard Python Libraries
import logging
Expand All @@ -18,7 +18,7 @@


def show_psycopg2_exception(err):
"""Handle errors for postgres issues."""
"""Handle errors for PostgreSQL issues."""
err_type, traceback = sys.exc_info()
line_n = traceback.tb_lineno
logging.error(f"\npsycopg2 ERROR: {err} on line number: {line_n}")
Expand All @@ -31,7 +31,7 @@ def show_psycopg2_exception(err):


def connect():
"""Connect to postgres database."""
"""Connect to PostgreSQL database."""
conn = None
try:
logging.info("Connecting to the PostgreSQL......")
Expand All @@ -46,13 +46,13 @@ def connect():


def close(conn):
"""Close connection to postgres."""
"""Close connection to PostgreSQL."""
conn.close()
return


def get_orgs(conn):
"""Query orgs table."""
"""Query organizations table."""
try:
cur = conn.cursor()
sql = """SELECT * FROM organizations"""
Expand All @@ -68,7 +68,7 @@ def get_orgs(conn):


def query_hibp_view(conn, org_uid, start_date, end_date):
"""Query hibp table."""
"""Query 'Have I Been Pwned?' table."""
try:
sql = """SELECT * FROM vw_breach_complete
WHERE organizations_uid = %(org_uid)s
Expand Down Expand Up @@ -110,7 +110,7 @@ def query_domMasq(conn, org_uid, start_date, end_date):


def query_shodan(conn, org_uid, start_date, end_date, table):
"""Query Shodan Table."""
"""Query Shodan table."""
try:
sql = """SELECT * FROM %(table)s
WHERE organizations_uid = %(org_uid)s
Expand All @@ -134,7 +134,7 @@ def query_shodan(conn, org_uid, start_date, end_date, table):


def query_darkweb(conn, org_uid, start_date, end_date, table):
"""Query Dark Web Table."""
"""Query Dark Web table."""
try:
sql = """SELECT * FROM %(table)s
WHERE organizations_uid = %(org_uid)s
Expand All @@ -158,7 +158,7 @@ def query_darkweb(conn, org_uid, start_date, end_date, table):


def query_darkweb_cves(conn, table):
"""Query Dark Web CVE Table."""
"""Query Dark Web CVE table."""
try:
sql = """SELECT * FROM %(table)s"""
df = pd.read_sql(
Expand All @@ -175,7 +175,7 @@ def query_darkweb_cves(conn, table):


def query_cyberSix_creds(conn, org_uid, start_date, end_date):
"""Query hibp table."""
"""Query cybersix_exposed_credentials table."""
try:
sql = """SELECT * FROM public.cybersix_exposed_credentials as creds
WHERE organizations_uid = %(org_uid)s
Expand Down

0 comments on commit 58f02a9

Please sign in to comment.