Skip to main content

No project description provided

Project description

Ruff PyPI

PyMOL Remote

A simple RPC client for sending commands and data between Python and PyMOL. (RPC = Remote Procedure Call)

1. Installation

pip install git+https://github.com/Croydon-Brixton/pymol-remote.git

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.txt for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymol_remote-0.0.4.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

pymol_remote-0.0.4-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file pymol_remote-0.0.4.tar.gz.

File metadata

  • Download URL: pymol_remote-0.0.4.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pymol_remote-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ec527cabd6c2868a9b50c2639de9d9c1b8cd7a6ab3be9180799203dc7833dc9b
MD5 a7a0d3e7cfd407c878ba7103aa5b6b4a
BLAKE2b-256 6b0c3e494be04a6de3fb413b80cc31db27e06d6471a42f605e5749bedef405ca

See more details on using hashes here.

File details

Details for the file pymol_remote-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pymol_remote-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pymol_remote-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4ceb1cb6c99a4f549d74d5a8185954b7c7ca76e3dace164015cedc51f7532d66
MD5 5fc065ee8456c8901cf02a0f1ce9f5b6
BLAKE2b-256 e2fb42ee71745fabeb01335ee1c5ae44cab1102afd6ee428994f30050baa5c3d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page