chemql-python 1.5.4__tar.gz → 1.5.5__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.
Files changed (40) hide show
  1. {chemql_python-1.5.4 → chemql_python-1.5.5}/PKG-INFO +2 -2
  2. {chemql_python-1.5.4 → chemql_python-1.5.5}/README.md +1 -1
  3. {chemql_python-1.5.4 → chemql_python-1.5.5}/pyproject.toml +1 -1
  4. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/__init__.py +26 -5
  5. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql_python.egg-info/PKG-INFO +2 -2
  6. {chemql_python-1.5.4 → chemql_python-1.5.5}/LICENSE +0 -0
  7. {chemql_python-1.5.4 → chemql_python-1.5.5}/setup.cfg +0 -0
  8. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/__main__.py +0 -0
  9. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/codecql.py +0 -0
  10. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/colors.json +0 -0
  11. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/BondEnergies.json +0 -0
  12. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/MoleculeBonds.json +0 -0
  13. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/Molecules.json +0 -0
  14. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/PeriodicTableJSON.json +0 -0
  15. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/Reactions.json +0 -0
  16. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/THIRD_PARTY_LICENSES/PeriodicTableJSON.txt +0 -0
  17. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/data/THIRD_PARTY_LICENSES/RHEA.txt +0 -0
  18. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/html/periodic_table.html +0 -0
  19. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/README.md +0 -0
  20. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/collections.cql +0 -0
  21. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/datetime.cql +0 -0
  22. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/decimal.cql +0 -0
  23. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/fractions.cql +0 -0
  24. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/json.cql +0 -0
  25. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/math/statistics.cql +0 -0
  26. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/math.cql +0 -0
  27. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/pathlib.cql +0 -0
  28. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/random.cql +0 -0
  29. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql/stdlib/text.cql +0 -0
  30. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql_python.egg-info/SOURCES.txt +0 -0
  31. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql_python.egg-info/dependency_links.txt +0 -0
  32. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql_python.egg-info/entry_points.txt +0 -0
  33. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql_python.egg-info/requires.txt +0 -0
  34. {chemql_python-1.5.4 → chemql_python-1.5.5}/src/chemql_python.egg-info/top_level.txt +0 -0
  35. {chemql_python-1.5.4 → chemql_python-1.5.5}/tests/test_codecql.py +0 -0
  36. {chemql_python-1.5.4 → chemql_python-1.5.5}/tests/test_external_molecule_lookup.py +0 -0
  37. {chemql_python-1.5.4 → chemql_python-1.5.5}/tests/test_public_api.py +0 -0
  38. {chemql_python-1.5.4 → chemql_python-1.5.5}/tests/test_reactions.py +0 -0
  39. {chemql_python-1.5.4 → chemql_python-1.5.5}/tests/test_stdlib.py +0 -0
  40. {chemql_python-1.5.4 → chemql_python-1.5.5}/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.4
3
+ Version: 1.5.5
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.4`
22
+ - **Version:** `1.5.5`
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.4`
9
+ - **Version:** `1.5.5`
10
10
  - **PyPI distribution:** `chemql-python`
11
11
  - **Python import / CLI name:** `chemql`
12
12
  - **Author:** Mohammad Rakibul Islam
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "chemql-python"
7
- version = "1.5.4"
7
+ version = "1.5.5"
8
8
  authors = [
9
9
  { name = "Mohammad Rakibul Islam", email = "rakibulofficial1017@gmail.com" }
10
10
  ]
@@ -64,7 +64,7 @@ __all__ = [
64
64
  "__version__"
65
65
  ]
66
66
 
67
- __version__ = "1.5.4"
67
+ __version__ = "1.5.5"
68
68
 
69
69
  # Persistent preprocessor/function state for the current ChemQL session.
70
70
  DEFINITIONS = {}
@@ -5699,15 +5699,36 @@ def execute(arguments, query_text=None, positions=None):
5699
5699
  # These are syntactic sugar for normal search queries.
5700
5700
  if arguments[0] == "findel":
5701
5701
  if len(arguments) < 2:
5702
- return "Usage: findel <name-or-symbol>"
5702
+ return "Usage: findel <name-or-symbol> [return <attribute> ...]"
5703
5703
 
5704
5704
  value = arguments[1]
5705
5705
 
5706
5706
  return_attributes = None
5707
+ if "return" in arguments[2:]:
5708
+ return_index = arguments.index("return", 2)
5709
+ return_attributes = arguments[return_index + 1:]
5707
5710
 
5708
- return execute(
5709
- ["search", "elements", "name", "like", value, "or", "symbol", "like", value]
5710
- )
5711
+ if not return_attributes:
5712
+ return "Usage: findel <name-or-formula> return <attribute> ..."
5713
+
5714
+ for attribute in return_attributes:
5715
+ if attribute not in elementKeys:
5716
+ return (f"There is no key `{attribute}`" if NO_ANSI else f"There is no key \033[1m{attribute}\033[22m")
5717
+
5718
+ if return_index != 2:
5719
+ return "Usage: findel <name-or-formula> [return <attribute> ...]"
5720
+
5721
+ elif len(arguments) > 2:
5722
+ return "Usage: findel <name-or-formula> [return <attribute> ...]"
5723
+
5724
+ if return_attributes is not None:
5725
+ return execute(
5726
+ ["search", "elements", "name", "like", value, "or", "symbol", "like", value, "return", *return_attributes]
5727
+ )
5728
+ else:
5729
+ return execute(
5730
+ ["search", "elements", "name", "like", value, "or", "symbol", "like", value]
5731
+ )
5711
5732
 
5712
5733
  if arguments[0] == "findmol":
5713
5734
  if len(arguments) < 2:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemql-python
3
- Version: 1.5.4
3
+ Version: 1.5.5
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.4`
22
+ - **Version:** `1.5.5`
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