Skip to main content
Sifr ships a comprehensive standard library under the sifr.* namespace. Every module is designed with Rust-backed safety guarantees — predictable ownership, explicit error types, and no hidden global mutation. Because Sifr compiles to Rust rather than running on the CPython interpreter, the standard library is its own surface; it is not a thin wrapper around CPython’s built-in modules. For a compact inventory of every module currently shipped in stdlib/sifr, see the Module Index.

How to Import

Use from sifr.<module> import <symbol> for every standard library import:
Bare CPython module names are not supported. Importing math, json, os, collections, codecs, unicodedata, locale, or any other CPython stdlib name directly triggers error SIFR-IMPORT-0008 and the compiler suggests the correct sifr.* replacement.
import sifr.math (module-object form) is also unsupported in the current release. Always import the specific symbols you need using from sifr.<module> import <symbol>.
If a real user-defined or third-party top-level module named math, json, or similar exists in your project, the normal top-level resolution imports it without a diagnostic. The SIFR-IMPORT-0008 error only fires when no real top-level module matches the bare name.

Available Modules

Concurrency has its own docs section. Start with the Concurrency Overview, then use the Concurrency API for module reference.

What Sifr Does Not Expose

Several CPython-shaped names are intentionally absent because they rely on global mutable state or interpreter-specific behavior that conflicts with Sifr’s safety model:
  • asyncio event-loop objects and loop-policy mutation
  • threading.Lock, queue.Queue, and multiprocessing.*
  • codecs.register, locale.setlocale, and gettext.install
  • signal.signal and set_wakeup_fd for arbitrary handler registration
Each of these has a typed, ownership-safe equivalent in the sifr.* namespace. See the individual module pages for details.