Getting Started
Choose your platform to get started with sci-form.
Rust
bash
cargo add sci-formrust
fn main() {
let result = sci_form::embed("CCO", 42);
if let Some(err) = &result.error {
eprintln!("Error: {}", err);
return;
}
println!("Ethanol: {} atoms", result.num_atoms);
for i in 0..result.num_atoms {
let x = result.coords[i * 3];
let y = result.coords[i * 3 + 1];
let z = result.coords[i * 3 + 2];
println!(" Atom {}: ({:.3}, {:.3}, {:.3})", result.elements[i], x, y, z);
}
}→ See the Rust guide for full API details.
Python
The package is published as sciforma on PyPI. The import name is sci_form.
bash
pip install sciformapython
import sci_form
result = sci_form.embed("c1ccccc1") # benzene, seed=42 default
print(f"Atoms: {result.num_atoms}, Time: {result.time_ms:.1f}ms")
for i, (x, y, z) in enumerate(result.get_positions()):
print(f" {result.elements[i]:2d}: ({x:7.3f}, {y:7.3f}, {z:7.3f})")→ See the Python guide for full API details.
TypeScript / JavaScript
The npm package is sci-form-wasm.
bash
npm install sci-form-wasmNode.js (CommonJS)
javascript
const sci = require('sci-form-wasm');
const result = JSON.parse(sci.embed('CC(=O)O', 42)); // acetic acid
console.log(`Atoms: ${result.num_atoms}`);ES Module / TypeScript
typescript
import init, { embed } from 'sci-form-wasm';
await init();
const result = JSON.parse(embed('CC(=O)O', 42));
console.log(`Atoms: ${result.num_atoms}`);→ See the TypeScript guide for full API details.
CLI
Download from GitHub Releases or build from source:
bash
cargo install sci-form-clibash
# Single molecule → XYZ format
sci-form embed "CCO" --format xyz
# Batch processing
sci-form batch -i molecules.smi -o output.sdf --format sdf --threads 8
# Parse SMILES (no 3D generation)
sci-form parse "c1ccccc1"→ See the CLI guide for all commands and options.
→ See the [CLI guide](/guide/cli) for all subcommands.