{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/4"}],"enrichment":{"capability":"Pyvers provides dynamic dispatch for Python functions based on installed package versions and backend implementations, letting you write version-specific code that automatically selects the right implementation at runtime.","skillfed_tags":["version-dispatch","backend-abstraction","compatibility-layer"],"use_cases":["Support multiple versions of a dependency (e.g., NumPy < 2.0 vs >= 2.0) without if/else chains in your code","Switch between CPU (SciPy) and GPU (CuPy) implementations at runtime based on availability or user preference","Handle breaking API changes in frameworks like PyTorch 2.0 or gymnasium vs gym without duplicating logic","Write version-specific optimizations (e.g., torch.compile for PyTorch 2.0+) that degrade gracefully on older versions","Maintain backward compatibility while adopting new library features as they become available"],"what_it_does":"Pyvers is a dispatch library that lets you write version-aware code without littering your codebase with version checks and conditional logic. It works by registering version-specific implementations of a function, then automatically selecting the correct one based on the installed version of a dependency. You define a base function with the @implement_for decorator, then register variants for different version ranges using the .register() API (similar to functools.singledispatch). At runtime, pyvers inspects the actual installed version and calls the matching implementation.\n\nThe library also supports backend switching, letting you register multiple implementations (e.g., NumPy vs JAX, CPU vs GPU) and swap between them dynamically using context managers. Backends are imported only when needed, so you can register optional dependencies without requiring them to be installed upfront. This is useful for libraries that want to support multiple compute backends or handle breaking changes across major versions without forcing users to maintain separate code paths.","worth_installing":"Yes. Pyvers solves a real problem\u2014managing version-specific code paths\u2014with a clean, low-friction API and zero runtime dependencies. It's actively maintained, supports modern Python versions, has no known vulnerabilities, and is permissively licensed. Install it if you maintain a library that needs to support multiple versions of a dependency or multiple backend implementations."},"id":"pyvers","links":{"html":"https://skillfed.io/packages/pyvers","md":"https://skillfed.io/packages/pyvers.md","pypi":"https://pypi.org/project/pyvers/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-09","license_spdx":null,"license_treatment":"permissive","name":"pyvers","python_support":"supports_current","summary":"A Python library for managing multiple versions of dependencies"},"popularity":{"monthly_downloads":2474161,"position":3047,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.2.3"}
