No project description provided
Project description
PyMOL Remote
A simple RPC client for sending commands and data between Python and PyMOL. (RPC = Remote Procedure Call)
1. Installation
pymol-remote
has no dependencies beyond the base Python standard library, so installation is straightforward:
pip install pymol-remote
On the server side, you need to have a working pymol
installation. Whichever python interpreter you are using to run pymol
should also have pymol-remote
installed (or needs to have pymol-remote
in its pythonpath). The easiest way to do this is to install pymol
via conda
into an existing or new environment and then install pymol-remote
in the same environment with pip install pymol-remote
.
On the client side, you need to have a working Python environment with pymol-remote
installed.
2. Usage
2.1 Server side (where PyMOL is running)
# Navigate into your pymol environment
# that environment should have both, pymol and pymol_remote installed
# e.g.:
# conda activate pymol
# If pymol_remote is installed, the following command will start the server
pymol_remote
This command will start pymol, and in the pymol console you should see a likely guess of your IP address (and the correct port number, 9123 by default).
If this IP address does not work, you might need to use commands like ifconfig
or ipconfig
on your computer to find the correct IP address of the server in your local network.
3.2 Client side (where you want to run your Python code)
Make sure you have the pymol_remote
package installed in the Python environment where you want to run your code.
Make sure you ran pymol_remote
on the server side before running the Python code below.
from pymol_remote.client import PymolSession
# NOTE: When you run `pymol_remote` on the server side, it will print a likely guess of your
# IP address (and the correct port number, 9123 by default). Try that IP address first,
# if it doesn't work you might need to use commands like `ifconfig` or `ipconfig` on
# your computer to find the correct IP address of the server in your local network.
pymol = PymolSession(hostname="ip_address_of_server", port=9123)
# You can now send commands to PyMOL
pymol.fetch("6lyz")
pymol.do("remove solvent")
pymol.do("set valence, on")
pymol.get_state(format="cif")
# To see all available methods use
pymol.help()
# To get more help on a specific method, use
pymol.help("fetch")
# To get more general documentation information, use
pymol.print_help()
3. Credit
This implementation is inspired by and based on the original RDKit RPC implementation and PyMOL RPC by Greg Landrum. Thank you Greg! And thank you Schrodinger for making PyMOL open source!
4. License
This code is licensed under the same terms as PyMOL. See LICENSE for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pymol_remote-0.0.5.tar.gz
.
File metadata
- Download URL: pymol_remote-0.0.5.tar.gz
- Upload date:
- Size: 755.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d92efbc25f2475ac80e0bbf4ce0f86c0974a3c13b122c84ace78d08b1473050f |
|
MD5 | b90abf6878fa58ea450382f875950440 |
|
BLAKE2b-256 | da17887e35317e44641f30831f72b33d0664dc3f194f9a4beb2f33af8f108f2f |
File details
Details for the file pymol_remote-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: pymol_remote-0.0.5-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9efa062aeb802e10de935d14cc11a0d557613d74c40e73c8479680baeb3e9b2 |
|
MD5 | 776956a2f662167551576ed16b8072b9 |
|
BLAKE2b-256 | 8355f97fb96b48c334e247641382e66e18876a78fd0667a62a1ee761c309180e |