Spaces:
Sleeping
Sleeping
from simple_salesforce import Salesforce | |
# Salesforce Authentication | |
def authenticate_salesforce(): | |
return Salesforce(username='your_username', password='your_password', security_token='your_security_token') | |
# Fetch data from Salesforce custom objects (Pole, Sensor Data, Alerts) | |
def fetch_salesforce_data(): | |
sf = authenticate_salesforce() | |
# Fetching data from the 'Pole' custom object | |
poles_data = sf.query("SELECT Id, Name, Latitude__c, Longitude__c, Solar_Output__c, Wind_Output__c FROM Pole__c") | |
# Return the fetched records | |
return poles_data['records'] | |