Gold price tracker CLI tool
Project description
What is GPrice
GPrice is a CLI-tool for tracking gold price, allowing you to easily and simply setting up notifications for Email using simple commands
Table Of Contents
Get Started
Step 1: Install gprice with pip
pip install gprice
[!Warning] Recommend to create virtual environment before installation
Alternatively, if you do not want to, you may need to add python to PATH ENVIRONMENT VARIABLE (work only in window)
Step 2: Check gprice availability
gprice --version
expected output
Gold price tracker [CLI Tool] x.x.x
Step 3: Set user agent
gprice set-config --header user-agent="your prefer user-agent"
Step 4: Get app password
First, you need to get app password for gmail or alternatives like outlook
Step 5: Set sender's email
gprice set-credential -sm "your_sender@gmail.com"
The program will ask you to input "app password"
Enter app password: *****************
Step 6: Check configuration correctness
After having all previos steps completed, you may want to check all configuration and credentials
gprice -i
Commands
gprice set-config [option] [option Parameters]
| option | application | parameters |
|---|---|---|
| --header or --header | to config header properties | server="your prefer smtp server" |
| -smtp or --smtp | to config SMTP properties for sending email | user-agent="your user-agent" |
example usage:
gprice set-config -smtp server="smtp.gmail.com" -header user-agent="<your user-agent>"
gprice set-credential [option]
| option | application | parameters |
|---|---|---|
| -sm or --sender_email | to set up sender email for notification | - |
example usage:
gprice set-credential -sm "your_email@gmail.com"
gprice get [options] [option Parameters]
| option | application | parameters |
|---|---|---|
| -c or --currency | to set currency for gold price | currency code (eg. USD, THB) |
| -p or --purity | to set purity of gold (Default is 100%) | percentage (e.g., 95%) |
| -u or --unit_type | to set gold weight unit (Default is oz) see available gold weight units | available weight units (eg. oz) |
example usage:
gprice get -c USD -p 95% -u oz
gprice noti [options]
| option | application | parameters |
|---|---|---|
| -c or --currency | to set currency for gold price | currency code (eg. USD, THB) |
| -p or --purity | to set purity of gold (Default is 100) | percentage (e.g., 95%) |
| -u or --unit_type | to set gold weight unit (Default is oz) see available gold weight units | available weight units (eg. oz) |
| -eve or --every | run-time scheduler for running a command (not recommend) | - |
| -to or --to | to set receiver email | - |
| -if or --if | to set condition to trigger notification eg. send notification when price goes down by 500usd |
- |
Built-in scheduler (-eve)
-eve (prefix)[hh:mm:ss]
| prefix | example | translation |
|---|---|---|
| t | t[02:00:00] | every 2 hours |
| d, 2d, .. nd | d[02:00:00] | everyday at 2:00 AM. |
| mon-sun | mon[02:00:00] | every monday at 2:00 AM. |
gprice noti -c USD -to "receiver@hotmail.com" -eve 2d[02:00:00]
the above command can be translated to this
report the current gold price to "receiver@hotmail.com" every 2 day at 2:00 AM.
Set condition with (-if)
up[x] = when price goes up to x
down[x] = when price goes down to x
example usage:
gprice noti -c USD -to "receiver@hotmail.com" -eve t[00:05:00] -if up[500] down[500]
the above command can be translated to this
the gold price (USD) is checked every 5 mins and if the price goes up or goes down by 500USD, the notification is sent to the receiver mail.
Available Weight Units
- oz
- thai_baht
- china_tael
- hk_tael
- taiwan_tael
- tola
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gprice-0.2.2.tar.gz.
File metadata
- Download URL: gprice-0.2.2.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a2ec4e36153425c937eb47c03c584c2811ee2160be8df7d1999a9a221c2e986
|
|
| MD5 |
c9be6bb09541112601fe0327a1c6fe3f
|
|
| BLAKE2b-256 |
586651172b51a1ffacfc342ab05bde7419ac13c1757b3f80e7e83f0b7e7edeb8
|
File details
Details for the file gprice-0.2.2-py3-none-any.whl.
File metadata
- Download URL: gprice-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30b53c63c720d5079ac9e0bc0dbb04a97568940ee84c57e7f28b52e572d47ed2
|
|
| MD5 |
179ed8e06a8d38d23e0d7f7f70a09fe3
|
|
| BLAKE2b-256 |
76ad6e88508ee56366c30ccbee0254116a6429e2d57aff167a20434faf9f693c
|