Package: privex-curconv
Privex Python Currency Converter CLIA small CLI tool for quick currency conversions on the command lineOfficial Repo:https://github.com/Privex/python-curconv+===================================================+
|                 © 2021 Privex Inc.                |
|               https://www.privex.io               |
+===================================================+
|                                                   |
|        Python Currency Converter CLI              |
|        License: X11/MIT                           |
|                                                   |
|        Core Developer(s):                         |
|                                                   |
|          (+)  Chris (@someguy123) [Privex]        |
|                                                   |
+===================================================+

Python Currency Converter CLI - A small CLI tool for quick currency conversions on the command line
Copyright (c) 2021    Privex Inc. ( https://www.privex.io )QuickstartInstall# We recommend using the highest version of Python available on your system,# check by typing 'python3.' and pushing tab (on some shells you may need to# press tab two or three times for tab suggestions).python3.8-mpipinstall-Uprivex-curconv# If you can't use 'python3.x -m pip', then you can install using the classic 'pip3'# command, which will generally use your system default python3 version.pip3install-Uprivex-curconv# If you want to be able to support caching rates in both Redis and Memcached,# install privex-curconv with the 'cache' extra:python3.8-mpipinstall-U'privex-curconv[cache]'# If you only want either Redis OR Memcached support, you can install with# the appropriate extra, depending on which cache you want.python3.8-mpipinstall-U'privex-curconv[redis]'python3.8-mpipinstall-U'privex-curconv[memcached]'Using the toolFirst figure out whether you can useconv- or if you'll need to usepython3 -m privex.curconv# By default, this package should install the 'conv' utility into /usr/local/bin, or ~/.local/bin# so that you can just type the 'conv' command like so:conv--help# If for some reason the 'conv' command doesn't work, you can also run the CLI tool using the# python3 module executor argument:python3-mprivex.curconv--helpNow lets try it out - it should work out of the box:Get the exchange rate for20 USDtoGBPconv20usdtogbpIf you'd rather it showx.xx USD = x.xx GBPrather than justx.xx, you can pass-fto enable "full mode":conv-f20usdtogbpIf you want a different number of decimal places on the exchange rates, you can use the flag-d/-dp/--dp/--decimalse.g.-dp 5means 5 decimal places, so this would output14.48240(at the time of writing):conv-dp520usdtogbpGet all exchange rates for GBP, but only show thefavourite currencieswhich by default are:USD, EUR, GBP, CAD, SEK, TRYconv1gbpYou can also specify currency amounts with symbols, however, you may need to quote your query if you use symbols, as they may upset your shell:conv'£20.00'conv'$50 to CAD'conv-f'CA$30 to £'If you want to dynamically adjust thefavourite currenciesfor a single query, you can use the-cflag:conv-cAUD,NZD,CAD,HKD,CHF5000SEKIf you want to see ALL available exchange rates for a given currency + amount, you can use the-aflag:conv-a20gbpConfiguring the toolDynamically pass ENV vars via the system environmentFor a single command, you can pass "inline ENV variables" to change the environment for just that
single command:CURRENCY_LIST="CHF,CAD,AUD,BZD"DEFAULT_DP=4CACHE_ADAPTER=redisconv-f'5 usd'If you want to temporarily change certain settings, and have them persist for several commands, but
without having to permanently alter your configuration - you can simply EXPORT the ENV vars in your shell,
and they'll stick until you either close your terminal/shell, or manually unset them:exportCURRENCY_LIST="CHF,CAD,AUD,BZD"exportDEFAULT_DP=4exportCACHE_ADAPTER=redis

conv-f'5 usd'conv-f'10.2361 eur'unsetCURRENCY_LIST
conf-f'2.4829 HKD'unsetDEFAULT_DPCACHE_ADAPTERGenerate and create the default ENV file in one commandYou can quickly generate a template default ENV config file at~/.curconv.envby running
the tool with the-Gd(G = generate, d = default config) flag:user@example~$conv-Gd>>>GeneratingENVfiletodefaultlocation:/Users/example/.curconv.env+++SuccessfullywroteENVfiletodefaultlocation:/Users/example/.curconv.envThe ENV generator commands generate an ENV config with all major supported ENV vars set to their
default settings, unless it inherited some config vars from the environment, or from a config file.The settings that it dumps, are the ones that were actually configured in memory at the time of
running the command.All of the generated ENV vars are optional, so you should remove or comment out any ENV vars which
you aren't changing from the default, so that it's clear which ENV vars you've changed, and which ones
are still set to their defaults.Config search pathBy default, the tool searches the following locations in order for a config file, and it will
only use the first file it finds:~/.curconv~/.curconv.env(the file which-Gdoutputs to)/etc/curconv/etc/curconv.envGenerate an ENV file to stdoutIf you want to generate/dump the current configuration in ENV format, but without it being written
to a file, you can use-Gon it's own, which will generate the same ENV configuration as-Gddoes,
but outputs it to STDOUT instead of to a file (which you can easily pipe).user@example~$conv-GDEBUG=falseLOG_LEVEL=WARNINGAPI_BASE=https://api.ratesapi.io/apiAPI_CACHE_TIME=3600CACHE_ADAPTER=sqliteDEFAULT_DP=3BASE_COIN=EURCURRENCY_LIST=USD,EUR,GBP,CAD,SEK,TRYCUR_SYMBOLS=CA$:CAD,CAD$:CAD,AU$:AUD,AUD$:AUD,NZ$:NZD,NZD$:NZD,$:USD,€:EUR,£:GBP,kr:SEKFor example, you could pipe it intosudo teeto write the configuration to a file which isn't
writable by your current user, e.g./etc/curconv.envconv-G|sudotee/etc/curconv.envGenerate an ENV file and output it directly to a fileYou can also use-Gwith-Gf [file]to generate an ENV file AND output it to a file of your choice.NOTE: Unlike-Gd, the-Gfargument does not work on it's own, you must specify-Gto generate an ENV
configuration, and use-Gfto override where it outputs from the default of stdout.user@example~$conv-G-Gf/tmp/convtest.env>>>GeneratingENVfiletocustomlocation:/tmp/convtest.env+++SuccessfullywroteENVfiletocustomlocation:/tmp/convtest.env