chemql-python 1.5.7__tar.gz → 1.5.9__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.
- {chemql_python-1.5.7 → chemql_python-1.5.9}/PKG-INFO +2 -2
- {chemql_python-1.5.7 → chemql_python-1.5.9}/README.md +1 -1
- {chemql_python-1.5.7 → chemql_python-1.5.9}/pyproject.toml +1 -1
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/__init__.py +17 -1
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/codecql.py +16 -6
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql_python.egg-info/PKG-INFO +2 -2
- {chemql_python-1.5.7 → chemql_python-1.5.9}/LICENSE +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/setup.cfg +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/__main__.py +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/colors.json +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/BondEnergies.json +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/MoleculeBonds.json +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/Molecules.json +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/PeriodicTableJSON.json +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/Reactions.json +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/THIRD_PARTY_LICENSES/PeriodicTableJSON.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/data/THIRD_PARTY_LICENSES/RHEA.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/html/periodic_table.html +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/README.md +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/collections.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/datetime.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/decimal.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/fractions.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/json.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/math/statistics.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/math.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/pathlib.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/random.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql/stdlib/text.cql +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql_python.egg-info/SOURCES.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql_python.egg-info/dependency_links.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql_python.egg-info/entry_points.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql_python.egg-info/requires.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/src/chemql_python.egg-info/top_level.txt +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/tests/test_codecql.py +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/tests/test_external_molecule_lookup.py +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/tests/test_public_api.py +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/tests/test_reactions.py +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/tests/test_stdlib.py +0 -0
- {chemql_python-1.5.7 → chemql_python-1.5.9}/tests/test_structured_types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chemql-python
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.9
|
|
4
4
|
Summary: A chemistry-focused query language and REPL
|
|
5
5
|
Author-email: Mohammad Rakibul Islam <rakibulofficial1017@gmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -19,7 +19,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
|
|
|
19
19
|
balance equations, and combine chemistry queries with Python and shell
|
|
20
20
|
commands.
|
|
21
21
|
|
|
22
|
-
- **Version:** `1.5.
|
|
22
|
+
- **Version:** `1.5.9`
|
|
23
23
|
- **PyPI distribution:** `chemql-python`
|
|
24
24
|
- **Python import / CLI name:** `chemql`
|
|
25
25
|
- **Author:** Mohammad Rakibul Islam
|
|
@@ -6,7 +6,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
|
|
|
6
6
|
balance equations, and combine chemistry queries with Python and shell
|
|
7
7
|
commands.
|
|
8
8
|
|
|
9
|
-
- **Version:** `1.5.
|
|
9
|
+
- **Version:** `1.5.9`
|
|
10
10
|
- **PyPI distribution:** `chemql-python`
|
|
11
11
|
- **Python import / CLI name:** `chemql`
|
|
12
12
|
- **Author:** Mohammad Rakibul Islam
|
|
@@ -64,7 +64,7 @@ __all__ = [
|
|
|
64
64
|
"__version__"
|
|
65
65
|
]
|
|
66
66
|
|
|
67
|
-
__version__ = "1.5.
|
|
67
|
+
__version__ = "1.5.9"
|
|
68
68
|
|
|
69
69
|
# Persistent preprocessor/function state for the current ChemQL session.
|
|
70
70
|
DEFINITIONS = {}
|
|
@@ -4176,6 +4176,16 @@ def process_inline(text):
|
|
|
4176
4176
|
if not stripped:
|
|
4177
4177
|
return
|
|
4178
4178
|
|
|
4179
|
+
# A standalone quoted string is a Python literal, not a ChemQL command.
|
|
4180
|
+
# Check only complete literals so quotes inside queries remain untouched.
|
|
4181
|
+
try:
|
|
4182
|
+
literal_value = ast.literal_eval(stripped)
|
|
4183
|
+
except (SyntaxError, ValueError, TypeError):
|
|
4184
|
+
literal_value = None
|
|
4185
|
+
else:
|
|
4186
|
+
if isinstance(literal_value, str):
|
|
4187
|
+
return literal_value
|
|
4188
|
+
|
|
4179
4189
|
# Native dynamically typed variables: `let name = expression`.
|
|
4180
4190
|
let_match = re.fullmatch(r"let\s+([A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*)\s*=\s*(.+)", stripped, re.DOTALL)
|
|
4181
4191
|
if let_match:
|
|
@@ -4598,6 +4608,12 @@ def process_lines(lines):
|
|
|
4598
4608
|
if re.match(r"^(for|while|if)\s+.+$", stripped_source) and not stripped_source.startswith("["):
|
|
4599
4609
|
# Existing block parser supplies the trailing colon to Python's AST.
|
|
4600
4610
|
source_line = "[" + stripped_source + "]"
|
|
4611
|
+
elif re.match(r"^elif\s+.+$", stripped_source, re.IGNORECASE):
|
|
4612
|
+
# Normalize branch markers so execute_if_block() can recognize
|
|
4613
|
+
# them as part of the current conditional chain.
|
|
4614
|
+
source_line = "[" + stripped_source + "]"
|
|
4615
|
+
elif stripped_source.casefold() == "else":
|
|
4616
|
+
source_line = "[else]"
|
|
4601
4617
|
elif stripped_source.casefold() in {"endfor", "endwhile", "endif"}:
|
|
4602
4618
|
source_line = "[endblock]"
|
|
4603
4619
|
normalized_lines.append(source_line)
|
|
@@ -10,7 +10,7 @@ import shutil
|
|
|
10
10
|
import subprocess
|
|
11
11
|
import time
|
|
12
12
|
|
|
13
|
-
VERSION = "0.0.
|
|
13
|
+
VERSION = "0.0.8"
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def _write_system_clipboard(text):
|
|
@@ -79,7 +79,8 @@ def _decode_escape_sequence(sequence):
|
|
|
79
79
|
else:
|
|
80
80
|
return "\x1b"
|
|
81
81
|
return "+".join((*modifiers, key)) if modifiers else key
|
|
82
|
-
if final == b"u" and params and params[0]
|
|
82
|
+
if final == b"u" and params and params[0] in {"8", "127"}:
|
|
83
|
+
# CSI-u / Kitty keyboard protocol can encode Backspace as 8 or 127.
|
|
83
84
|
key = "backspace"
|
|
84
85
|
return "+".join((*modifiers, key)) if modifiers else key
|
|
85
86
|
elif sequence.startswith(b"O") and sequence[-1:] in b"ABCDHF":
|
|
@@ -181,8 +182,16 @@ else:
|
|
|
181
182
|
return _decode_escape_sequence(sequence)
|
|
182
183
|
if sequence.startswith(b"O"):
|
|
183
184
|
return _decode_escape_sequence(sequence)
|
|
185
|
+
if sequence in (b"\x7f", b"\x08"):
|
|
186
|
+
return "alt+backspace"
|
|
184
187
|
if sequence:
|
|
185
|
-
|
|
188
|
+
# ESC + one printable character is commonly Alt+<key>.
|
|
189
|
+
# Never insert an unknown multi-character escape sequence.
|
|
190
|
+
if len(sequence) == 1:
|
|
191
|
+
char = sequence.decode("utf-8", errors="replace")
|
|
192
|
+
if char.isprintable():
|
|
193
|
+
return "alt+" + char
|
|
194
|
+
return "\x1b"
|
|
186
195
|
return "\x1b"
|
|
187
196
|
if not first:
|
|
188
197
|
return ""
|
|
@@ -598,7 +607,7 @@ class Editor:
|
|
|
598
607
|
self._scroll_view(-1 if base_key == "arrow_up" else 1)
|
|
599
608
|
else:
|
|
600
609
|
self._move_cursor(base_key, shift=shift, wordwise=wordwise)
|
|
601
|
-
elif key in ("\x08", "ctrl+backspace"):
|
|
610
|
+
elif key in ("\x08", "ctrl+backspace", "alt+backspace"):
|
|
602
611
|
if os.name == "nt":
|
|
603
612
|
if not self._delete_selection(): # For some reason on windows it is the opposit
|
|
604
613
|
self._backspace() # I have no idea why just stick to it
|
|
@@ -610,7 +619,7 @@ class Editor:
|
|
|
610
619
|
else:
|
|
611
620
|
if not self._delete_selection():
|
|
612
621
|
self._backspace()
|
|
613
|
-
elif key in ("ctrl+delete",):
|
|
622
|
+
elif key in ("ctrl+delete", "alt+delete"):
|
|
614
623
|
self._delete_word("right")
|
|
615
624
|
elif key in ("delete", "\x1b[3~"):
|
|
616
625
|
if not self._delete_selection():
|
|
@@ -619,7 +628,8 @@ class Editor:
|
|
|
619
628
|
self._insert_newline()
|
|
620
629
|
elif key == "\t":
|
|
621
630
|
self._insert_text("\t")
|
|
622
|
-
elif key and key.isprintable():
|
|
631
|
+
elif key and key.isprintable() and "+" not in key:
|
|
632
|
+
# Symbolic key names (e.g. "alt+delete") are control events, not text.
|
|
623
633
|
self._insert_text(key)
|
|
624
634
|
if key not in ("\x11",):
|
|
625
635
|
self.quit_requested = False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chemql-python
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.9
|
|
4
4
|
Summary: A chemistry-focused query language and REPL
|
|
5
5
|
Author-email: Mohammad Rakibul Islam <rakibulofficial1017@gmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -19,7 +19,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
|
|
|
19
19
|
balance equations, and combine chemistry queries with Python and shell
|
|
20
20
|
commands.
|
|
21
21
|
|
|
22
|
-
- **Version:** `1.5.
|
|
22
|
+
- **Version:** `1.5.9`
|
|
23
23
|
- **PyPI distribution:** `chemql-python`
|
|
24
24
|
- **Python import / CLI name:** `chemql`
|
|
25
25
|
- **Author:** Mohammad Rakibul Islam
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|