将主机公共IP写入Google驱动器。
ipgdrive的Python项目详细描述
将主机的公共IP地址写入Google驱动器上的文件的服务。
# after setting up ~/.config/ipgdrive/cfg.json# setup a cronjob to write the public ip address to# Google doc every 5 minutesipgdrivesetupjob-m5
内容
1 Installation
pip install ipgdrive
2 Setup
要启用google drive access,请按照instructions here使用google drive access创建服务帐户,并为其创建json密钥文件。
不要忘了遵循以上所有说明,包括将电子表格与json_key['client_email']中的电子邮件共享(否则,在尝试打开电子表格时,将出现SpreadsheetNotFound或APIError的"PERMISSION_DENIED"异常)。
将此文件放在~/.config/ipgdrive/文件夹中,并将其重命名为google_drive_service_account_key.json。
另外,在~/.config/ipgdrive/文件夹中创建一个cfg.json文件,并用以下值填充它:
{"spreadsheet_name":"my_server_public_ip","username":"momo","freq_minutes":5}
用户名是在服务器上运行进程的用户的,而不是google帐户用户名。
3 Use
# after setting up ~/.config/ipgdrive/cfg.json# setup a cronjob to write the public ip address to# Google doc every 5 minutesipgdrivesetupjob-m5
4 Contributing
包作者和当前维护者是shay palachy(shay.palachy@gmail.com);非常欢迎您向他寻求帮助。捐款是非常受欢迎的。
4.1 Installing for development
克隆:
git clone git@github.com:shaypal5/ipgdrive.git
以开发模式安装,包括测试依赖项:
cd ipgdrive pip install -e '.[test]'
4.3 Adding documentation
该项目使用numpy docstring conventions进行文档记录,之所以选择它们,是因为它们可能是最广泛传播的约定,既受sphinx等常用工具的支持,又产生了人类可读的docstring。在记录添加到此项目中的代码时,请遵循these conventions。
此外,如果您更新了这个README.rst文件,请使用python setup.py checkdocs验证它的编译。