chemql-python 1.5.10__tar.gz → 1.6.0__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 (41) hide show
  1. {chemql_python-1.5.10 → chemql_python-1.6.0}/PKG-INFO +102 -6
  2. {chemql_python-1.5.10 → chemql_python-1.6.0}/README.md +100 -5
  3. {chemql_python-1.5.10 → chemql_python-1.6.0}/pyproject.toml +2 -1
  4. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/__init__.py +610 -5
  5. chemql_python-1.6.0/src/chemql/build.py +106 -0
  6. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql_python.egg-info/PKG-INFO +102 -6
  7. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql_python.egg-info/SOURCES.txt +1 -0
  8. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql_python.egg-info/requires.txt +1 -0
  9. {chemql_python-1.5.10 → chemql_python-1.6.0}/LICENSE +0 -0
  10. {chemql_python-1.5.10 → chemql_python-1.6.0}/setup.cfg +0 -0
  11. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/__main__.py +0 -0
  12. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/codecql.py +0 -0
  13. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/colors.json +0 -0
  14. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/BondEnergies.json +0 -0
  15. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/MoleculeBonds.json +0 -0
  16. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/Molecules.json +0 -0
  17. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/PeriodicTableJSON.json +0 -0
  18. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/Reactions.json +0 -0
  19. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/THIRD_PARTY_LICENSES/PeriodicTableJSON.txt +0 -0
  20. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/data/THIRD_PARTY_LICENSES/RHEA.txt +0 -0
  21. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/html/periodic_table.html +0 -0
  22. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/README.md +0 -0
  23. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/collections.cql +0 -0
  24. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/datetime.cql +0 -0
  25. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/decimal.cql +0 -0
  26. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/fractions.cql +0 -0
  27. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/json.cql +0 -0
  28. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/math/statistics.cql +0 -0
  29. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/math.cql +0 -0
  30. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/pathlib.cql +0 -0
  31. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/random.cql +0 -0
  32. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql/stdlib/text.cql +0 -0
  33. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql_python.egg-info/dependency_links.txt +0 -0
  34. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql_python.egg-info/entry_points.txt +0 -0
  35. {chemql_python-1.5.10 → chemql_python-1.6.0}/src/chemql_python.egg-info/top_level.txt +0 -0
  36. {chemql_python-1.5.10 → chemql_python-1.6.0}/tests/test_codecql.py +0 -0
  37. {chemql_python-1.5.10 → chemql_python-1.6.0}/tests/test_external_molecule_lookup.py +0 -0
  38. {chemql_python-1.5.10 → chemql_python-1.6.0}/tests/test_public_api.py +0 -0
  39. {chemql_python-1.5.10 → chemql_python-1.6.0}/tests/test_reactions.py +0 -0
  40. {chemql_python-1.5.10 → chemql_python-1.6.0}/tests/test_stdlib.py +0 -0
  41. {chemql_python-1.5.10 → chemql_python-1.6.0}/tests/test_structured_types.py +0 -0
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemql-python
3
- Version: 1.5.10
3
+ Version: 1.6.0
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
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
9
  Requires-Dist: prompt_toolkit>=3.0
10
+ Requires-Dist: rich>=13.7
10
11
  Provides-Extra: test
11
12
  Requires-Dist: pytest>=8.0; extra == "test"
12
13
  Dynamic: license-file
@@ -19,7 +20,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
19
20
  balance equations, and combine chemistry queries with Python and shell
20
21
  commands.
21
22
 
22
- - **Version:** `1.5.10`
23
+ - **Version:** `1.6.0`
23
24
  - **PyPI distribution:** `chemql-python`
24
25
  - **Python import / CLI name:** `chemql`
25
26
  - **Author:** Mohammad Rakibul Islam
@@ -46,6 +47,7 @@ commands.
46
47
  - [Built-in help](#built-in-help)
47
48
  - [Shell integration and scripting](#shell-integration-and-scripting)
48
49
  - [CLI options and history export](#cli-options-and-history-export)
50
+ - [ChemQL package management](#chemql-package-management)
49
51
  - [Python API](#python-api)
50
52
  - [Data sources and network access](#data-sources-and-network-access)
51
53
  - [Troubleshooting](#troubleshooting)
@@ -79,9 +81,10 @@ commands.
79
81
  ChemQL is distributed as `chemql-python`; the executable and import name
80
82
  are `chemql`.
81
83
 
82
- **Requirements:** Python 3.10 or newer. `prompt_toolkit` is installed as
83
- a dependency. Internet access is needed only for optional online lookups
84
- or package upgrades.
84
+ **Requirements:** Python 3.10 or newer. `prompt_toolkit` and `rich` are
85
+ installed as dependencies. Internet access is needed for package registry
86
+ operations and optional online lookups; local queries and the standard library
87
+ remain available offline.
85
88
 
86
89
  Install from PyPI:
87
90
 
@@ -820,7 +823,9 @@ geometry::circle_area{2}
820
823
  ## Standard library
821
824
 
822
825
  ChemQL loads reusable `.cql` packages with `load`. The loader searches the
823
- current directory first and then ChemQL's bundled `stdlib/` directory.
826
+ current directory, installed packages (normally under `~/.chemql/packages/`),
827
+ and then ChemQL's bundled `stdlib/` directory. Installed package entry points
828
+ are resolved from the manifest's `main` field.
824
829
 
825
830
  | Package | Purpose |
826
831
  | --- | --- |
@@ -983,6 +988,97 @@ Supported forms include `dump all|good|bad FILE`,
983
988
  `dump all|good|bad queries FILE`, and `dump all|good|bad results FILE`.
984
989
  `good` and `bad` select successful and failed executions respectively.
985
990
 
991
+ ## ChemQL package management
992
+
993
+ ChemQL includes commands for creating, building, installing, and managing
994
+ reusable ChemQL packages. Run package-management commands in your system
995
+ terminal, not inside the interactive ChemQL prompt.
996
+
997
+ ### Create and build a package
998
+
999
+ Create a starter project:
1000
+
1001
+ ```bash
1002
+ chemql init MyPackage # the name of the package is optional, if the name is empty it will just use the current folders name
1003
+ cd MyPackage
1004
+ ```
1005
+
1006
+ `chemql init` creates a `cqlpackage.json` manifest, `MyPackage.cql` entry
1007
+ point, and `README.md`. It does not create a package-local `build.py`.
1008
+
1009
+ Build the package from the project directory:
1010
+
1011
+ ```bash
1012
+ chemql build
1013
+ ```
1014
+
1015
+ The builder reads `cqlpackage.json` or `cqlpackage.toml` and writes an archive
1016
+ to `dist/`, named `PACKAGE-VERSION.tar.gz`. The archive contains a top-level
1017
+ `PACKAGE-VERSION/` directory and is intended for uploading to a ChemQL package
1018
+ registry. Build excludes common generated directories such as virtual
1019
+ environments, caches, `node_modules`, `dist`, and `build`.
1020
+
1021
+ You can upload these .tar.gz files to https://chemqlreg.pythonanywhere.com/
1022
+
1023
+ ### Install and manage packages
1024
+
1025
+ The package commands are:
1026
+
1027
+ | Command | Purpose |
1028
+ |---|---|
1029
+ | `chemql search QUERY` | Search the configured package registry |
1030
+ | `chemql info NAME` | Display registry metadata for a package |
1031
+ | `chemql install NAME` | Install the latest available version |
1032
+ | `chemql install NAME --version 1.2.0` | Install a specific version |
1033
+ | `chemql upgrade NAME` | Upgrade an installed package |
1034
+ | `chemql upgrade NAME --version 1.2.0` | Upgrade to a specific version |
1035
+ | `chemql list` | List packages recorded as installed |
1036
+ | `chemql uninstall NAME` | Remove an installed package |
1037
+
1038
+ By default, packages are installed under `~/.chemql/packages/` and the
1039
+ installed-package record is stored in `~/.chemql/installed.json`.
1040
+
1041
+ Configure the installation paths with environment variables (optional):
1042
+
1043
+ - `CHEMQL_PACKAGE_DIR`: package installation directory.
1044
+ - `CHEMQL_INSTALLED_FILE`: installed-package state file.
1045
+
1046
+ For example, after installing a package named `GUI`, use it from ChemQL:
1047
+
1048
+ ```chemql
1049
+ load GUI
1050
+ ```
1051
+
1052
+ ChemQL uses the package manifest's `main` field to find the installed
1053
+ package's entry point.
1054
+
1055
+ ### Package manifest help
1056
+
1057
+ The manifest can point `help` at a Markdown file:
1058
+
1059
+ ```json
1060
+ {
1061
+ "name": "GUI",
1062
+ "version": "1.0.0",
1063
+ "description": "A GUI for ChemQL",
1064
+ "main": "GUI.cql",
1065
+ "help": "README.md",
1066
+ "help-individual": {
1067
+ "addButton": "Adds a button to the GUI."
1068
+ }
1069
+ }
1070
+ ```
1071
+
1072
+ Use `help{GUI}` to display the package description, the help content, and
1073
+ the individual help entries. If `help` names a `.md` file, ChemQL reads it
1074
+ relative to the manifest and renders it with Rich. Otherwise, the `help`
1075
+ value is displayed as literal text. Individual entries can be requested
1076
+ with `help{GUI::addButton}`. You do not even need to load it, you can simply run it
1077
+
1078
+ Package installation and registry operations require a reachable registry.
1079
+ The default registry URL is local to the machine; set `CHEMQL_REGISTRY_URL`
1080
+ when using a remote or hosted registry.
1081
+
986
1082
  ## Python API
987
1083
 
988
1084
  ``` python
@@ -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.10`
9
+ - **Version:** `1.6.0`
10
10
  - **PyPI distribution:** `chemql-python`
11
11
  - **Python import / CLI name:** `chemql`
12
12
  - **Author:** Mohammad Rakibul Islam
@@ -33,6 +33,7 @@ commands.
33
33
  - [Built-in help](#built-in-help)
34
34
  - [Shell integration and scripting](#shell-integration-and-scripting)
35
35
  - [CLI options and history export](#cli-options-and-history-export)
36
+ - [ChemQL package management](#chemql-package-management)
36
37
  - [Python API](#python-api)
37
38
  - [Data sources and network access](#data-sources-and-network-access)
38
39
  - [Troubleshooting](#troubleshooting)
@@ -66,9 +67,10 @@ commands.
66
67
  ChemQL is distributed as `chemql-python`; the executable and import name
67
68
  are `chemql`.
68
69
 
69
- **Requirements:** Python 3.10 or newer. `prompt_toolkit` is installed as
70
- a dependency. Internet access is needed only for optional online lookups
71
- or package upgrades.
70
+ **Requirements:** Python 3.10 or newer. `prompt_toolkit` and `rich` are
71
+ installed as dependencies. Internet access is needed for package registry
72
+ operations and optional online lookups; local queries and the standard library
73
+ remain available offline.
72
74
 
73
75
  Install from PyPI:
74
76
 
@@ -807,7 +809,9 @@ geometry::circle_area{2}
807
809
  ## Standard library
808
810
 
809
811
  ChemQL loads reusable `.cql` packages with `load`. The loader searches the
810
- current directory first and then ChemQL's bundled `stdlib/` directory.
812
+ current directory, installed packages (normally under `~/.chemql/packages/`),
813
+ and then ChemQL's bundled `stdlib/` directory. Installed package entry points
814
+ are resolved from the manifest's `main` field.
811
815
 
812
816
  | Package | Purpose |
813
817
  | --- | --- |
@@ -970,6 +974,97 @@ Supported forms include `dump all|good|bad FILE`,
970
974
  `dump all|good|bad queries FILE`, and `dump all|good|bad results FILE`.
971
975
  `good` and `bad` select successful and failed executions respectively.
972
976
 
977
+ ## ChemQL package management
978
+
979
+ ChemQL includes commands for creating, building, installing, and managing
980
+ reusable ChemQL packages. Run package-management commands in your system
981
+ terminal, not inside the interactive ChemQL prompt.
982
+
983
+ ### Create and build a package
984
+
985
+ Create a starter project:
986
+
987
+ ```bash
988
+ chemql init MyPackage # the name of the package is optional, if the name is empty it will just use the current folders name
989
+ cd MyPackage
990
+ ```
991
+
992
+ `chemql init` creates a `cqlpackage.json` manifest, `MyPackage.cql` entry
993
+ point, and `README.md`. It does not create a package-local `build.py`.
994
+
995
+ Build the package from the project directory:
996
+
997
+ ```bash
998
+ chemql build
999
+ ```
1000
+
1001
+ The builder reads `cqlpackage.json` or `cqlpackage.toml` and writes an archive
1002
+ to `dist/`, named `PACKAGE-VERSION.tar.gz`. The archive contains a top-level
1003
+ `PACKAGE-VERSION/` directory and is intended for uploading to a ChemQL package
1004
+ registry. Build excludes common generated directories such as virtual
1005
+ environments, caches, `node_modules`, `dist`, and `build`.
1006
+
1007
+ You can upload these .tar.gz files to https://chemqlreg.pythonanywhere.com/
1008
+
1009
+ ### Install and manage packages
1010
+
1011
+ The package commands are:
1012
+
1013
+ | Command | Purpose |
1014
+ |---|---|
1015
+ | `chemql search QUERY` | Search the configured package registry |
1016
+ | `chemql info NAME` | Display registry metadata for a package |
1017
+ | `chemql install NAME` | Install the latest available version |
1018
+ | `chemql install NAME --version 1.2.0` | Install a specific version |
1019
+ | `chemql upgrade NAME` | Upgrade an installed package |
1020
+ | `chemql upgrade NAME --version 1.2.0` | Upgrade to a specific version |
1021
+ | `chemql list` | List packages recorded as installed |
1022
+ | `chemql uninstall NAME` | Remove an installed package |
1023
+
1024
+ By default, packages are installed under `~/.chemql/packages/` and the
1025
+ installed-package record is stored in `~/.chemql/installed.json`.
1026
+
1027
+ Configure the installation paths with environment variables (optional):
1028
+
1029
+ - `CHEMQL_PACKAGE_DIR`: package installation directory.
1030
+ - `CHEMQL_INSTALLED_FILE`: installed-package state file.
1031
+
1032
+ For example, after installing a package named `GUI`, use it from ChemQL:
1033
+
1034
+ ```chemql
1035
+ load GUI
1036
+ ```
1037
+
1038
+ ChemQL uses the package manifest's `main` field to find the installed
1039
+ package's entry point.
1040
+
1041
+ ### Package manifest help
1042
+
1043
+ The manifest can point `help` at a Markdown file:
1044
+
1045
+ ```json
1046
+ {
1047
+ "name": "GUI",
1048
+ "version": "1.0.0",
1049
+ "description": "A GUI for ChemQL",
1050
+ "main": "GUI.cql",
1051
+ "help": "README.md",
1052
+ "help-individual": {
1053
+ "addButton": "Adds a button to the GUI."
1054
+ }
1055
+ }
1056
+ ```
1057
+
1058
+ Use `help{GUI}` to display the package description, the help content, and
1059
+ the individual help entries. If `help` names a `.md` file, ChemQL reads it
1060
+ relative to the manifest and renders it with Rich. Otherwise, the `help`
1061
+ value is displayed as literal text. Individual entries can be requested
1062
+ with `help{GUI::addButton}`. You do not even need to load it, you can simply run it
1063
+
1064
+ Package installation and registry operations require a reachable registry.
1065
+ The default registry URL is local to the machine; set `CHEMQL_REGISTRY_URL`
1066
+ when using a remote or hosted registry.
1067
+
973
1068
  ## Python API
974
1069
 
975
1070
  ``` python
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "chemql-python"
7
- version = "1.5.10"
7
+ version = "1.6.0"
8
8
  authors = [
9
9
  { name = "Mohammad Rakibul Islam", email = "rakibulofficial1017@gmail.com" }
10
10
  ]
@@ -13,6 +13,7 @@ readme = "README.md"
13
13
  requires-python = ">=3.10"
14
14
  dependencies = [
15
15
  "prompt_toolkit>=3.0",
16
+ "rich>=13.7",
16
17
  ]
17
18
 
18
19
  [project.optional-dependencies]