Skip to main content

A simple library for managing versioning of classes

Project description

Code style: black

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

versioned_classes-0.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

versioned_classes-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file versioned_classes-0.0.1.tar.gz.

File metadata

  • Download URL: versioned_classes-0.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for versioned_classes-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0e92268ae1d33bd1d6aa1fed6fd5c33564c7b7c0fabd73815aa10388ba61e586
MD5 d53a4dedec73a401195b3fc336c47921
BLAKE2b-256 fc715f0275a87d279ad72c00bce77ad76b2086e5b1d0625d3e26d5f3c2e2138c

See more details on using hashes here.

File details

Details for the file versioned_classes-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for versioned_classes-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a12ad08422257330e699729619ab96fedfb2ede4f875778677623666b0bb28a
MD5 689cfa5fc08cfc382b28a69be264fc91
BLAKE2b-256 f1a8d54bc2462387b8c9405d123415d04e3ee8ee90eb8220215801329f2f4862

See more details on using hashes here.

Supported by

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