Skip to content
Open
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
27 changes: 27 additions & 0 deletions ExecutiveAssistant/AutomatedCalls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```python
import os
from twilio.rest import Client

# Twilio credentials
TWILIO_ACCOUNT_SID = os.getenv('TWILIO_ACCOUNT_SID')
TWILIO_AUTH_TOKEN = os.getenv('TWILIO_AUTH_TOKEN')
TWILIO_PHONE_NUMBER = os.getenv('TWILIO_PHONE_NUMBER')

client = Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)

def make_call(to_number, from_number=TWILIO_PHONE_NUMBER):
call = client.calls.create(
to=to_number,
from_=from_number,
url="http://demo.twilio.com/docs/voice.xml"
)
return call.sid

def receive_call(call_sid):
call = client.calls(call_sid).fetch()
return call.to, call.from_, call.status

def record_call(call_sid):
recording = client.calls(call_sid).recordings.create()
return recording.sid
```
41 changes: 41 additions & 0 deletions ExecutiveAssistant/AutomatedDataEntry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
```python
import csv
from typing import Dict, Any

class AutomatedDataEntry:

def __init__(self, file_path: str):
self.file_path = file_path

def read_data(self) -> Dict[str, Any]:
data = {}
with open(self.file_path, mode='r') as csv_file:
csv_reader = csv.DictReader(csv_file)
for row in csv_reader:
for key, value in row.items():
if key not in data:
data[key] = []
data[key].append(value)
return data

def write_data(self, data: Dict[str, Any]) -> None:
with open(self.file_path, mode='w') as csv_file:
fieldnames = list(data.keys())
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
writer.writeheader()
for i in range(len(data[fieldnames[0]])):
row = {fieldname: data[fieldname][i] for fieldname in fieldnames}
writer.writerow(row)

def update_data(self, updates: Dict[str, Any]) -> None:
data = self.read_data()
for key, values in updates.items():
if key not in data:
data[key] = []
data[key].extend(values)
self.write_data(data)

if __name__ == "__main__":
ade = AutomatedDataEntry('data.csv')
ade.update_data({'NewField': ['NewValue1', 'NewValue2', 'NewValue3']})
```
37 changes: 37 additions & 0 deletions ExecutiveAssistant/ConflictResolution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
```python
import datetime

class Conflict:
def __init__(self, conflict_id, parties_involved, conflict_description, conflict_status="Unresolved"):
self.conflict_id = conflict_id
self.parties_involved = parties_involved
self.conflict_description = conflict_description
self.conflict_status = conflict_status
self.conflict_resolution = None
self.resolution_date = None

def resolve_conflict(self, resolution):
self.conflict_status = "Resolved"
self.conflict_resolution = resolution
self.resolution_date = datetime.datetime.now()

class ConflictResolution:
def __init__(self):
self.conflicts = []

def add_conflict(self, conflict):
self.conflicts.append(conflict)

def resolve_conflict(self, conflict_id, resolution):
for conflict in self.conflicts:
if conflict.conflict_id == conflict_id:
conflict.resolve_conflict(resolution)
return f"Conflict {conflict_id} has been resolved."
return f"No conflict with ID {conflict_id} found."

def get_unresolved_conflicts(self):
return [conflict for conflict in self.conflicts if conflict.conflict_status == "Unresolved"]

def get_resolved_conflicts(self):
return [conflict for conflict in self.conflicts if conflict.conflict_status == "Resolved"]
```
34 changes: 34 additions & 0 deletions ExecutiveAssistant/DiscordIntegration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
```python
import discord
import os

DISCORD_TOKEN = os.getenv('DISCORD_TOKEN')
DISCORD_SERVER_ID = os.getenv('DISCORD_SERVER_ID')

client = discord.Client()

async def send_message(channel_id, message):
channel = client.get_channel(channel_id)
await channel.send(message)

async def join_server(invite_link):
await client.accept_invite(invite_link)

async def create_channel(server_id, channel_name, channel_type='Text'):
server = client.get_server(server_id)
if channel_type == 'Text':
await server.create_text_channel(channel_name)
elif channel_type == 'Voice':
await server.create_voice_channel(channel_name)

async def invite_to_channel(channel_id, user_id):
channel = client.get_channel(channel_id)
user = client.get_user(user_id)
await channel.create_invite(destination=channel)

@client.event
async def on_ready():
print(f'We have logged in as {client.user}')

client.run(DISCORD_TOKEN)
```
42 changes: 42 additions & 0 deletions ExecutiveAssistant/DocumentManagement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
```python
import os
from google.cloud import storage

# Google Cloud Storage settings
GCS_BUCKET_NAME = os.getenv('GCS_BUCKET_NAME')
storage_client = storage.Client()

def upload_document(file_path, destination_blob_name):
"""Uploads a file to the bucket."""
bucket = storage_client.bucket(GCS_BUCKET_NAME)
blob = bucket.blob(destination_blob_name)

blob.upload_from_filename(file_path)

print(f"File {file_path} uploaded to {destination_blob_name}.")

def download_document(source_blob_name, destination_file_name):
"""Downloads a blob from the bucket."""
bucket = storage_client.bucket(GCS_BUCKET_NAME)
blob = bucket.blob(source_blob_name)

blob.download_to_filename(destination_file_name)

print(f"Blob {source_blob_name} downloaded to {destination_file_name}.")

def delete_document(blob_name):
"""Deletes a blob from the bucket."""
bucket = storage_client.bucket(GCS_BUCKET_NAME)
blob = bucket.blob(blob_name)

blob.delete()

print(f"Blob {blob_name} deleted.")

def list_documents():
"""Lists all the blobs in the bucket."""
blobs = storage_client.list_blobs(GCS_BUCKET_NAME)

for blob in blobs:
print(blob.name)
```
44 changes: 44 additions & 0 deletions ExecutiveAssistant/ElevenLabsIntegration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
```python
import requests
import json

ELEVEN_LABS_API_KEY = 'your_api_key_here'

def get_projects():
response = requests.get(
'https://api.elevenlabs.com/projects',
headers={'Authorization': 'Bearer ' + ELEVEN_LABS_API_KEY}
)
return response.json()

def create_project(name, description):
data = {
'name': name,
'description': description
}
response = requests.post(
'https://api.elevenlabs.com/projects',
headers={'Authorization': 'Bearer ' + ELEVEN_LABS_API_KEY},
data=json.dumps(data)
)
return response.json()

def update_project(project_id, name, description):
data = {
'name': name,
'description': description
}
response = requests.put(
f'https://api.elevenlabs.com/projects/{project_id}',
headers={'Authorization': 'Bearer ' + ELEVEN_LABS_API_KEY},
data=json.dumps(data)
)
return response.json()

def delete_project(project_id):
response = requests.delete(
f'https://api.elevenlabs.com/projects/{project_id}',
headers={'Authorization': 'Bearer ' + ELEVEN_LABS_API_KEY}
)
return response.status_code == 204
```
34 changes: 34 additions & 0 deletions ExecutiveAssistant/EmailIntegration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
```python
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

# Email credentials
SMTP_SERVER = "smtp.gmail.com"
SMTP_PORT = 587
EMAIL_ADDRESS = "your_email@gmail.com"
EMAIL_PASSWORD = "your_password"

def send_email(to_address, subject, message):
msg = MIMEMultipart()
msg['From'] = EMAIL_ADDRESS
msg['To'] = to_address
msg['Subject'] = subject
msg.attach(MIMEText(message, 'plain'))

try:
server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
server.ehlo()
server.starttls()
server.login(EMAIL_ADDRESS, EMAIL_PASSWORD)
text = msg.as_string()
server.sendmail(EMAIL_ADDRESS, to_address, text)
server.quit()
print(f"Email sent to {to_address}")
except Exception as e:
print(f"Failed to send email to {to_address} due to {str(e)}")

def receive_email():
# This function can be implemented based on the email provider's API
pass
```
48 changes: 48 additions & 0 deletions ExecutiveAssistant/GoogleContactsIntegration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
```python
import os
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request

# If modifying these SCOPES, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/contacts.readonly']

def get_google_contacts():
"""Shows basic usage of the People API.
Lists the user's contacts.
"""
creds = None
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open('token.pickle', 'wb') as token:
pickle.dump(creds, token)

service = build('people', 'v1', credentials=creds)

# Call the People API
print('List of contacts:')
results = service.people().connections().list(
resourceName='people/me',
pageSize=100,
personFields='names,emailAddresses').execute()
connections = results.get('connections', [])

for person in connections:
names = person.get('names', [])
if names:
name = names[0].get('displayName')
print(name)

if __name__ == '__main__':
get_google_contacts()
```
34 changes: 34 additions & 0 deletions ExecutiveAssistant/LearningDevelopment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
```python
import requests
from datetime import datetime

class LearningDevelopment:
def __init__(self, user_id):
self.user_id = user_id
self.courses = []
self.webinars = []

def fetch_courses(self, topic):
response = requests.get(f"https://api.courses.com/{topic}")
self.courses = response.json()

def fetch_webinars(self, topic):
response = requests.get(f"https://api.webinars.com/{topic}")
self.webinars = response.json()

def enroll_course(self, course_id):
response = requests.post(f"https://api.courses.com/enroll/{course_id}", data={"user_id": self.user_id})
return response.status_code == 200

def register_webinar(self, webinar_id):
response = requests.post(f"https://api.webinars.com/register/{webinar_id}", data={"user_id": self.user_id})
return response.status_code == 200

def get_upcoming_courses(self):
upcoming_courses = [course for course in self.courses if datetime.strptime(course['start_date'], '%Y-%m-%d') > datetime.now()]
return upcoming_courses

def get_upcoming_webinars(self):
upcoming_webinars = [webinar for webinar in self.webinars if datetime.strptime(webinar['start_date'], '%Y-%m-%d') > datetime.now()]
return upcoming_webinars
```
31 changes: 31 additions & 0 deletions ExecutiveAssistant/NetworkManagement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
```python
import networkx as nx

class NetworkManagement:
def __init__(self):
self.network = nx.Graph()

def add_connection(self, node1, node2):
self.network.add_edge(node1, node2)

def remove_connection(self, node1, node2):
self.network.remove_edge(node1, node2)

def get_connections(self, node):
return list(self.network.neighbors(node))

def shortest_path(self, source, target):
return nx.shortest_path(self.network, source, target)

def visualize_network(self):
nx.draw(self.network, with_labels=True)

# Example usage
if __name__ == "__main__":
ea_network = NetworkManagement()
ea_network.add_connection('EA1', 'EA2')
ea_network.add_connection('EA2', 'EA3')
print(ea_network.get_connections('EA2'))
print(ea_network.shortest_path('EA1', 'EA3'))
ea_network.visualize_network()
```
Loading