chemql-python 1.5.10__tar.gz → 1.6.1__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.10 → chemql_python-1.6.1}/PKG-INFO +104 -7
- {chemql_python-1.5.10 → chemql_python-1.6.1}/README.md +102 -6
- {chemql_python-1.5.10 → chemql_python-1.6.1}/pyproject.toml +2 -1
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/__init__.py +617 -6
- chemql_python-1.6.1/src/chemql/build.py +106 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/codecql.py +76 -6
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql_python.egg-info/PKG-INFO +104 -7
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql_python.egg-info/SOURCES.txt +1 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql_python.egg-info/requires.txt +1 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/LICENSE +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/setup.cfg +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/__main__.py +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/colors.json +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/BondEnergies.json +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/MoleculeBonds.json +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/Molecules.json +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/PeriodicTableJSON.json +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/Reactions.json +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/THIRD_PARTY_LICENSES/PeriodicTableJSON.txt +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/data/THIRD_PARTY_LICENSES/RHEA.txt +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/html/periodic_table.html +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/README.md +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/collections.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/datetime.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/decimal.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/fractions.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/json.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/math/statistics.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/math.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/pathlib.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/random.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql/stdlib/text.cql +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql_python.egg-info/dependency_links.txt +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql_python.egg-info/entry_points.txt +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/src/chemql_python.egg-info/top_level.txt +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/tests/test_codecql.py +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/tests/test_external_molecule_lookup.py +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/tests/test_public_api.py +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/tests/test_reactions.py +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/tests/test_stdlib.py +0 -0
- {chemql_python-1.5.10 → chemql_python-1.6.1}/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.
|
|
3
|
+
Version: 1.6.1
|
|
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.
|
|
23
|
+
- **Version:** `1.6.1`
|
|
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`
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|
|
@@ -145,10 +148,11 @@ exit
|
|
|
145
148
|
|
|
146
149
|
### Terminal editor
|
|
147
150
|
|
|
148
|
-
Install the package, then open a ChemQL file with the `codecql` command
|
|
151
|
+
Install the package, then open a ChemQL file with the `codecql` command or `chemql edit`:
|
|
149
152
|
|
|
150
153
|
``` bash
|
|
151
154
|
codecql script.cql
|
|
155
|
+
chemql edit script.cql # this works too
|
|
152
156
|
```
|
|
153
157
|
|
|
154
158
|
The editor supports syntax highlighting, direct text editing, word movement
|
|
@@ -820,7 +824,9 @@ geometry::circle_area{2}
|
|
|
820
824
|
## Standard library
|
|
821
825
|
|
|
822
826
|
ChemQL loads reusable `.cql` packages with `load`. The loader searches the
|
|
823
|
-
current directory
|
|
827
|
+
current directory, installed packages (normally under `~/.chemql/packages/`),
|
|
828
|
+
and then ChemQL's bundled `stdlib/` directory. Installed package entry points
|
|
829
|
+
are resolved from the manifest's `main` field.
|
|
824
830
|
|
|
825
831
|
| Package | Purpose |
|
|
826
832
|
| --- | --- |
|
|
@@ -983,6 +989,97 @@ Supported forms include `dump all|good|bad FILE`,
|
|
|
983
989
|
`dump all|good|bad queries FILE`, and `dump all|good|bad results FILE`.
|
|
984
990
|
`good` and `bad` select successful and failed executions respectively.
|
|
985
991
|
|
|
992
|
+
## ChemQL package management
|
|
993
|
+
|
|
994
|
+
ChemQL includes commands for creating, building, installing, and managing
|
|
995
|
+
reusable ChemQL packages. Run package-management commands in your system
|
|
996
|
+
terminal, not inside the interactive ChemQL prompt.
|
|
997
|
+
|
|
998
|
+
### Create and build a package
|
|
999
|
+
|
|
1000
|
+
Create a starter project:
|
|
1001
|
+
|
|
1002
|
+
```bash
|
|
1003
|
+
chemql init MyPackage # the name of the package is optional, if the name is empty it will just use the current folders name
|
|
1004
|
+
cd MyPackage
|
|
1005
|
+
```
|
|
1006
|
+
|
|
1007
|
+
`chemql init` creates a `cqlpackage.json` manifest, `MyPackage.cql` entry
|
|
1008
|
+
point, and `README.md`. It does not create a package-local `build.py`.
|
|
1009
|
+
|
|
1010
|
+
Build the package from the project directory:
|
|
1011
|
+
|
|
1012
|
+
```bash
|
|
1013
|
+
chemql build
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
The builder reads `cqlpackage.json` or `cqlpackage.toml` and writes an archive
|
|
1017
|
+
to `dist/`, named `PACKAGE-VERSION.tar.gz`. The archive contains a top-level
|
|
1018
|
+
`PACKAGE-VERSION/` directory and is intended for uploading to a ChemQL package
|
|
1019
|
+
registry. Build excludes common generated directories such as virtual
|
|
1020
|
+
environments, caches, `node_modules`, `dist`, and `build`.
|
|
1021
|
+
|
|
1022
|
+
You can upload these .tar.gz files to https://chemqlreg.pythonanywhere.com/
|
|
1023
|
+
|
|
1024
|
+
### Install and manage packages
|
|
1025
|
+
|
|
1026
|
+
The package commands are:
|
|
1027
|
+
|
|
1028
|
+
| Command | Purpose |
|
|
1029
|
+
|---|---|
|
|
1030
|
+
| `chemql search QUERY` | Search the configured package registry |
|
|
1031
|
+
| `chemql info NAME` | Display registry metadata for a package |
|
|
1032
|
+
| `chemql install NAME` | Install the latest available version |
|
|
1033
|
+
| `chemql install NAME --version 1.2.0` | Install a specific version |
|
|
1034
|
+
| `chemql upgrade NAME` | Upgrade an installed package |
|
|
1035
|
+
| `chemql upgrade NAME --version 1.2.0` | Upgrade to a specific version |
|
|
1036
|
+
| `chemql list` | List packages recorded as installed |
|
|
1037
|
+
| `chemql uninstall NAME` | Remove an installed package |
|
|
1038
|
+
|
|
1039
|
+
By default, packages are installed under `~/.chemql/packages/` and the
|
|
1040
|
+
installed-package record is stored in `~/.chemql/installed.json`.
|
|
1041
|
+
|
|
1042
|
+
Configure the installation paths with environment variables (optional):
|
|
1043
|
+
|
|
1044
|
+
- `CHEMQL_PACKAGE_DIR`: package installation directory.
|
|
1045
|
+
- `CHEMQL_INSTALLED_FILE`: installed-package state file.
|
|
1046
|
+
|
|
1047
|
+
For example, after installing a package named `GUI`, use it from ChemQL:
|
|
1048
|
+
|
|
1049
|
+
```chemql
|
|
1050
|
+
load GUI
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
ChemQL uses the package manifest's `main` field to find the installed
|
|
1054
|
+
package's entry point.
|
|
1055
|
+
|
|
1056
|
+
### Package manifest help
|
|
1057
|
+
|
|
1058
|
+
The manifest can point `help` at a Markdown file:
|
|
1059
|
+
|
|
1060
|
+
```json
|
|
1061
|
+
{
|
|
1062
|
+
"name": "GUI",
|
|
1063
|
+
"version": "1.0.0",
|
|
1064
|
+
"description": "A GUI for ChemQL",
|
|
1065
|
+
"main": "GUI.cql",
|
|
1066
|
+
"help": "README.md",
|
|
1067
|
+
"help-individual": {
|
|
1068
|
+
"addButton": "Adds a button to the GUI."
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
Use `help{GUI}` to display the package description, the help content, and
|
|
1074
|
+
the individual help entries. If `help` names a `.md` file, ChemQL reads it
|
|
1075
|
+
relative to the manifest and renders it with Rich. Otherwise, the `help`
|
|
1076
|
+
value is displayed as literal text. Individual entries can be requested
|
|
1077
|
+
with `help{GUI::addButton}`. You do not even need to load it, you can simply run it
|
|
1078
|
+
|
|
1079
|
+
Package installation and registry operations require a reachable registry.
|
|
1080
|
+
The default registry URL is local to the machine; set `CHEMQL_REGISTRY_URL`
|
|
1081
|
+
when using a remote or hosted registry.
|
|
1082
|
+
|
|
986
1083
|
## Python API
|
|
987
1084
|
|
|
988
1085
|
``` 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.
|
|
9
|
+
- **Version:** `1.6.1`
|
|
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`
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
|
@@ -132,10 +134,11 @@ exit
|
|
|
132
134
|
|
|
133
135
|
### Terminal editor
|
|
134
136
|
|
|
135
|
-
Install the package, then open a ChemQL file with the `codecql` command
|
|
137
|
+
Install the package, then open a ChemQL file with the `codecql` command or `chemql edit`:
|
|
136
138
|
|
|
137
139
|
``` bash
|
|
138
140
|
codecql script.cql
|
|
141
|
+
chemql edit script.cql # this works too
|
|
139
142
|
```
|
|
140
143
|
|
|
141
144
|
The editor supports syntax highlighting, direct text editing, word movement
|
|
@@ -807,7 +810,9 @@ geometry::circle_area{2}
|
|
|
807
810
|
## Standard library
|
|
808
811
|
|
|
809
812
|
ChemQL loads reusable `.cql` packages with `load`. The loader searches the
|
|
810
|
-
current directory
|
|
813
|
+
current directory, installed packages (normally under `~/.chemql/packages/`),
|
|
814
|
+
and then ChemQL's bundled `stdlib/` directory. Installed package entry points
|
|
815
|
+
are resolved from the manifest's `main` field.
|
|
811
816
|
|
|
812
817
|
| Package | Purpose |
|
|
813
818
|
| --- | --- |
|
|
@@ -970,6 +975,97 @@ Supported forms include `dump all|good|bad FILE`,
|
|
|
970
975
|
`dump all|good|bad queries FILE`, and `dump all|good|bad results FILE`.
|
|
971
976
|
`good` and `bad` select successful and failed executions respectively.
|
|
972
977
|
|
|
978
|
+
## ChemQL package management
|
|
979
|
+
|
|
980
|
+
ChemQL includes commands for creating, building, installing, and managing
|
|
981
|
+
reusable ChemQL packages. Run package-management commands in your system
|
|
982
|
+
terminal, not inside the interactive ChemQL prompt.
|
|
983
|
+
|
|
984
|
+
### Create and build a package
|
|
985
|
+
|
|
986
|
+
Create a starter project:
|
|
987
|
+
|
|
988
|
+
```bash
|
|
989
|
+
chemql init MyPackage # the name of the package is optional, if the name is empty it will just use the current folders name
|
|
990
|
+
cd MyPackage
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
`chemql init` creates a `cqlpackage.json` manifest, `MyPackage.cql` entry
|
|
994
|
+
point, and `README.md`. It does not create a package-local `build.py`.
|
|
995
|
+
|
|
996
|
+
Build the package from the project directory:
|
|
997
|
+
|
|
998
|
+
```bash
|
|
999
|
+
chemql build
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
The builder reads `cqlpackage.json` or `cqlpackage.toml` and writes an archive
|
|
1003
|
+
to `dist/`, named `PACKAGE-VERSION.tar.gz`. The archive contains a top-level
|
|
1004
|
+
`PACKAGE-VERSION/` directory and is intended for uploading to a ChemQL package
|
|
1005
|
+
registry. Build excludes common generated directories such as virtual
|
|
1006
|
+
environments, caches, `node_modules`, `dist`, and `build`.
|
|
1007
|
+
|
|
1008
|
+
You can upload these .tar.gz files to https://chemqlreg.pythonanywhere.com/
|
|
1009
|
+
|
|
1010
|
+
### Install and manage packages
|
|
1011
|
+
|
|
1012
|
+
The package commands are:
|
|
1013
|
+
|
|
1014
|
+
| Command | Purpose |
|
|
1015
|
+
|---|---|
|
|
1016
|
+
| `chemql search QUERY` | Search the configured package registry |
|
|
1017
|
+
| `chemql info NAME` | Display registry metadata for a package |
|
|
1018
|
+
| `chemql install NAME` | Install the latest available version |
|
|
1019
|
+
| `chemql install NAME --version 1.2.0` | Install a specific version |
|
|
1020
|
+
| `chemql upgrade NAME` | Upgrade an installed package |
|
|
1021
|
+
| `chemql upgrade NAME --version 1.2.0` | Upgrade to a specific version |
|
|
1022
|
+
| `chemql list` | List packages recorded as installed |
|
|
1023
|
+
| `chemql uninstall NAME` | Remove an installed package |
|
|
1024
|
+
|
|
1025
|
+
By default, packages are installed under `~/.chemql/packages/` and the
|
|
1026
|
+
installed-package record is stored in `~/.chemql/installed.json`.
|
|
1027
|
+
|
|
1028
|
+
Configure the installation paths with environment variables (optional):
|
|
1029
|
+
|
|
1030
|
+
- `CHEMQL_PACKAGE_DIR`: package installation directory.
|
|
1031
|
+
- `CHEMQL_INSTALLED_FILE`: installed-package state file.
|
|
1032
|
+
|
|
1033
|
+
For example, after installing a package named `GUI`, use it from ChemQL:
|
|
1034
|
+
|
|
1035
|
+
```chemql
|
|
1036
|
+
load GUI
|
|
1037
|
+
```
|
|
1038
|
+
|
|
1039
|
+
ChemQL uses the package manifest's `main` field to find the installed
|
|
1040
|
+
package's entry point.
|
|
1041
|
+
|
|
1042
|
+
### Package manifest help
|
|
1043
|
+
|
|
1044
|
+
The manifest can point `help` at a Markdown file:
|
|
1045
|
+
|
|
1046
|
+
```json
|
|
1047
|
+
{
|
|
1048
|
+
"name": "GUI",
|
|
1049
|
+
"version": "1.0.0",
|
|
1050
|
+
"description": "A GUI for ChemQL",
|
|
1051
|
+
"main": "GUI.cql",
|
|
1052
|
+
"help": "README.md",
|
|
1053
|
+
"help-individual": {
|
|
1054
|
+
"addButton": "Adds a button to the GUI."
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
Use `help{GUI}` to display the package description, the help content, and
|
|
1060
|
+
the individual help entries. If `help` names a `.md` file, ChemQL reads it
|
|
1061
|
+
relative to the manifest and renders it with Rich. Otherwise, the `help`
|
|
1062
|
+
value is displayed as literal text. Individual entries can be requested
|
|
1063
|
+
with `help{GUI::addButton}`. You do not even need to load it, you can simply run it
|
|
1064
|
+
|
|
1065
|
+
Package installation and registry operations require a reachable registry.
|
|
1066
|
+
The default registry URL is local to the machine; set `CHEMQL_REGISTRY_URL`
|
|
1067
|
+
when using a remote or hosted registry.
|
|
1068
|
+
|
|
973
1069
|
## Python API
|
|
974
1070
|
|
|
975
1071
|
``` python
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "chemql-python"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.6.1"
|
|
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]
|