REST API that provides the full functionality of SIRIUS and its web services as background service. It is intended as entry-point for scripting languages and software integration SDKs.
Install the py-sirius-ms
package from conda-forge using
conda install -c conda-forge py-sirius-ms
or
conda install conda-forge::py-sirius-ms
This will automatically install all dependencies, including the sirius-ms
package including SIRIUS itself and set an environment variable for SIRIUS when activating the respective conda environment.
The conda-forge install is the preferred method due to quality-of-life features (see Getting Started).
Replace v0.0.0 with your api version
pip install git+https://github.com/sirius-ms/sirius-client-openAPI@v0.0.0#subdirectory=client-api_python/generated
pip install git+https://github.com/sirius-ms/sirius-client-openAPI#subdirectory=client-api_python/generated
(you may need to run pip
with root permission: sudo pip install git+https://github.com/sirius-ms/sirius-client-openAPI#subdirectory=client-api_python/generated
)
Then import the package:
import PySirius
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import PySirius
Please follow the installation procedure and then run the following (while replacing the Strings for project_space and sirius_executable).
NOTE: the SIRIUS REST service automatically allocates a random available port on your machine.
SiriusSDK
will always try to get this information automatically, but you can set a port manually to make sure.
If you installed via conda-forge or have SIRIUS in your path, you should be able to activate your environment and simply use:
from PySirius import SiriusSDK
sdk = SiriusSDK()
# SIRIUS must be in the path or the SIRIUS_EXE environment variable must be specified.
# Is automatically configured when installing via conda or windows ms installer
api = sdk.attach_or_start_sirius()
print(api.jobs().get_default_job_config())
print(api.projects().get_project_spaces())
# Optional
sdk.shutdown_sirius()
If you installed from GitHub or a local folder manually and do not have SIRIUS in path, you can go the manual way:
from PySirius import SiriusSDK
sdk = SiriusSDK()
api = sdk.start_sirius(sirius_path="your/path/to/sirius", port=8080)
You can also attach to a running SIRIUS instance:
from PySirius import SiriusSDK
sdk = SiriusSDK()
api = sdk.attach_to_sirius(sirius_major_version=6, port=8080)
Please follow the installation procedure and then run the following (while replacing address and port with the Remote address specifications):
from PySirius import SiriusSDK
sdk = SiriusSDK()
api = sdk.connect("http://localhost:8080")
For more niche functionality and insights, find the SiriusSDK class here.
Our feedstocks for the conda-forge packages are running an automated minimal test. We included the scripts here. Feel free to take them as example usages of the packages.
Please click here
Please click here