用于google驱动器的pyfilesystem2实现
fs.googledrivefs的Python项目详细描述
用法
fs=GoogleDriveFS(credentials=<google-authcredentials>)# fs is now a standard pyfilesystem2 file systemfs2=open_fs("googledrive:///?access_token=<oauth2 access token>&refresh_token=<oauth2 refresh token>&client_id=<oauth2 client id>&client_secret=<oauth2 client_secret>")# fs2 is now a standard pyfilesystem2 file system
运行测试
要运行测试,请设置以下环境变量:
googledrivefs_test_credentials_path-包含凭据的json文件的路径 googledrivefs_test_client_id-您的客户端id(请参阅google开发者控制台) googledrivefs_test_client_secret-您的客户端机密(请参阅谷歌开发人员控制台)
然后通过运行
python tests/generate-credentials.py
然后执行
pytest
在根目录中。测试可能需要一两个小时才能完成。他们创建并销毁许多文件和目录,这些文件和目录只在用户的google驱动器中的/test googledrivefs目录下