ADCT Python
Python client API implementation for publishing ADCT data
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
adctk.adc_version.AdcVersion Class Reference

Construct for ADC Toolkit Python Version. More...

Public Member Functions

 __init__ (self, **kwargs)
 
 __str__ (self)
 
 __json__ (self)
 
 add_tag (self, str tag)
 Add a tag to the list in the version object.
 
 add_tags (self, list tags)
 Add an iterable of tags to the list in the version object.
 

Public Attributes

 version
 
 tags
 

Protected Member Functions

 _dict (self)
 

Detailed Description

Construct for ADC Toolkit Python Version.

Constructor & Destructor Documentation

◆ __init__()

adctk.adc_version.AdcVersion.__init__ (   self,
**  kwargs 
)
8 def __init__(self, **kwargs):
9 if "name" in kwargs:
10 self.version = kwargs["name"]
11 else:
12 self.version = "1.0.0"
13 self.__version__ = self.version
14 if "tags" in kwargs:
15 self.tags = kwargs["tags"]
16 else:
17 self.tags = ["adct-json-1.0.0"]
18

Member Function Documentation

◆ __json__()

adctk.adc_version.AdcVersion.__json__ (   self)
29 def __json__(self):
30 return self._dict()
31

◆ __str__()

adctk.adc_version.AdcVersion.__str__ (   self)
19 def __str__(self):
20 if self.tags:
21 stringified_tag = "-".join(self.tags)
22 return f"{self.version}-{stringified_tag}"
23 return f"{self.version}"
24

◆ _dict()

adctk.adc_version.AdcVersion._dict (   self)
protected
25 def _dict(self):
26 return {"version" : self.version,
27 "tags" : self.tags}
28

◆ add_tag()

adctk.adc_version.AdcVersion.add_tag (   self,
str  tag 
)

Add a tag to the list in the version object.

32 def add_tag(self, tag: str):
33 """! Add a tag to the list in the version object"""
34 self.tags.append(tag)
35 return self
36

◆ add_tags()

adctk.adc_version.AdcVersion.add_tags (   self,
list  tags 
)

Add an iterable of tags to the list in the version object.

37 def add_tags(self, tags: list):
38 """! Add an iterable of tags to the list in the version object"""
39 self.tags.extend(tags)
40 return self

Member Data Documentation

◆ tags

adctk.adc_version.AdcVersion.tags

◆ version

adctk.adc_version.AdcVersion.version

The documentation for this class was generated from the following file: