# metecli
[![Code Health](https://landscape.io/github/YtvwlD/metecli/master/landscape.svg?style=plastic)](https://landscape.io/github/YtvwlD/metecli/master)
This is a CLI for [mete](https://github.com/chaosdorf/mete/)
(or any other server supporting the [Space-Market API](https://github.com/Space-Market/API) [v1](https://space-market.github.io/API/preview/v1)).
## Getting Started
### Installation
Although 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 version
`sudo -H pip3 install metecli`
#### Installing the development version
1. Clone this repository. (`git clone https://github.com/YtvwlD/metecli.git`)
2. Install it. (`sudo -H ./setup.py install`)
#### Or just use it without installing
1. Clone this repository. (`git clone https://github.com/YtvwlD/metecli.git`)
2. Install the dependencies (either via your distribution's package manager or via pip):
1. requests
2. PyYAML
3. tabulate
4. typing (not needed when running on Python 3.5 or newer)
3. Start it. (`./run.sh`)
4. Remember to mentally replace `metecli` with `./run.sh` in the next sections.
### Configuration
The initial configuration is done by calling `metecli 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: 1
```
metecli is now configured and ready.
## a few use-cases
### buy a drink
```
$ metecli account buy Mate
```
### deposit money
```
$ metecli account deposit 2.50
```
### show 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 transactions
You'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]:
```
Raw data
{
"_id": null,
"home_page": "https://github.com/YtvwlD/metecli",
"name": "metecli",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.3",
"maintainer_email": null,
"keywords": "mete",
"author": "Niklas Sombert",
"author_email": "niklas@ytvwld.de",
"download_url": null,
"platform": null,
"description": "# metecli\n\n[![Code Health](https://landscape.io/github/YtvwlD/metecli/master/landscape.svg?style=plastic)](https://landscape.io/github/YtvwlD/metecli/master)\n\nThis is a CLI for [mete](https://github.com/chaosdorf/mete/)\n(or any other server supporting the [Space-Market API](https://github.com/Space-Market/API) [v1](https://space-market.github.io/API/preview/v1)).\n\n## Getting Started\n\n### Installation\n\nAlthough this isn't strictly needed\nyou might want to install metecli first before using it.\n\nUpgrading (or downgrading) is done the same way as installing.\n\n#### Installing the current stable version\n\n`sudo -H pip3 install metecli`\n\n#### Installing the development version\n\n1. Clone this repository. (`git clone https://github.com/YtvwlD/metecli.git`)\n2. Install it. (`sudo -H ./setup.py install`)\n\n#### Or just use it without installing\n\n1. Clone this repository. (`git clone https://github.com/YtvwlD/metecli.git`)\n2. Install the dependencies (either via your distribution's package manager or via pip):\n 1. requests\n 2. PyYAML\n 3. tabulate\n 4. typing (not needed when running on Python 3.5 or newer)\n3. Start it. (`./run.sh`)\n4. Remember to mentally replace `metecli` with `./run.sh` in the next sections.\n\n### Configuration\n\nThe initial configuration is done by calling `metecli setup`. You'll see an exemplary invocation below:\n\n```\n$ metecli setup\nPlease enter the url for mete: http://mete/\nThe URL you entered doesn't use HTTPS. Do you want to try again? (y/n) n\nWARNING:metecli.setup:Using HTTP. The connection won't be secure.\nDo want to setup an account now? (y/n) y\nDo you already have an account? (y/n) y\nPlease enter your username (or a part of it) or your uid: 1\n```\n\nmetecli is now configured and ready.\n\n## a few use-cases\n\n### buy a drink\n\n```\n$ metecli account buy Mate\n```\n\n### deposit money\n\n```\n$ metecli account deposit 2.50\n```\n\n### show information about your account\n\n```\n$ metecli account show\n+----------------------------------+---------+\n| ID | 2 |\n+----------------------------------+---------+\n| name | test |\n+----------------------------------+---------+\n| email | |\n+----------------------------------+---------+\n| account balance | -1.50 \ufffd\ufffd\ufffd |\n+----------------------------------+---------+\n| active? | no |\n+----------------------------------+---------+\n| log transactions? | no |\n+----------------------------------+---------+\n| redirect after buying something? | yes |\n+----------------------------------+---------+\n```\n\n### modify your account\n\n```\n$ metecli account modify\nname [test]: \nemail []: test@example.com\naccount balance [-1.5]: \nactive? [no]: yes\nlog transactions? [no]: \nredirect after buying something? [yes]:\n```\n\n### list your recent transactions\n\nYou'll need to have the setting \"log transactions\" (`audit`) enabled for this to work.\n\n```\n$ metecli account logs\nAudits for user 1:\n+--------------------------+---------+--------------+\n| time | drink | difference |\n+==========================+=========+==============+\n| 2017-09-11T09:01:23.816Z | Mate | -1.5 |\n+--------------------------+---------+--------------+\n| 2017-09-10T13:41:50.372Z | n/a | -5 |\n+--------------------------+---------+--------------+\n```\n\n### list all drinks\n\n```\n$ metecli drinks list\nAll drinks:\n+------+---------+---------------+------------+---------+-----------+\n| ID | name | bottle size | caffeine | price | active? |\n+======+=========+===============+============+=========+===========+\n| 1 | Mate | 0.5 | | 1.50 \ufffd\ufffd\ufffd | yes |\n+------+---------+---------------+------------+---------+-----------+\n| 2 | Cola | 0 | | 1.50 \ufffd\ufffd\ufffd | yes |\n+------+---------+---------------+------------+---------+-----------+\n```\n\n### display information about a drink\n\n```\n$ metecli drinks show Mate\n+-------------+--------+\n| ID | 1 |\n+-------------+--------+\n| name | Mate |\n+-------------+--------+\n| price | 1.50 \ufffd\ufffd\ufffd |\n+-------------+--------+\n| bottle size | 0.5 |\n+-------------+--------+\n| caffeine | |\n+-------------+--------+\n| active? | yes |\n+-------------+--------+\n```\n\n### modify a drink\n\n```\n$ metecli drinks modify Mate\nname [Mate]: \nprice [1.5]: \nbottle size [0.5]: \ncaffeine [None]: 100\nactive? [yes]:\n```\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "a cli for mete",
"version": "0.10.2",
"project_urls": {
"Homepage": "https://github.com/YtvwlD/metecli"
},
"split_keywords": [
"mete"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21f381d7a1ed7303000b83a7a7580ebfd2c4bd592821877044b8f6bfbd035cdc",
"md5": "ed34557659dd658a0e00b7c147c7df7d",
"sha256": "3e47e832caa68d9eb53a9a41a49d788fd6f71ee18bba3262dde7bad12bccd15c"
},
"downloads": -1,
"filename": "metecli-0.10.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ed34557659dd658a0e00b7c147c7df7d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": "~=3.3",
"size": 40668,
"upload_time": "2024-12-07T13:51:52",
"upload_time_iso_8601": "2024-12-07T13:51:52.214889Z",
"url": "https://files.pythonhosted.org/packages/21/f3/81d7a1ed7303000b83a7a7580ebfd2c4bd592821877044b8f6bfbd035cdc/metecli-0.10.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-07 13:51:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "YtvwlD",
"github_project": "metecli",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "metecli"
}