efs-cli 1.0.0__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: efs-cli
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: EepyFileServer API CLI written in Python
5
5
  Author: maxie
6
6
  License-Expression: MIT
@@ -20,7 +20,7 @@ Requires-Dist: requests>=2.30
20
20
  Requires-Dist: efs-wrapper
21
21
  Dynamic: license-file
22
22
 
23
- # eepyfileserver-cli
23
+ # efs-cli (formerly eepyfileserver-cli)
24
24
 
25
25
  command line interface for eepyfileserver written in python
26
26
 
@@ -40,41 +40,64 @@ command line interface for eepyfileserver written in python
40
40
  ```bash
41
41
  #login fully (lets you upload and download files)
42
42
  #password is saved in PLAIN TEXT
43
- python3 eepyfileserver.py instance "https://example.com" "password123"
43
+ efs-cli auth "https://example.com" "password123"
44
44
 
45
45
  #login only using the url (lets you download PUBLIC files)
46
- python3 eepyfileserver.py instance "https://example.com"
46
+ efs-cli auth "https://example.com"
47
47
 
48
- python3 eepyfileserver.py login ...
48
+ efs-cli login ...
49
+ ```
50
+
51
+ ### view version
52
+
53
+ ```bash
54
+ efs-cli version
55
+ efs-cli ver
56
+ ```
57
+
58
+ ### view instance information
59
+
60
+ ```bash
61
+ efs-cli instance
62
+ efs-cli info
49
63
  ```
50
64
 
51
65
  ### list files
52
66
 
53
67
  ```bash
54
- python3 eepyfileserver.py list
55
- python3 eepyfileserver.py ls
68
+ efs-cli list
69
+ efs-cli ls
70
+ efs-cli files
56
71
  ```
57
72
 
58
73
  ### download a file
59
74
 
60
75
  ```bash
61
- python3 eepyfileserver.py download /example.txt /home/maxeepy/Downloads/example.txt
62
- python3 eepyfileserver.py get ...
63
- python3 eepyfileserver.py d ...
76
+ efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
77
+ efs-cli get ...
78
+ efs-cli d ...
64
79
  ```
65
80
 
66
81
  ### upload a file
67
82
 
68
83
  ```bash
69
- python3 eepyfileserver.py upload /home/maxeepy/Downloads/example.txt /example.txt
70
- python3 eepyfileserver.py post ...
71
- python3 eepyfileserver.py up ...
84
+ efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
85
+ efs-cli post ...
86
+ efs-cli up ...
87
+ efs-cli put ...
72
88
  ```
73
89
 
74
90
  ### delete a file
75
91
 
76
92
  ```bash
77
- python3 eepyfileserver.py delete /example.txt
78
- python3 eepyfileserver.py remove ...
79
- python3 eepyfileserver.py rm ...
93
+ efs-cli delete /example.txt
94
+ efs-cli remove ...
95
+ efs-cli rm ...
96
+ ```
97
+
98
+ ### read a file
99
+
100
+ ```bash
101
+ efs-cli read /example.txt
102
+ efs-cli cat ...
80
103
  ```
@@ -0,0 +1,81 @@
1
+ # efs-cli (formerly eepyfileserver-cli)
2
+
3
+ command line interface for eepyfileserver written in python
4
+
5
+ ## prerequisites
6
+
7
+ - python 3.10 (3.12+ required)
8
+ - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
9
+
10
+ ## install
11
+
12
+ `pip install efs-cli`
13
+
14
+ ## usage
15
+
16
+ ### log in to an instance
17
+
18
+ ```bash
19
+ #login fully (lets you upload and download files)
20
+ #password is saved in PLAIN TEXT
21
+ efs-cli auth "https://example.com" "password123"
22
+
23
+ #login only using the url (lets you download PUBLIC files)
24
+ efs-cli auth "https://example.com"
25
+
26
+ efs-cli login ...
27
+ ```
28
+
29
+ ### view version
30
+
31
+ ```bash
32
+ efs-cli version
33
+ efs-cli ver
34
+ ```
35
+
36
+ ### view instance information
37
+
38
+ ```bash
39
+ efs-cli instance
40
+ efs-cli info
41
+ ```
42
+
43
+ ### list files
44
+
45
+ ```bash
46
+ efs-cli list
47
+ efs-cli ls
48
+ efs-cli files
49
+ ```
50
+
51
+ ### download a file
52
+
53
+ ```bash
54
+ efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
55
+ efs-cli get ...
56
+ efs-cli d ...
57
+ ```
58
+
59
+ ### upload a file
60
+
61
+ ```bash
62
+ efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
63
+ efs-cli post ...
64
+ efs-cli up ...
65
+ efs-cli put ...
66
+ ```
67
+
68
+ ### delete a file
69
+
70
+ ```bash
71
+ efs-cli delete /example.txt
72
+ efs-cli remove ...
73
+ efs-cli rm ...
74
+ ```
75
+
76
+ ### read a file
77
+
78
+ ```bash
79
+ efs-cli read /example.txt
80
+ efs-cli cat ...
81
+ ```
@@ -0,0 +1,2 @@
1
+ __version__ = "1.0.2"
2
+
@@ -1,6 +1,6 @@
1
1
  from . import __version__ as version
2
2
  from efs_wrapper import __version__ as wrapper_version
3
- from efs_wrapper.v1 import EepyFileServer, EepyFileServerPublic
3
+ from efs_wrapper.v1 import EepyFileServer, EepyFileServerPublic, DiskUsageObject
4
4
  from argparse import ArgumentParser
5
5
  import os
6
6
  import json
@@ -77,7 +77,18 @@ def ver(**__):
77
77
  print(f"efs-wrapper: {wrapper_version}")
78
78
  if conf and conf.get("base_url"):
79
79
  api = init_api()
80
- print(f"EepyFileServer: {api.get_instance_info()['instance']['version']}")
80
+ print(f"EepyFileServer ({conf['base_url']}): {api.get_instance_info()['instance']['version']}")
81
+
82
+ def instance(**__):
83
+ api = init_api()
84
+ instance_info = api.get_instance_info()["instance"]
85
+ disk_usage = DiskUsageObject(**instance_info["disk_usage"])
86
+ print("Instance Information:")
87
+ print(f" API Version: {instance_info['version']}")
88
+ print(" Disk Usage:")
89
+ print(f" Total: {disk_usage.human.total} Megabytes")
90
+ print(f" Used : {disk_usage.human.used} Megabytes")
91
+ print(f" Free : {disk_usage.human.free} Megabytes")
81
92
 
82
93
  def main():
83
94
  parser = ArgumentParser("efs-cli", description="eepyfileserver cli tool for downloading and uploading files")
@@ -112,6 +123,9 @@ def main():
112
123
  version_parser = subparser.add_parser("version", help="view efs-cli and dependencies versions", aliases=["ver"])
113
124
  version_parser.set_defaults(func=ver)
114
125
 
126
+ instance_parser = subparser.add_parser("instance", help="view eepyfileserver instance info", aliases=["info"])
127
+ instance_parser.set_defaults(func=instance)
128
+
115
129
  args = parser.parse_args()
116
130
  args.func(**vars(args))
117
131
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: efs-cli
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: EepyFileServer API CLI written in Python
5
5
  Author: maxie
6
6
  License-Expression: MIT
@@ -20,7 +20,7 @@ Requires-Dist: requests>=2.30
20
20
  Requires-Dist: efs-wrapper
21
21
  Dynamic: license-file
22
22
 
23
- # eepyfileserver-cli
23
+ # efs-cli (formerly eepyfileserver-cli)
24
24
 
25
25
  command line interface for eepyfileserver written in python
26
26
 
@@ -40,41 +40,64 @@ command line interface for eepyfileserver written in python
40
40
  ```bash
41
41
  #login fully (lets you upload and download files)
42
42
  #password is saved in PLAIN TEXT
43
- python3 eepyfileserver.py instance "https://example.com" "password123"
43
+ efs-cli auth "https://example.com" "password123"
44
44
 
45
45
  #login only using the url (lets you download PUBLIC files)
46
- python3 eepyfileserver.py instance "https://example.com"
46
+ efs-cli auth "https://example.com"
47
47
 
48
- python3 eepyfileserver.py login ...
48
+ efs-cli login ...
49
+ ```
50
+
51
+ ### view version
52
+
53
+ ```bash
54
+ efs-cli version
55
+ efs-cli ver
56
+ ```
57
+
58
+ ### view instance information
59
+
60
+ ```bash
61
+ efs-cli instance
62
+ efs-cli info
49
63
  ```
50
64
 
51
65
  ### list files
52
66
 
53
67
  ```bash
54
- python3 eepyfileserver.py list
55
- python3 eepyfileserver.py ls
68
+ efs-cli list
69
+ efs-cli ls
70
+ efs-cli files
56
71
  ```
57
72
 
58
73
  ### download a file
59
74
 
60
75
  ```bash
61
- python3 eepyfileserver.py download /example.txt /home/maxeepy/Downloads/example.txt
62
- python3 eepyfileserver.py get ...
63
- python3 eepyfileserver.py d ...
76
+ efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
77
+ efs-cli get ...
78
+ efs-cli d ...
64
79
  ```
65
80
 
66
81
  ### upload a file
67
82
 
68
83
  ```bash
69
- python3 eepyfileserver.py upload /home/maxeepy/Downloads/example.txt /example.txt
70
- python3 eepyfileserver.py post ...
71
- python3 eepyfileserver.py up ...
84
+ efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
85
+ efs-cli post ...
86
+ efs-cli up ...
87
+ efs-cli put ...
72
88
  ```
73
89
 
74
90
  ### delete a file
75
91
 
76
92
  ```bash
77
- python3 eepyfileserver.py delete /example.txt
78
- python3 eepyfileserver.py remove ...
79
- python3 eepyfileserver.py rm ...
93
+ efs-cli delete /example.txt
94
+ efs-cli remove ...
95
+ efs-cli rm ...
96
+ ```
97
+
98
+ ### read a file
99
+
100
+ ```bash
101
+ efs-cli read /example.txt
102
+ efs-cli cat ...
80
103
  ```
efs_cli-1.0.0/README.md DELETED
@@ -1,58 +0,0 @@
1
- # eepyfileserver-cli
2
-
3
- command line interface for eepyfileserver written in python
4
-
5
- ## prerequisites
6
-
7
- - python 3.10 (3.12+ required)
8
- - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
9
-
10
- ## install
11
-
12
- `pip install efs-cli`
13
-
14
- ## usage
15
-
16
- ### log in to an instance
17
-
18
- ```bash
19
- #login fully (lets you upload and download files)
20
- #password is saved in PLAIN TEXT
21
- python3 eepyfileserver.py instance "https://example.com" "password123"
22
-
23
- #login only using the url (lets you download PUBLIC files)
24
- python3 eepyfileserver.py instance "https://example.com"
25
-
26
- python3 eepyfileserver.py login ...
27
- ```
28
-
29
- ### list files
30
-
31
- ```bash
32
- python3 eepyfileserver.py list
33
- python3 eepyfileserver.py ls
34
- ```
35
-
36
- ### download a file
37
-
38
- ```bash
39
- python3 eepyfileserver.py download /example.txt /home/maxeepy/Downloads/example.txt
40
- python3 eepyfileserver.py get ...
41
- python3 eepyfileserver.py d ...
42
- ```
43
-
44
- ### upload a file
45
-
46
- ```bash
47
- python3 eepyfileserver.py upload /home/maxeepy/Downloads/example.txt /example.txt
48
- python3 eepyfileserver.py post ...
49
- python3 eepyfileserver.py up ...
50
- ```
51
-
52
- ### delete a file
53
-
54
- ```bash
55
- python3 eepyfileserver.py delete /example.txt
56
- python3 eepyfileserver.py remove ...
57
- python3 eepyfileserver.py rm ...
58
- ```
@@ -1,2 +0,0 @@
1
- __version__ = "1.0.0"
2
-
File without changes
File without changes
File without changes