O365 - Microsoft Graph and Office 365 API made easy
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Active Directory integration for user management, group operations, and organizational information access.
def directory(self, resource: str = None) -> Directory:
"""Get a Directory instance for Active Directory operations."""
class Directory:
def get_users(self, limit: int = None, **filters) -> list[User]:
"""Get directory users."""
def get_user(self, user_id: str) -> User:
"""Get a specific user by ID."""
def search_users(self, search_text: str) -> list[User]:
"""Search for users."""
class User:
@property
def display_name(self) -> str:
"""User display name."""
@property
def email(self) -> str:
"""User email address."""
@property
def job_title(self) -> str:
"""User job title."""
@property
def department(self) -> str:
"""User department."""
def get_manager(self) -> 'User':
"""Get user's manager."""
def get_direct_reports(self) -> list['User']:
"""Get user's direct reports."""account = Account(credentials)
directory = account.directory()
# Get all users
users = directory.get_users(limit=100)
for user in users:
print(f"User: {user.display_name}")
print(f"Email: {user.email}")
print(f"Title: {user.job_title}")
print("---")
# Search for specific users
managers = directory.search_users("manager")Install with Tessl CLI
npx tessl i tessl/pypi-o365