使用Python访问Fastmail CalDAV

2024-10-01 01:49:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过Python访问我的Fastmail日历。我使用的是caldav模块,这是由{a1}建议的。我的代码是这样的:

def main():
    auth = HTTPBasicAuth(username='mail@domain.com', password='myapplicationpassword')
    client = caldav.DAVClient('https://caldav.fastmail.com', auth=auth)
    try:
        client.principal()
    except Exception as e:
        print(e)

并且client.principal()引发异常:

^{pr2}$

我也尝试了client = caldav.DAVClient('https://caldav.fastmail.com', username='mail@domain.com', password='myapplicationpassword')并获得了相同的结果。在

最后,我查看了caldav example using iCloud,并尝试用fastmail重现相同的想法。我遇到了同样的问题(principal_response状态代码为404)。在

我错过了什么?在


Tags: 代码httpscomclientauthprincipaldomainusername