mirror of
https://github.com/Lyxminxx/weatherCLI.git
synced 2026-10-12 05:07:45 +02:00
Initial commit
This commit is contained in:
commit
3394196287
2164 files changed
+358958
No files matched your search
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT Licence
|
||||
|
||||
Copyright (c) 2022 Miguel Angel Garcia
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicence, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,189 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: readchar
|
||||
Version: 4.2.1
|
||||
Summary: Library to easily read single chars and key strokes
|
||||
Author-email: Miguel Ángel García <[email protected]>, Jan Wille <[email protected]>
|
||||
Maintainer-email: Jan Wille <[email protected]>
|
||||
License: MIT Licence
|
||||
|
||||
Copyright (c) 2022 Miguel Angel Garcia
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicence, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Project-URL: Homepage, https://pypi.org/project/readchar
|
||||
Project-URL: Repository, https://github.com/magmax/python-readchar
|
||||
Project-URL: Issues, https://github.com/magmax/python-readchar/issues
|
||||
Project-URL: Changelog, https://github.com/magmax/python-readchar/releases
|
||||
Keywords: characters,keystrokes,stdin,command line
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: Microsoft :: Windows
|
||||
Classifier: Operating System :: POSIX :: Linux
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3 :: Only
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: 3.12
|
||||
Classifier: Programming Language :: Python :: Implementation :: CPython
|
||||
Classifier: Environment :: Console
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: Topic :: Software Development
|
||||
Classifier: Topic :: Software Development :: User Interfaces
|
||||
Requires-Python: >=3.8
|
||||
Description-Content-Type: text/markdown
|
||||
License-File: LICENCE
|
||||
|
||||
[](https://github.com/magmax/python-readchar)
|
||||
[](https://pypi.python.org/pypi/readchar)
|
||||
[](https://pypi.python.org/pypi/readchar)
|
||||
[](LICENCE) <br>
|
||||
[](https://github.com/magmax/python-readchar/actions/workflows/run-tests.yaml?query=branch%3Amaster)
|
||||
[](https://coveralls.io/github/magmax/python-readchar?branch=master)
|
||||
[](https://pypi.python.org/pypi/readchar)
|
||||
|
||||
# python-readchar
|
||||
|
||||
Library to easily read single chars and keystrokes.
|
||||
|
||||
Born as a [python-inquirer](https://github.com/magmax/python-inquirer) requirement.
|
||||
|
||||
## Installation
|
||||
|
||||
simply install it via `pip`:
|
||||
|
||||
```bash
|
||||
pip install readchar
|
||||
```
|
||||
|
||||
Or download the source code from [PyPi](https://pypi.python.org/pypi/readchar).
|
||||
|
||||
## Usage
|
||||
|
||||
Simply read a character or keystroke:
|
||||
|
||||
```python
|
||||
import readchar
|
||||
|
||||
key = readchar.readkey()
|
||||
```
|
||||
|
||||
React to different kinds of key-presses:
|
||||
|
||||
```python
|
||||
from readchar import readkey, key
|
||||
|
||||
while True:
|
||||
k = readkey()
|
||||
if k == "a":
|
||||
# do stuff
|
||||
if k == key.DOWN:
|
||||
# do stuff
|
||||
if k == key.ENTER:
|
||||
break
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
There are just two methods:
|
||||
|
||||
### `readchar.readchar() -> str`
|
||||
|
||||
Reads one character from `stdin`, returning it as a string with length 1. Waits until a
|
||||
character is available.
|
||||
|
||||
As only ASCII characters are actually a single character, you usually want to use the
|
||||
next function, that also handles longer keys.
|
||||
|
||||
### `readchar.readkey() -> str`
|
||||
|
||||
Reads the next keystroke from `stdin`, returning it as a string. Waits until a keystroke
|
||||
is available.
|
||||
|
||||
A keystroke can be:
|
||||
|
||||
- single characters as returned by `readchar()`. These include:
|
||||
- character for normal keys: <kbd>a</kbd>, <kbd>Z</kbd>, <kbd>9</kbd>,...
|
||||
- special characters like <kbd>ENTER</kbd>, <kbd>BACKSPACE</kbd>, <kbd>TAB</kbd>,...
|
||||
- combinations with <kbd>CTRL</kbd>: <kbd>CTRL</kbd>+<kbd>A</kbd>,...
|
||||
- keys that are made up of multiple characters:
|
||||
- characters for cursors/arrows: <kbd>🡩</kbd>, <kbd>🡪</kbd>, <kbd>🡫</kbd>,
|
||||
<kbd>🡨</kbd>
|
||||
- navigation keys: <kbd>INSERT</kbd>, <kbd>HOME</kbd>,...
|
||||
- function keys: <kbd>F1</kbd> to <kbd>F12</kbd>
|
||||
- combinations with <kbd>ALT</kbd>: <kbd>ALT</kbd>+<kbd>A</kbd>,...
|
||||
- combinations with <kbd>CTRL</kbd> and <kbd>ALT</kbd>:
|
||||
<kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>SUPR</kbd>,...
|
||||
|
||||
> **Note** <kbd>CTRL</kbd>+<kbd>C</kbd> will not be returned by `readkey()`, but instead
|
||||
> raise a `KeyboardInterupt`. If you want to handle it yourself, use `readchar()`.
|
||||
|
||||
### `readchar.key` module
|
||||
|
||||
This submodule contains a list of available keys to compare against. The constants are
|
||||
defined depending on your operating system, so it should be fully portable. If a key is
|
||||
listed here for your platform, `readkey()` can read it, and you can compare against it.
|
||||
|
||||
### `readchar.config` class
|
||||
|
||||
This static class contains configurations for `readchar`. It holds constants that are
|
||||
used in other parts of the code as class attributes. You can override/change these to
|
||||
modify its behaviour. Here is a description of the existing attributes:
|
||||
|
||||
<dl>
|
||||
<dt><code>INTERRUPT_KEYS</code></dt>
|
||||
<dd>
|
||||
|
||||
List of keys that will result in `readkey()` raising a `KeyboardInterrupt`. <br>
|
||||
*Default:* `[key.CTRL_C]`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
## OS Support
|
||||
|
||||
This library actively supports these operating systems:
|
||||
|
||||
- Linux
|
||||
- Windows
|
||||
|
||||
Some operating systems are enabled, but not actively tested or supported:
|
||||
|
||||
- macOS
|
||||
- FreeBSD / OpenBSD
|
||||
|
||||
Theoretically every Unix based system should work, but they will not be actively tested.
|
||||
It is also required that somebody provides initial test results before the OS is enabled
|
||||
and added to the list. Feel free to open a PR for that.
|
||||
|
||||
Thank you!
|
||||
|
||||
## How to contribute
|
||||
|
||||
You have an issue problem or found a bug? You have a great new idea or just want to fix
|
||||
a typo? Great :+1:. We are happy to accept your issue or pull request, but first, please
|
||||
read our
|
||||
[contribution guidelines](https://github.com/magmax/python-readchar/blob/master/CONTRIBUTING.md).
|
||||
They will also tell you how to write code for this repo and how to properly prepare an
|
||||
issue or a pull request.
|
||||
|
||||
______________________________________________________________________
|
||||
|
||||
*Copyright (c) 2014-2022 Miguel Ángel García*
|
||||
@@ -0,0 +1,24 @@
|
||||
readchar-4.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
readchar-4.2.1.dist-info/LICENCE,sha256=7Ts9HDviMsZ2DRn1PnFJEyZPu8NV1zZSESUWiT34olU,1076
|
||||
readchar-4.2.1.dist-info/METADATA,sha256=QSYRaIo9NwGsueB3y02uITdCyRfl_mdTj6bZXWDiG0Q,7474
|
||||
readchar-4.2.1.dist-info/RECORD,,
|
||||
readchar-4.2.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
readchar-4.2.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
||||
readchar-4.2.1.dist-info/top_level.txt,sha256=WyIw8860V9zk8aY_JRwwUnfFGRYBmYGNqDj5oro3YN0,9
|
||||
readchar/__init__.py,sha256=9L3iSJMPT80D05lTDFUlgVaT5S1EI2yozzmDbFeyUgA,611
|
||||
readchar/__pycache__/__init__.cpython-313.pyc,,
|
||||
readchar/__pycache__/_base_key.cpython-313.pyc,,
|
||||
readchar/__pycache__/_config.cpython-313.pyc,,
|
||||
readchar/__pycache__/_posix_key.cpython-313.pyc,,
|
||||
readchar/__pycache__/_posix_read.cpython-313.pyc,,
|
||||
readchar/__pycache__/_win_key.cpython-313.pyc,,
|
||||
readchar/__pycache__/_win_read.cpython-313.pyc,,
|
||||
readchar/__pycache__/key.cpython-313.pyc,,
|
||||
readchar/_base_key.py,sha256=vg1a_NZ_uGrchm9Vd6t0odogaMh41Qo9y0zds0NA2YM,487
|
||||
readchar/_config.py,sha256=xNxvZWDQzyig4ZJsYNqFjx1fNBNZiu503yjWFBXXN0Q,365
|
||||
readchar/_posix_key.py,sha256=t79a5Q4zO_Y8nvawC8ZHZSh7UREzJStM9M0i9Y18t7A,838
|
||||
readchar/_posix_read.py,sha256=bsWkg0EqJxk-NIEQqiSavMNWr1KxRMNTvgYGT4huGnA,1370
|
||||
readchar/_win_key.py,sha256=1PHleDadnOojqupZ0ZTp9IxgZPCKsjADexltP-FN5ok,1063
|
||||
readchar/_win_read.py,sha256=43_1OF9TLWPE9W_UVDZEm_uo-_EyZMWRwB5f8AdgY88,1311
|
||||
readchar/key.py,sha256=ksR9M43PAlE04Kfna-L9MraiLpexUUTKkLwQIRNMnBM,282
|
||||
readchar/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
Whitespace-only changes.
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: setuptools (75.3.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
readchar
|
||||
Reference in new issue
Block a user