chore: Refactor ArangoDB class and script for fetching electric car documents

Refactor the ArangoDB class and the script for fetching documents related to electric cars. The code has been modified to improve readability and maintainability. The script now uses the Ollama library to generate arguments based on the fetched documents. This update will make it easier to extract arguments related to electric cars from the database.
main
Lasse Studion 2 years ago
parent 111e371dad
commit 7c621211e2
  1. 1
      .env
  2. BIN
      __pycache__/arango_ev_class.cpython-312.pyc
  3. 23
      arango_ev_class.py

@ -0,0 +1 @@
PASSWORD_ARANGO=gogkud-4kebkU-memhys

@ -7,19 +7,18 @@ load_dotenv() # Install with pip install python-dotenv
class ArangoDB:
class ArangoEVClass:
def __init__(self, db_name):
"""
Initializes an instance of the ArangoEVClass.
def __init__(self):
"""
Initializes an instance of the ArangoEVClass.
Args:
db_name (str): The name of the database.
username (str): The username for authentication.
password (str): The password for authentication.
"""
password = os.getenv("PASSWORD_ARANGO")
self.client = ArangoClient(hosts='https://arango.lasseedfast.se')
self.db = self.client.db(db_name, username='dataharvest', password=password)
Args:
db_name (str): The name of the database.
username (str): The username for authentication.
password (str): The password for authentication.
"""
password = os.getenv("PASSWORD_ARANGO")
self.client = ArangoClient(hosts='https://arango.lasseedfast.se')
self.db = self.client.db('ev_dataharvest', username='dataharvest', password=password)
def all_ev_speeches(self):

Loading…
Cancel
Save