Package: metecli
This is a CLI formete(or any
other server supporting theSpace-Market
APIv1).Getting StartedInstallationAlthough this isn’t strictly needed you might want to install metecli
first before using it.Upgrading (or downgrading) is done the same way as installing.Installing the current stable versionsudo-Hpip3 install metecliInstalling the development versionClone this repository.
(git clonehttps://github.com/YtvwlD/metecli.git)Install it. (sudo-H./setup.py install)Or just use it without installingClone this repository.
(git clonehttps://github.com/YtvwlD/metecli.git)Install the dependencies (either via your distribution’s package
manager or via pip):requestsPyYAMLtabulatetyping (not needed when running on Python 3.5 or newer)Start it. (./run.sh)Remember to mentally replacemetecliwith./run.shin the
next sections.ConfigurationThe initial configuration is done by callingmetecli setup. You’ll
see an exemplary invocation below:$ metecli setup
Please enter the url for mete: http://mete/
The URL you entered doesn't use HTTPS. Do you want to try again? (y/n) n
WARNING:metecli.setup:Using HTTP. The connection won't be secure.
Do want to setup an account now? (y/n) y
Do you already have an account? (y/n) y
Please enter your username (or a part of it) or your uid: 1metecli is now configured and ready.a few use-casesbuy a drink$ metecli account buy Matedeposit money$ metecli account deposit 2.50show information about your account$ metecli account show
+----------------------------------+---------+
| ID                               | 2       |
+----------------------------------+---------+
| name                             | test    |
+----------------------------------+---------+
| email                            |         |
+----------------------------------+---------+
| account balance                  | -1.50 € |
+----------------------------------+---------+
| active?                          | no      |
+----------------------------------+---------+
| log transactions?                | no      |
+----------------------------------+---------+
| redirect after buying something? | yes     |
+----------------------------------+---------+modify your account$ metecli account modify
name [test]:
email []: test@example.com
account balance [-1.5]:
active? [no]: yes
log transactions? [no]:
redirect after buying something? [yes]:list your recent transactionsYou’ll need to have the setting “log transactions” (audit) enabled
for this to work.$ metecli account logs
Audits for user 1:
+--------------------------+---------+--------------+
| time                     | drink   |   difference |
+==========================+=========+==============+
| 2017-09-11T09:01:23.816Z | Mate    |         -1.5 |
+--------------------------+---------+--------------+
| 2017-09-10T13:41:50.372Z | n/a     |         -5   |
+--------------------------+---------+--------------+list all drinks$ metecli drinks list
All drinks:
+------+---------+---------------+------------+---------+-----------+
|   ID | name    |   bottle size | caffeine   | price   | active?   |
+======+=========+===============+============+=========+===========+
|    1 | Mate    |           0.5 |            | 1.50 €  | yes       |
+------+---------+---------------+------------+---------+-----------+
|    2 | Cola    |           0   |            | 1.50 €  | yes       |
+------+---------+---------------+------------+---------+-----------+display information about a drink$ metecli drinks show Mate
+-------------+--------+
| ID          | 1      |
+-------------+--------+
| name        | Mate   |
+-------------+--------+
| price       | 1.50 € |
+-------------+--------+
| bottle size | 0.5    |
+-------------+--------+
| caffeine    |        |
+-------------+--------+
| active?     | yes    |
+-------------+--------+modify a drink$ metecli drinks modify Mate
name [Mate]:
price [1.5]:
bottle size [0.5]:
caffeine [None]: 100
active? [yes]: