$ whoami
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class Andy:
"""
A digital archive of technical practices, infrastructure, and deployment.
"""
name: str = "Andy"
born_year: int = 1982
mbti: Optional[str] = None
location: str = "California"
education: List[str] = field(default_factory=lambda: ["USD"])
def get_status(self) -> str:
return f"Engaged in technical work in {self.location}, US"
def profile(self) -> dict:
return {
"name": self.name,
"born_year": self.born_year,
"location": self.location,
"mbti": self.mbti or "Processing...",
"education": self.education
}
# Instance
me = Andy()
print(me.get_status())
$ ping me
contact_info = {
"email": "[email protected]",
"blog": "https://www.andyio.com",
"status": "Ready to sync"
}
handlers = {
"status": lambda v: print(f"Status: {v}")
}
for platform, address in contact_info.items():
if platform in handlers:
handlers[platform](address)
else:
print(f"Connecting to {platform} at {address}...")