Write host public ip to Google Drive.
Project description
A service that writes the public ip address of the host computer to a file on Google Drive.
# after setting up ~/.config/ipgdrive/cfg.json
# setup a cronjob to write the public ip address to
# Google doc every 5 minutes
ipgdrive setupjob -m 5
1 Installation
pip install ipgdrive
2 Setup
To enable Google Drive access, follow the instructions here to create a service account with Google Drive access, and create a json key file for it.
Don’t forget to follow all the above instructions, including sharing your spreadsheet with an email you have in your json_key['client_email'] (Otherwise you’ll get a SpreadsheetNotFound or an APIError with "PERMISSION_DENIED" exception when trying to open it).
Place this file in the ~/.config/ipgdrive/ folder, and rename it to google_drive_service_account_key.json.
Additionally, create a cfg.json file inside the ~/.config/ipgdrive/ folder, and populate it with the following values:
{
"spreadsheet_name": "my_server_public_ip",
"username": "momo",
"freq_minutes": 5
}
The username is for the user running the process on the server, NOT the Google account username.
3 Use
# after setting up ~/.config/ipgdrive/cfg.json
# setup a cronjob to write the public ip address to
# Google doc every 5 minutes
ipgdrive setupjob -m 5
4 Contributing
Package author and current maintainer is Shay Palachy (shay.palachy@gmail.com); You are more than welcome to approach him for help. Contributions are very welcomed.
4.1 Installing for development
Clone:
git clone git@github.com:shaypal5/ipgdrive.git
Install in development mode, including test dependencies:
cd ipgdrive
pip install -e '.[test]'
4.2 Running the tests
To run the tests use:
cd ipgdrive
pytest
4.3 Adding documentation
The project is documented using the numpy docstring conventions, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings. When documenting code you add to this project, follow these conventions.
Additionally, if you update this README.rst file, use python setup.py checkdocs to validate it compiles.
5 Credits
Created by Shay Palachy (shay.palachy@gmail.com).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for ipgdrive-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cf9afec59e1e7c042549c0be36a08f028e301b7f8f47ab3b71d52c7f1b8b4f9 |
|
MD5 | 8bbb3237c9550fb9c260317ad14deac6 |
|
BLAKE2b-256 | fc1f579a6c96f7eb4d77419bdfbe8dd8850418e1fff40f3764bf0edc24fd8db8 |