clox 0.0.0__py3-none-any.whl → 0.1__py3-none-any.whl

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.

Potentially problematic release.


This version of clox might be problematic. Click here for more details.

clox/__init__.py CHANGED
@@ -1,2 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- """clox modules."""
1
+ # -*- coding: utf-8 -*-
2
+ """clox modules."""
3
+ from clox.params import CLOX_VERSION
4
+ __version__ = CLOX_VERSION
clox/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ """clox main."""
3
+ from .functions import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ main()
clox/functions.py ADDED
@@ -0,0 +1,125 @@
1
+ # -*- coding: utf-8 -*-
2
+ """clox functions."""
3
+ import os
4
+ import sys
5
+ import time
6
+ import random
7
+ import datetime
8
+ import argparse
9
+ import pytz
10
+ from art import tprint
11
+ from .params import TIMEZONES_LIST, CLOX_VERSION
12
+ from .params import ADDITIONAL_INFO, EXIT_MESSAGE
13
+ from .params import FACES_MAP, FACES_LIST, FACES_LIST_EXAMPLE_MESSAGE
14
+
15
+
16
+ def clear_screen():
17
+ """
18
+ Clear screen function.
19
+
20
+ :return: None
21
+ """
22
+ if sys.platform == "win32":
23
+ os.system('cls')
24
+ else:
25
+ os.system('clear')
26
+
27
+
28
+ def get_face(index):
29
+ """
30
+ Return face name.
31
+
32
+ :param index: face index
33
+ :type index: int
34
+ :return: face name as str
35
+ """
36
+ if index == -1:
37
+ index = random.choice(sorted(FACES_MAP))
38
+ return FACES_MAP[index]
39
+
40
+
41
+ def show_faces_list():
42
+ """
43
+ Show faces list.
44
+
45
+ :return: None
46
+ """
47
+ print("Faces list:\n")
48
+ for i in sorted(FACES_MAP):
49
+ print('Face {}\n'.format(i))
50
+ tprint(FACES_LIST_EXAMPLE_MESSAGE, font=get_face(i))
51
+ print('=' * 80)
52
+
53
+
54
+ def show_timezones_list():
55
+ """
56
+ Show timezones list.
57
+
58
+ :return: None
59
+ """
60
+ print("Timezones list:\n")
61
+ for index, timezone in enumerate(TIMEZONES_LIST, 1):
62
+ print("{0}. {1}".format(index, timezone))
63
+
64
+
65
+ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
66
+ """
67
+ Run clock.
68
+
69
+ :param timezone: timezone
70
+ :type timezone: str
71
+ :param v_shift: vertical shift
72
+ :type v_shift: int
73
+ :param h_shift: horizontal shift
74
+ :type h_shift: int
75
+ :param face: face index
76
+ :type face: int
77
+ :return: None
78
+ """
79
+ timezone_str = timezone
80
+ if timezone is None:
81
+ tz = None
82
+ timezone_str = "Local"
83
+ else:
84
+ tz = pytz.timezone(timezone)
85
+ v_shift = max(0, v_shift)
86
+ h_shift = max(0, h_shift)
87
+ face = get_face(face)
88
+ while True:
89
+ clear_screen()
90
+ print('\n' * v_shift, end='')
91
+ print(" " * h_shift, end='')
92
+ current_time = datetime.datetime.now(tz=tz).strftime('%H:%M')
93
+ tprint(current_time, font=face, sep="\n" + " " * h_shift)
94
+ print(" " * h_shift, end='')
95
+ print("Timezone: {0}".format(timezone_str))
96
+ time.sleep(1)
97
+
98
+
99
+ def main():
100
+ """
101
+ CLI main function.
102
+
103
+ :return: None
104
+ """
105
+ parser = argparse.ArgumentParser()
106
+ parser.epilog = ADDITIONAL_INFO
107
+ parser.add_argument('--timezone', help='timezone', type=str, choices=TIMEZONES_LIST)
108
+ parser.add_argument('--v-shift', help='vertical shift', type=int, default=0)
109
+ parser.add_argument('--h-shift', help='horizontal shift', type=int, default=0)
110
+ parser.add_argument('--version', help='version', nargs="?", const=1)
111
+ parser.add_argument('--face', help='face', type=int, choices=FACES_LIST, default=1)
112
+ parser.add_argument('--faces-list', help='faces list', nargs="?", const=1)
113
+ parser.add_argument('--timezones-list', help='timezones list', nargs="?", const=1)
114
+ args = parser.parse_args()
115
+ if args.version:
116
+ print(CLOX_VERSION)
117
+ elif args.faces_list:
118
+ show_faces_list()
119
+ elif args.timezones_list:
120
+ show_timezones_list()
121
+ else:
122
+ try:
123
+ run_clock(timezone=args.timezone, h_shift=args.h_shift, v_shift=args.v_shift, face=args.face)
124
+ except (KeyboardInterrupt, EOFError):
125
+ print(EXIT_MESSAGE)
clox/params.py ADDED
@@ -0,0 +1,43 @@
1
+ # -*- coding: utf-8 -*-
2
+ """clox params."""
3
+ import pytz
4
+
5
+ CLOX_VERSION = "0.1"
6
+
7
+ ADDITIONAL_INFO = "Additional information: Press `Ctrl+C` to exit."
8
+ EXIT_MESSAGE = "See you. Bye!"
9
+
10
+ FACES_LIST_EXAMPLE_MESSAGE = "12 : 34"
11
+
12
+ TIMEZONES_LIST = pytz.all_timezones
13
+
14
+
15
+ FACES_MAP = {
16
+ 1: 'bulbhead',
17
+ 2: 'soft',
18
+ 3: '4max',
19
+ 4: '5x7',
20
+ 5: 'charact4',
21
+ 6: 'o8',
22
+ 7: 'alphabet',
23
+ 8: 'shadow',
24
+ 9: 'speed',
25
+ 10: 'rounded',
26
+ 11: 'chartri',
27
+ 12: 'standard',
28
+ 13: 'contessa',
29
+ 14: 'avatar',
30
+ 15: 'mini',
31
+ 16: 'twopoint',
32
+ 17: '3x5',
33
+ 18: 'threepoint',
34
+ 19: 'ascii_new_roman',
35
+ 20: 'serifcap',
36
+ 21: 'lockergnome',
37
+ 22: 'dotmatrix',
38
+ 23: '3-d',
39
+ 24: 'sweet',
40
+ 25: 'epic',
41
+ }
42
+
43
+ FACES_LIST = [-1] + sorted(FACES_MAP)
@@ -0,0 +1,6 @@
1
+ # Core Developers
2
+ ----------
3
+ - [@sepandhaghighi](http://github.com/sepandhaghighi)
4
+
5
+ # Other Contributors
6
+ ----------
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Sepand Haghighi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,207 @@
1
+ Metadata-Version: 2.1
2
+ Name: clox
3
+ Version: 0.1
4
+ Summary: A Geeky Clock for Terminal Enthusiasts
5
+ Home-page: https://github.com/sepandhaghighi/clox
6
+ Download-URL: https://github.com/sepandhaghighi/clox/tarball/v0.1
7
+ Author: Sepand Haghighi
8
+ Author-email: me@sepand.tech
9
+ License: MIT
10
+ Project-URL: Source, https://github.com/sepandhaghighi/clox
11
+ Keywords: clock time timer timezone terminal cli geek clox
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Natural Language :: English
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3.6
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Intended Audience :: Developers
25
+ Classifier: Intended Audience :: Education
26
+ Classifier: Intended Audience :: End Users/Desktop
27
+ Classifier: Intended Audience :: Other Audience
28
+ Classifier: Topic :: Games/Entertainment
29
+ Classifier: Topic :: Utilities
30
+ Requires-Python: >=3.6
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ License-File: AUTHORS.md
34
+ Requires-Dist: art>=5.3
35
+ Requires-Dist: pytz>=2019.2
36
+
37
+
38
+ <div align="center">
39
+ <h1>Clox: A Geeky Clock for Terminal Enthusiasts</h1>
40
+ <br/>
41
+ <a href="https://badge.fury.io/py/clox"><img src="https://badge.fury.io/py/clox.svg" alt="PyPI version"></a>
42
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
43
+ <a href="https://github.com/sepandhaghighi/clox"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/sepandhaghighi/clox"></a>
44
+ </div>
45
+
46
+ ## Overview
47
+
48
+ <p align="justify">
49
+ Clox is a terminal-based clock application designed for terminal enthusiasts who appreciate simplicity, elegance, and productivity within their command-line environment. Whether you're coding, monitoring tasks, or simply enjoying the terminal aesthetic, Clox brings a stylish and customizable time display to your workspace.
50
+ </p>
51
+
52
+ <table>
53
+ <tr>
54
+ <td align="center">PyPI Counter</td>
55
+ <td align="center"><a href="http://pepy.tech/project/clox"><img src="http://pepy.tech/badge/clox"></a></td>
56
+ </tr>
57
+ <tr>
58
+ <td align="center">Github Stars</td>
59
+ <td align="center"><a href="https://github.com/sepandhaghighi/clox"><img src="https://img.shields.io/github/stars/sepandhaghighi/clox.svg?style=social&label=Stars"></a></td>
60
+ </tr>
61
+ </table>
62
+
63
+
64
+
65
+ <table>
66
+ <tr>
67
+ <td align="center">Branch</td>
68
+ <td align="center">main</td>
69
+ <td align="center">dev</td>
70
+ </tr>
71
+ <tr>
72
+ <td align="center">CI</td>
73
+ <td align="center"><img src="https://github.com/sepandhaghighi/clox/actions/workflows/test.yml/badge.svg?branch=main"></td>
74
+ <td align="center"><img src="https://github.com/sepandhaghighi/clox/actions/workflows/test.yml/badge.svg?branch=dev"></td>
75
+ </tr>
76
+ </table>
77
+
78
+
79
+ <table>
80
+ <tr>
81
+ <td align="center">Code Quality</td>
82
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/clox"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/clox/badge" alt="CodeFactor"></a></td>
83
+ <td align="center"><a href="https://app.codacy.com/gh/sepandhaghighi/clox/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/4cd4cd3b20b1474fb674823b1b417b76"></a></td>
84
+ <td align="center"><a href="https://codebeat.co/projects/github-com-sepandhaghighi-clox-main"><img alt="codebeat badge" src="https://codebeat.co/badges/19394d3a-009b-401b-b376-24a325ef2fdf"></a></td>
85
+ </tr>
86
+ </table>
87
+
88
+
89
+ ## Installation
90
+
91
+ ### Source Code
92
+ - Download [Version 0.1](https://github.com/sepandhaghighi/clox/archive/v0.1.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
93
+ - `pip install .`
94
+
95
+ ### PyPI
96
+
97
+ - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
98
+ - `pip install clox==0.1`
99
+
100
+
101
+ ## Usage
102
+
103
+ ℹ️ You can use `clox` or `python -m clox` to run this program
104
+
105
+ ### Version
106
+
107
+ ```console
108
+ clox --version
109
+ ```
110
+
111
+ ### Basic
112
+
113
+ ℹ️ Press `Ctrl + C` to exit
114
+
115
+ ```console
116
+ clox
117
+ ```
118
+
119
+ ### Face
120
+
121
+ ```console
122
+ clox --face=3
123
+ ```
124
+ * Use `--face=-1` for random mode
125
+ * [Faces List](https://github.com/sepandhaghighi/clox/blob/main/FACES.md)
126
+ * `clox --faces-list`
127
+
128
+ ### Timezone
129
+
130
+ ```console
131
+ clox --timezone="Etc/GMT+7"
132
+ ```
133
+ * [Timezones List](https://github.com/sepandhaghighi/clox/blob/main/TIMEZONES.md)
134
+ * `clox --timezones-list`
135
+
136
+ ### Vertical/Horizontal Shift
137
+
138
+ ℹ️ The vertical and horizontal shift both have default values of `0`
139
+
140
+ ```console
141
+ clox --v-shift=20 --h-shift=30
142
+ ```
143
+
144
+ ## Issues & Bug Reports
145
+
146
+ Just fill an issue and describe it. We'll check it ASAP!
147
+
148
+ - Please complete the issue template
149
+
150
+
151
+ ## Show Your Support
152
+
153
+ <h3>Star This Repo</h3>
154
+
155
+ Give a ⭐️ if this project helped you!
156
+
157
+ <h3>Donate to Our Project</h3>
158
+
159
+ <h4>Bitcoin</h4>
160
+ 1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy
161
+ <h4>Ethereum</h4>
162
+ 0xcD4Db18B6664A9662123D4307B074aE968535388
163
+ <h4>Litecoin</h4>
164
+ Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ
165
+ <h4>Doge</h4>
166
+ DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh
167
+ <h4>Tron</h4>
168
+ TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7
169
+ <h4>Ripple</h4>
170
+ rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq
171
+ <h4>Binance Coin</h4>
172
+ bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef
173
+ <h4>Tether</h4>
174
+ 0xcD4Db18B6664A9662123D4307B074aE968535388
175
+ <h4>Dash</h4>
176
+ Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s
177
+ <h4>Stellar</h4>
178
+ GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL
179
+ <h4>Zilliqa</h4>
180
+ zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5
181
+ <h4>Coffeete</h4>
182
+ <a href="http://www.coffeete.ir/opensource">
183
+ <img src="http://www.coffeete.ir/images/buttons/lemonchiffon.png" style="width:260px;" />
184
+ </a>
185
+
186
+
187
+ # Changelog
188
+ All notable changes to this project will be documented in this file.
189
+
190
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
191
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
192
+
193
+ ## [Unreleased]
194
+ ## [0.1] - 2024-12-24
195
+ ### Added
196
+ - `--v-shift` and `--h-shift` arguments
197
+ - `--timezone` argument
198
+ - `--face` argument
199
+ - `run_clock` and `main` functions
200
+ - `TIMEZONES.md`
201
+ - `FACES.md`
202
+
203
+ [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.1...dev
204
+ [0.1]: https://github.com/sepandhaghighi/clox/compare/e9b49e2...v0.1
205
+
206
+
207
+
@@ -0,0 +1,11 @@
1
+ clox/__init__.py,sha256=gErclFSjUDschQpngWqOBGkBKt1jwd-Ww8B9iJmlU5s,108
2
+ clox/__main__.py,sha256=9oJYc1WXu4ZMrjKny_2-4Cgu46-VWHuE9xOqD1iJY0E,109
3
+ clox/functions.py,sha256=auoQrYu-dbFYoxxUpO2rILUvQP4OhQ5497gyBSLcKgQ,3289
4
+ clox/params.py,sha256=e6w8otviH0lPKIsfeyoC5yuH4YYsgCXls_2hKTc1xPM,766
5
+ clox-0.1.dist-info/AUTHORS.md,sha256=1T_gvCIPkHMdGX9e6dg9eich7OiqlYkE6hSk8tieihQ,116
6
+ clox-0.1.dist-info/LICENSE,sha256=WoAsqqZ_lNVBGdyxjwh7YnVNXKfOB-qYVrRhrn-e-_4,1072
7
+ clox-0.1.dist-info/METADATA,sha256=Fsl1FcPmVi_Og76AInSa4C1A_VgUBayEMJuuqMujAiU,6484
8
+ clox-0.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
9
+ clox-0.1.dist-info/entry_points.txt,sha256=sP4Rmoe-DxYGjlF_Tld6nghbt_u-fK8h9ZUQFmO8TJs,45
10
+ clox-0.1.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
11
+ clox-0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ clox = clox.functions:main
@@ -1,25 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: clox
3
- Version: 0.0.0
4
- Summary: This name has been reserved using Reserver
5
- Home-page: https://url.com
6
- Download-URL: https://download_url.com
7
- Author: Development Team
8
- Author-email: test@test.com
9
- License: MIT
10
- Project-URL: Source, https://github.com/source
11
- Keywords: python3 python reserve reserver reserved
12
- Classifier: Development Status :: 1 - Planning
13
- Classifier: Programming Language :: Python :: 3.6
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Requires-Python: >=3.6
21
- Description-Content-Type: text/markdown
22
-
23
-
24
- This name has been reserved using [Reserver](https://github.com/openscilab/reserver).
25
-
@@ -1,5 +0,0 @@
1
- clox/__init__.py,sha256=RVjzBns3rl9-B1WcUV_e0jpPcRPw_xNp97tLgeWoBWY,44
2
- clox-0.0.0.dist-info/METADATA,sha256=qfCtaKbIV_K0XEf1dOP1pqDc8ozX33V-bGyt7teo2Hc,915
3
- clox-0.0.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
4
- clox-0.0.0.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
5
- clox-0.0.0.dist-info/RECORD,,