A simple library for managing versioning of classes
Project description
Versioned Classes
A tool for managing versions of classes in a service.
Installation
pip install versioned-classes
Usage
If you have ever worked on an API which has a complex interdependency hierarchy, you might have faced the problem of managing versions of classes. When services grow large and multiple APIs are added, it becomes difficult to manage which versions of classes are being used by which API. Moreover, it can become cumbersome to ensure that all calls to a class are being kept up to date. The aim of this project is to provide a simple way to use the best version of a class in a service.
Example
from versioned_classes import VersionedClass
from versioned_classes import initial_version
@initial_version("v1")
class MyAPI(VersionedClass):
pass
@MyAPI.register_version("v2")
class MyAPIV2(MyAPI):
pass
MyAPI.get_latest_version() # MyAPIV2
MyAPI.get_latest_version_instance(...) # MyAPIV2(...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for versioned_classes-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a12ad08422257330e699729619ab96fedfb2ede4f875778677623666b0bb28a |
|
MD5 | 689cfa5fc08cfc382b28a69be264fc91 |
|
BLAKE2b-256 | f1a8d54bc2462387b8c9405d123415d04e3ee8ee90eb8220215801329f2f4862 |