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

main
Lasse Studion 2 years ago
parent 1b6915f601
commit 32d0dab265
  1. 12
      arango_ev_class.py

@ -56,3 +56,15 @@ class ArangoDB:
if '/' in document_id: if '/' in document_id:
document_id = document_id.split('/')[-1] document_id = document_id.split('/')[-1]
return self.db.collection('ev_speeches').get(document_id) return self.db.collection('ev_speeches').get(document_id)
if __name__ == "__main__":
arango = ArangoDB()
# Example usage
speeches = arango.all_ev_speeches()
print(type(speeches))
for speech in speeches:
print(speech['_key']) # Print the id of the speech
print(speech.keys()) # Print the keys of the speech
exit()
Loading…
Cancel
Save