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

Add stakeholder full and NER #273

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def get_version(version_file):
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
install_requires=[
"beautifulsoup4",
"boto3 == 1.21.10",
"botocore == 1.24.10",
"chevron == 0.14.0",
Expand All @@ -109,6 +110,7 @@ def get_version(version_file):
"importlib_resources == 5.4.0",
"matplotlib == 3.3.4",
"mongo-db-from-config@http://github.com/cisagov/mongo-db-from-config/tarball/develop",
"nltk",
"openpyxl",
"pandas == 1.1.5",
"psutil",
Expand All @@ -125,6 +127,7 @@ def get_version(version_file):
"schema == 0.7.5",
"setuptools == 58.1.0",
"shodan ==1.27.0",
"spacy",
"sublist3r",
"types-PyYAML == 6.0.4",
"urllib3 == 1.26.7",
Expand Down
1 change: 1 addition & 0 deletions src/adhoc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Init file for module implementation."""
1 change: 1 addition & 0 deletions src/adhoc/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Adhoc data init."""
39 changes: 39 additions & 0 deletions src/adhoc/data/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Configure database connection."""
# Standard Python Libraries
from configparser import ConfigParser


def config(filename="/home/ubuntu/adhoc/data/database.ini", section="postgresql"):
"""Configure postgres."""
# create a parser
parser = ConfigParser()
# read config file
parser.read(filename)

# get section, default to postgresql
db = {}
if parser.has_section(section):
params = parser.items(section)
for param in params:
db[param[0]] = param[1]
else:
raise Exception("Section {} not found in the {} file".format(section, filename))
return db


def config2(filename="/home/ubuntu/adhoc/data/database.ini", section="crossfeedDB"):
"""Configure Crossfeed."""
# create a parser
parser = ConfigParser()
# read config file
parser.read(filename)

# get section, default to postgresql
db = {}
if parser.has_section(section):
params = parser.items(section)
for param in params:
db[param[0]] = param[1]
else:
raise Exception("Section {} not found in the {} file".format(section, filename))
return db
13 changes: 13 additions & 0 deletions src/adhoc/data/database.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[postgresql]
host=
database=
user=
password=
port=

[crossfeedDB]
host=
database=
user=
password=
port=
Loading