Skip to main content

Gold price tracker CLI tool

Project description

What is GPrice

Static Badge PyPI - Version
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gprice-0.2.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gprice-0.2.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file gprice-0.2.1.tar.gz.

File metadata

  • Download URL: gprice-0.2.1.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

Hashes for gprice-0.2.1.tar.gz
Algorithm Hash digest
SHA256 429f328a77155744b3706c6dbb0953223d4393771d2235b0bf72a2abd5419b57
MD5 f084323900404a40d4ce1a6351d09e59
BLAKE2b-256 ff56cbf94c0bb1db5ac68debb281a9fb4207c12cc3730583e5eea0c03eb71fa5

See more details on using hashes here.

File details

Details for the file gprice-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gprice-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for gprice-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 098b0f6054f67e244bbbc613aec3820c94fdf1def74a7392384dc2509a30ed7a
MD5 9e9786713c2050e5aeb37bf6602c4b90
BLAKE2b-256 8b66f024c1900394d18e0bdad8109f803943074e59125a2ee3f14c16da43cefd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page