Skip to main content

CLI tool to view CIF files from various sources in your editor

Project description

view-cif

CLI tool to view CIF files from various sources in your preferred editor.

Features

  • Open CIF files by file path, PDB code, or compound name
  • Automatic download from PDB (including next-gen format)
  • CCD and PRD/PRDCC bulk file support
  • Configurable editor and data paths via YAML config
  • Cache-based viewing (no blocking --wait)

Installation

Requires Python 3.12+.

# From PyPI
pip install view-cif

# Or with uv
uv tool install view-cif

Usage

# Open a local CIF file
view-cif /path/to/structure.cif

# Open by PDB code (auto-downloads)
view-cif 1abc

# Open next-gen PDB format
view-cif 1abc --next-gen

# Open from a specific directory
view-cif ABC /path/to/cif/dir

# Open CCD chemical component
view-cif ATP

# Open PRD definition
view-cif prd --ccd-definition

Options

Option Short Description
--ccd-definition -d Use CCD definition file type
--next-gen -n Use pdb_next_gen format

Configuration

On first run, a default config is created at ~/.config/view-cif/config.yaml.

Managing config via CLI

# Show current configuration
view-cif config show

# Change editor
view-cif config set editor nvim

# Set data paths
view-cif config set paths.chem_comp /data/chem_comp
view-cif config set paths.monomers /data/monomers

Config keys

Key Description
editor Editor command to open CIF files (e.g., code, nvim, emacs)
cache_dir Directory for cached CIF output
paths.pdb_next_gen Root directory for next-gen PDB files
paths.bird Root directory for BIRD (PRD) data
paths.monomers Directory containing components.cif.gz
paths.chem_comp Directory for chemical component CIF files
paths.prd Directory for PRD definition CIF files

Development

# Install with dev dependencies
uv sync --group dev

# Run tests
uv run pytest --cov=view_cif -v

# Lint
uv run ruff check .

License

MIT

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

view_cif-0.2.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

view_cif-0.2.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file view_cif-0.2.0.tar.gz.

File metadata

  • Download URL: view_cif-0.2.0.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for view_cif-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2faa8438c19174fc69ac6123d7c3af738f205d476ed7f5d4831c2c006233526f
MD5 c18c8f072372824b9bb1a71ebc529577
BLAKE2b-256 07034c2861c26a0698388fd6abb46d9d22315aed06eb724b61e3c1926ce9b6be

See more details on using hashes here.

Provenance

The following attestation bundles were made for view_cif-0.2.0.tar.gz:

Publisher: publish.yml on N283T/view-cif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file view_cif-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: view_cif-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for view_cif-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 147e0e0f03d8d6bf177e033daa8dd74705375570eca374ac855f47ccfc26a7f1
MD5 7dbb68b7e77b19697e41d45518388682
BLAKE2b-256 d3ccac33a37d7df9b8b8b285ac6a8d273db17f3203696ccde884376bd925a54e

See more details on using hashes here.

Provenance

The following attestation bundles were made for view_cif-0.2.0-py3-none-any.whl:

Publisher: publish.yml on N283T/view-cif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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