Package platformids

Package platformids

source code

The package 'platformids' provides canonical enumerations of bit encoded numeric platform IDs for the Python implementations CPython, IPython, IronPython, Jython, and PyPy.

Version: 0.1.31

Author: Arno-Can Uestuensoez

Copyright: Copyright (C) 2010-2018 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez

License: Artistic-License-2.0 + Forced-Fairplay-Constraints

Submodules

Functions
 
decode_rte_category_to_num(rte=276917248)
Decodes the compressed category from the 32bit integer bitmask into the corresponding integer enum.
source code
 
decode_rte_dist_to_num(rte=276917248)
Decodes the compressed dist from the 32bit integer bitmask into the corresponding integer enum. Recognizes the ostype domain e.g. for RTE_NT.
source code
 
decode_rte_distrel_to_num(rte=276917248)
Decodes the compressed distrel from the 32bit integer bitmask into the corresponding integer enum. Recognizes the ostype and dist domain, the distrel extension flag.
source code
 
decode_rte_distrel_to_segments(rte=276917248)
Decodes the compressed distrel from the 32bit integer bitmask into the corresponding tuple of integer segments.
source code
 
decode_rte_ostype_to_num(rte=276917248)
Decodes the compressed ostype from the 32bit integer bitmask into the corresponding integer enum.
source code
 
decode_rte_to_segments(rte=276917248)
Decodes the compressed components from the 32bit integer bitmask into the corresponding segments of relative integer values.
source code
 
decode_rte_to_tuple(rte=276917248)
Decodes the compressed components from the 32bit integer bitmask into the corresponding tuple of partial integer enums.
source code
 
decode_rte_to_tuple_str(rte=276917248)
Decodes the compressed components from the 32bit integer bitmask into the corresponding tuple of string keywords.
source code
 
decode_version_str_to_segments(v)
Split a version string separated by '.' into an integer array.
source code
 
encode_rte_segments_to_32bit(**kargs)
Converts the numeric base values of the fields into a 32bit bitmask and encodes them into the combined integer value of the bitmask vector.
source code
 
encode_rte_to_32bit(**kargs)
Encodes the provided 32bit bitmask of each field into the combined integer value of the bitmask vector.
source code
 
fetch_category()
Scans the platform and returns the numeric id for the current category.
source code
 
fetch_dist()
Scans the platform and returns the numeric id for the current dist.
source code
 
fetch_dist_tuple()
Scans the platform and returns the complete tuple for the current dist.
source code
 
fetch_ostype()
Scans the platform and returns the numeric id for the current ostype.
source code
 
fetch_platform_distribution()
Scans the platform and returns the complete distribution data prepared for common post-processing.
source code
 
fetch_platform_distribution_num()
The numeric version of 'fetch_platform_distribution'.
source code
 
fetch_platform_os()
Scans the platform and returns the information on the OS including the name and the release version.
source code
 
fetch_platform_os_num()
The numeric version of 'fetch_platform_os'.
source code
 
fetch_rte_hexversion()
Retrieves the bitmask encoding for current runtime environemnt.
source code
 
get_modlocation(mname, mbase=None, mpaths=None, **kargs)
Calls the pythonids.get_modulelocation function with specific default parameters for the platformids.
source code
 
get_num2rte(num)
Gets the corresponding string representation for the string numeric value.
source code
 
get_rte2num(rte)
Gets corresponding numerical representation for the numeric or string value.
source code
 
set_num2rte(key, value)
Sets the numeric to string map.
source code
 
set_rte2num(key, value)
Sets the rte to numeric mapping
source code
Variables
  DSKORG_ID = re.compile('^(?s)ID=["\']*([^"\'\n\r]*).*', re.DOT...
  DSKORG_ID_LIKE = re.compile('^(?s)ID_LIKE=["\']*([^"\'\n\r]*)....
  DSKORG_NAME_RELEASE = re.compile('(?s)^NAME=["\']*([^ ]*) *([^...
  DSKORG_RELEASE = re.compile('(?s)^VERSION=["\']*([^"\']*)["\']...
  DSKORG_VERSION = re.compile('(?s)^VERSION=["\']*([^"\']*)["\']...
  ISINT = (<class 'int'>)
  ISSTR = (<class 'str'>, <class 'bytes'>)
  PRENONNUM = re.compile('([^0-9]+[^ \t0-9]).*')
  PYDIST = 3020173824
  PYE_DIST = 8126464
  PYE_JYTHON = 1572864
  PYV2 = 16384
  PYV33 = 25344
  PYV35Plus = True
  PYVxyz = 26624
  PlatformIDsCustomError = <class 'platformids.PlatformIDsCustom...
  PlatformIDsEnumerationError = <class 'platformids.PlatformIDsE...
  PlatformIDsError = <class 'platformids.PlatformIDsError'>
  PlatformIDsFileCheck = (<class 'FileNotFoundError'>)
  PlatformIDsKeyError = <class 'platformids.PlatformIDsKeyError'>
  PlatformIDsPresentError = <class 'platformids.PlatformIDsPrese...
  PlatformIDsUnknownError = <class 'platformids.PlatformIDsUnkno...
  ProtectedDict = <class 'platformids.ProtectedDict'>
  ProtectedDictEnum = <class 'platformids.ProtectedDictEnum'>
  RTE = 276917248
  RTE_ARCHLINUX = 281149440
  RTE_BSD = 285212672
  RTE_CATEGORY = 4026531840
  RTE_CATEGORY_B = 4026531840
  RTE_CATEGORY_OFFSET = 268435455
  RTE_CATEGORY_SHIFT = 28
  RTE_CENTOS = 276955136
  RTE_CYGWINNT = 1887436800
  RTE_DARWIN = 301989888
  RTE_DEBIAN = 277020672
  RTE_DIST = 4294901760
  RTE_DISTEXT = 4194304
  RTE_DISTREL = 4294967295
  RTE_DISTREL_B = 65535
  RTE_DISTREL_OFFSET = 0
  RTE_DISTREL_SHIFT = 0
  RTE_DIST_B = 8323072
  RTE_DIST_OFFSET = 65535
  RTE_DIST_SHIFT = 16
  RTE_EMBEDDED = 2147483648
  RTE_EMU = 1073741824
  RTE_FEDORA = 276889600
  RTE_GENERIC = 0
  RTE_KALI = 281083904
  RTE_LINUX = 276824064
  RTE_LOCAL = 1
  RTE_NT = 545259520
  RTE_OPENBSD = 285343744
  RTE_OPENWRT = 277282816
  RTE_OSTYPE = 4286578688
  RTE_OSTYPE_B = 260046848
  RTE_OSTYPE_OFFSET = 8388607
  RTE_OSTYPE_SHIFT = 23
  RTE_OSX = 302120960
  RTE_OSX10 = 302120960
  RTE_POSIX = 268435456
  RTE_PWEMU = 1879048192
  RTE_RASPBIAN = 277348352
  RTE_RHEL = 277086208
  RTE_SLES = 277151744
  RTE_SOLARIS = 335675392
  RTE_SUNOS5 = 335675392
  RTE_UBUNTU = 277217280
  RTE_UNIX = 335544320
  RTE_WIN = 536870912
  RTE_WIN32 = 536870912
  RTE_WINDOWS = 536870912
  RTE_WPEMU = 1342177280
  VERSION_ID = re.compile('(?s)^VERSION_ID=["\']*([^"\']*)["\']*...
  VERSNUM = re.compile('([0-9]+)[.]*([0-9]*)[.]*([0-9]*)')
  __cached__ = 'b'/local/hd1/home1/data/acue/rd/p-open-deploy/pl...
  __loader__ = <_frozen_importlib_external.SourceFileLoader obje...
  __package__ = 'b'platformids''
  __spec__ = ModuleSpec(name='platformids', loader=<_frozen_impo...
  __uuid__ = 'b'7add5ded-c39b-4b6e-8c87-1b3a1c150ee9''
  __warningregistry__ = {'b'version'': 0}
  category = 268435456
  custom_category = {}
  custom_dist = {}
  custom_ostype = {}
  custom_rte_distrel2tuple = {281214976: <function my_distrel2tu...
  isJython = False
  modfpath = 'b'/local/hd1/home1/data/acue/rd/p-open-deploy/plat...
  modnamerel = 'b'platformids.dist.fedora''
  num2enumstr = {285212672: 'RTE_BSD', 276955136: 'RTE_CENTOS', ...
  num2pretty = {281149440: 'Arch Linux', 285212672: 'Berkeley So...
  num2rte = {281149440: 'archlinux', 285212672: 'bsd', 276955136...
  osname = 'b'posix''
  rte2num = {'bsd': 285212672, 'darwin': 301989888, 'emu': 10737...
Function Details

decode_rte_category_to_num(rte=276917248)

source code 

Decodes the compressed category from the 32bit integer bitmask into the corresponding integer enum.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:
Integer value of the category enum.
Raises:
pass-through

decode_rte_dist_to_num(rte=276917248)

source code 

Decodes the compressed dist from the 32bit integer bitmask into the corresponding integer enum. Recognizes the ostype domain e.g. for RTE_NT.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:
Integer value of the dist enum.
Raises:
pass-through

decode_rte_distrel_to_num(rte=276917248)

source code 

Decodes the compressed distrel from the 32bit integer bitmask into the corresponding integer enum. Recognizes the ostype and dist domain, the distrel extension flag.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:
Integer value of the encoded distrel.
Raises:
pass-through

decode_rte_distrel_to_segments(rte=276917248)

source code 

Decodes the compressed distrel from the 32bit integer bitmask into the corresponding tuple of integer segments.

This is probably one of the most important functions, because it has the knowledge to split distrel including calling a custom-callback function when required. Recognizes the ostype and dist domain, the distrel extension flag in order to determine the further processing. The supported special cases of known and pre-loaded standard distributions are hardcoded for better performance here, currently these are:

ArchLinux, KaliLinux
Windows-NT

BlackArch, Gentoo,
Armbian, ArchLinux, BlackArch, Gentoo, KaliLinux
Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:
Tuple of Integer values of the encoded segments, either as defined by the default layout, or any known as defined by additional extended and/or custom criteria.
Raises:
pass-through

decode_rte_ostype_to_num(rte=276917248)

source code 

Decodes the compressed ostype from the 32bit integer bitmask into the corresponding integer enum.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:
Integer value of the ostype enum.
Raises:
pass-through

decode_rte_to_segments(rte=276917248)

source code 

Decodes the compressed components from the 32bit integer bitmask into the corresponding segments of relative integer values.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:

Tuple of integer values of the components.

ret := =>  (#category-bits, #ostype-bits, #dist-bits, #distrel-bits)

Where the following os true:

rte == #category-bits << 28 | #ostype-bits << 23 | #dist-bits << 16 | #distrel-bits
rte == encode_rte_segments_to_32bit(#category-bits, #ostype-bits, #dist-bits, #distrel-bits)
rte == encode_rte_segments_to_32bit( *decode_rte_to_segments( rte ) )
Raises:
pass-through

decode_rte_to_tuple(rte=276917248)

source code 

Decodes the compressed components from the 32bit integer bitmask into the corresponding tuple of partial integer enums.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:

Tuple of integer values of the components.

ret := =>  (#category-num, #ostype-num, #dist-num, #distrel-num)

Where the following os true:

ret == #category-num | #ostype-num | #dist-num | #distrel-num
ret == #category-num + #ostype-num + #dist-num + #distrel-num
Raises:
pass-through

decode_rte_to_tuple_str(rte=276917248)

source code 

Decodes the compressed components from the 32bit integer bitmask into the corresponding tuple of string keywords.

Args:
rte:

The comppressed runtime environment identifier bitmask.

default := RTE

Returns:

Tuple of keywords of string values for the components.

ret := =>  (<category>, <ostype>, <dist>, <distrel>)
Raises:
pass-through

decode_version_str_to_segments(v)

source code 

Split a version string separated by '.' into an integer array.

decode_version_str_to_segments('1.22.17')     =>  (1, 22, 17)
decode_version_str_to_segments('2012.02.17')  =>  (2012, 2, 17)
decode_version_str_to_segments('10.0.1809')   =>  (10, 0, 1809)

A tiny utility - frequently required.

Args:

v: Version string with maximal 3 digits:

('1.2.3')  =>  (1, 2, 3)
('1.2')    =>  (1, 2, 0)
('1')      =>  (1, 0, 0)
Returns:

Tuple of int.

('1.2.3')  =>  (1, 2, 3)
('1.2')    =>  (1, 2, 0)
('1')      =>  (1, 0, 0)

In case an error occured:

(0, 0, 0)
Raises:
None.

encode_rte_segments_to_32bit(**kargs)

source code 

Converts the numeric base values of the fields into a 32bit bitmask and encodes them into the combined integer value of the bitmask vector.

Args:
kargs:
category:

The non-shifted base value of the category:

category := (
     <int-val>
)
int-val:     the relative integer value of the category bits

default is 0

ostype:

The non-shifted base value of the ostype:

ostype := (
     <int-val>
)
int-val:     the relative integer value of the ostype bits

default is 0.

dist:

The non-shifted base value of the dist:

dist := (
     <int-val>
)
int-val:     the relative integer value of the dist bits

default is 0.

distrel:
The non-shifted encoded base value of the distrel, default is 0.
Returns:
The 32bit compressed bitmask of the RTE.
Raises:
pass-through

encode_rte_to_32bit(**kargs)

source code 

Encodes the provided 32bit bitmask of each field into the combined integer value of the bitmask vector.

Args:
kargs:
category:

The numeric 32bit bitmask of the category:

   category := (
        <int-enum>
      | <category-key>
   )
   int-enum:     the integer enum, preferbly a predefined value-by-var
   category-key: the key value as string to be evaluated by one

of::

   *rte2num*:      the common mapping dictionary
   *get_rte2num*:  the function interface for *rte2num*

default is 0

ostype:

The numeric 32bit bitmask of the ostype:

ostype := (
     <int-enum>
   | <ostype-key>
)
int-enum:     the integer enum, preferbly a predefined value-by-var
ostype-key:   the key value as string to be evaluated by one

of:

*rte2num*:      the common mapping dictionary
*get_rte2num*:  the function interface for *rte2num*

default is 0.

dist:

The numeric 32bit bitmask of the dist:

ostype := (
     <int-enum>
   | <dist-key>
)
int-enum:     the integer enum, preferbly a predefined value-by-var
dist-key:     the key value as string to be evaluated by one

of:

*rte2num*:      the common mapping dictionary
*get_rte2num*:  the function interface for *rte2num*

default is 0.

distrel:
The numeric 32bit encoded integer for the distrel, default is 0.
Returns:
The 32bit compressed bitmask of the RTE.
Raises:
pass-through

fetch_category()

source code 

Scans the platform and returns the numeric id for the current category.

Args:
none
Returns:

Returns the category.

res = <category-bits><ostype-bits-zero><dist-bits-zero><distrel-bits-zero>
Raises:
PlatformIDsError

fetch_dist()

source code 

Scans the platform and returns the numeric id for the current dist.

Args:
none
Returns:

Returns the dist as integer enum. The bitmask includes the category and ostype.

res = <category-bits><ostype-bits><dist-bits><distrel-bits-zero>
Raises:
PlatformIDsError

fetch_dist_tuple()

source code 

Scans the platform and returns the complete tuple for the current dist.

Args:
none
Returns:

Returns the complete tuple of information related to a distribution.

res = (<distid-string>, <distrel-string>, <distrel-tuple>, <ditst-rel-key-string>)
Raises:
PlatformIDsError

fetch_ostype()

source code 

Scans the platform and returns the numeric id for the current ostype.

Args:
none
Returns:

Returns the ostype as integer enum. The bitmask includes the category.

res = <category-bits><ostype-bits><dist-bits-zero><distrel-bits-zero>
Raises:
PlatformIDsError

fetch_platform_distribution()

source code 

Scans the platform and returns the complete distribution data prepared for common post-processing.

Args:
none
Returns:

Returns the information about the current distribution.

result := (
   <lowercase-dist-id>,                 # 0: lower case str including release number
   <dist-release-number-str>,           # 1: the release number as string
   <original-literal-release-name>,     # 2: case sensitive release name
   <original-literal-dist-name>,        # 3: case sensitive distribution name
   <dist-release-number-list>,          # 4: release version as list of int
   <lowercase-dist->,                   # 5: lower case str of dist name only
)
Raises:
PlatformIDsError

fetch_platform_distribution_num()

source code 

The numeric version of 'fetch_platform_distribution'.

Args:
none
Returns:

Returns the information about the current distribution.

result := (
   #dist,                              # 0: distribution identifier
   #distrel,                           # 1: distribution release identifier
   #dist-release-number-list>,         # 2: release version as list of int
)
Raises:
PlatformIDsError

fetch_platform_os()

source code 

Scans the platform and returns the information on the OS including the name and the release version.

The name of the OS is commonly basically the kernel name. The ostype of linux has one common kernel only, while OS in the bsd and unix family commonly have distribution specific customized kernels.

Args:
none
Returns:

Returns the information about the current os.

res = (
   <lowercase-os-id>,            # osname: lower case str of os name
   <os-release-number-str>,      # osrel: string of os release version
   <os-release-number-list>,     # osrel: list of int of os release version
   <lowercase-os-rel-id>,        # osname+osrel: lower case str rel + id
)
Raises:
PlatformIDsError

fetch_platform_os_num()

source code 

The numeric version of 'fetch_platform_os'.

Args:
none
Returns:

Returns the information about the current os.

res = (
   <enum-os-id>,                 # osname: lower case str of os name
   <32bit-os-release-number>,    # osrel: string of os release version
   <os-release-number-list>,     # osrel: list of int of os release version
   <enum-os-rel-id>,             # osname+osrel: lower case str rel + id
)
Raises:
PlatformIDsError

fetch_rte_hexversion()

source code 

Retrieves the bitmask encoding for current runtime environemnt.

Args:
None.
Returns:
The encoded bitmask to be used for caching and RTE.
Raises:
pass-through

get_modlocation(mname, mbase=None, mpaths=None, **kargs)

source code 

Calls the pythonids.get_modulelocation function with specific default parameters for the platformids.

Args:
mbase:

Base for module search paths by default within the subdirectory of platformids. The filepath name with a trailing separator.

default := os.path.dirname(__file__) + os.sep

The base path is used within the post-processing of the eventually matched path, thus has to be appropriate for each item of mpaths.

mname:

The relative path of the module in dotted Python notation.

mname := (
     <dotted-module-name-str>
   | <dotted-module-name-path-name-str>
)
mpaths:

List of module specific search paths for platformids, these are relative to mbase,

default := [
   'dist',
   'custom',
   'net',
   'embed',
   '',
]

resulting in:

default := [
   mbase + 'dist' + os.sep,
   mbase + 'custom' + os.sep,
   mbase + 'net' + os.sep,
   mbase + 'embed' + os.sep,
   mbase,
]
kargs:
permitrel:

Permit the return of relative module names within mpath. If False absolute only, which is relative to an existing sys.path entry.

permitrel := (
   True,       # returns a relative module name if within subtree
   False       # returns in any case a module name relative to sys.path
)

Sets relative base within platformids as the default:

rbase = os.path.normpath(os.path.dirname(__file__)) + os.sep
Returns:

Returns in case of a match the resulting entry within sys.modules:

match -> (<relative-module-name>, <module-file-path-name>,)

The default when no match occured is to rely on the more versatile search mechanism of the import implementation of the concrete Python implementation for another final trial by the caller:

default -> (<mname>, None,)
Raises:
PlatformIDsError
'mbase' does not match 'mpaths'
PlatformIDsPresentError
missing 'mbase'

pass-through

get_num2rte(num)

source code 

Gets the corresponding string representation for the string numeric value.

Alternatively the official dict num2rte could be used.

Args:
num:
Numeric enum value of the requested platform.
Returns:
The string value, or None*.
Raises:
None

get_rte2num(rte)

source code 

Gets corresponding numerical representation for the numeric or string value.

Alternatively the official dict rte2num could be used.

Args:
rte:
Numeric enum value or string representation of the requested platform.
Returns:
The numeric value, or None*.
Raises:
None

set_num2rte(key, value)

source code 

Sets the numeric to string map.

Alternatively the official dict num2rte could be used.

Args:
key:
Numeric key value.
value:
String value.
Returns:
None
Raises:
PlatformIDsError

set_rte2num(key, value)

source code 

Sets the rte to numeric mapping

Alternatively the official dict rte2num could be used.

Args:
key:
Numeric or string key value.
value:
Numeric value.
Returns:
None
Raises:
None

Variables Details

DSKORG_ID

Value:
re.compile('^(?s)ID=["\']*([^"\'\n\r]*).*', re.DOTALL)

DSKORG_ID_LIKE

Value:
re.compile('^(?s)ID_LIKE=["\']*([^"\'\n\r]*).*', re.DOTALL)

DSKORG_NAME_RELEASE

Value:
re.compile('(?s)^NAME=["\']*([^ ]*) *([^"\']*).*', re.DOTALL)

DSKORG_RELEASE

Value:
re.compile('(?s)^VERSION=["\']*([^"\']*)["\']*[^(]*[(]*([^)]*)[)]*.*',\
 re.DOTALL)

DSKORG_VERSION

Value:
re.compile('(?s)^VERSION=["\']*([^"\']*)["\']*.*', re.DOTALL)

PlatformIDsCustomError

Value:
<class 'platformids.PlatformIDsCustomError'>

PlatformIDsEnumerationError

Value:
<class 'platformids.PlatformIDsEnumerationError'>

PlatformIDsPresentError

Value:
<class 'platformids.PlatformIDsPresentError'>

PlatformIDsUnknownError

Value:
<class 'platformids.PlatformIDsUnknownError'>

VERSION_ID

Value:
re.compile('(?s)^VERSION_ID=["\']*([^"\']*)["\']*.*', re.DOTALL)

__cached__

Value:
'b'/local/hd1/home1/data/acue/rd/p-open-deploy/platformids/repos/sourc\
eforge.net/pyplatformids/platformids/__pycache__/__init__.cpython-38.p\
yc''

__loader__

Value:
<_frozen_importlib_external.SourceFileLoader object at 0x7f3211bf4d00>

__spec__

Value:
ModuleSpec(name='platformids', loader=<_frozen_importlib_external.Sour\
ceFileLoader object at 0x7f3211bf4d00>, origin='/local/hd1/home1/data/\
acue/rd/p-open-deploy/platformids/repos/sourceforge.net/pyplatformids/\
platformids/__init__.py', submodule_search_locations=['/local/hd1/home\
1/data/acue/rd/p-open-deploy/platformids/repos/sourceforge.net/pyplatf\
ormids/platformids'])

custom_rte_distrel2tuple

Value:
{281214976: <function my_distrel2tuple at 0x7f320ce2a340>}

modfpath

Value:
'b'/local/hd1/home1/data/acue/rd/p-open-deploy/platformids/repos/sourc\
eforge.net/pyplatformids/platformids/dist/fedora.py''

num2enumstr

Value:
{285212672: 'RTE_BSD', 276955136: 'RTE_CENTOS', 301989888: 'RTE_DARWIN\
', 277020672: 'RTE_DEBIAN', 276889600: 'RTE_FEDORA', 276824064: 'RTE_L\
INUX', 545259520: 'RTE_NT', 285343744: 'RTE_OPENBSD', 302120960: 'RTE_\
OSX', 268435456: 'RTE_POSIX', 1879048192: 'RTE_PWEMU', 277348352: 'RTE\
_RASPBIAN', 277217280: 'RTE_UBUNTU', 536870912: 'RTE_WINDOWS', 2769602\
56: 'RTE_CENTOS5', 276961280: 'RTE_CENTOS6', 276962304: 'RTE_CENTOS7',\
 276963328: 'RTE_CENTOS8', 276964352: 'RTE_CENTOS9', 285347840: 'RTE_O\
PENBSD4', 285348864: 'RTE_OPENBSD5', 285349888: 'RTE_OPENBSD6', 285349\
...

num2pretty

Value:
{281149440: 'Arch Linux', 285212672: 'Berkeley Software Distribution',\
 276955136: 'CentOS', 301989888: 'Darwin', 277020672: 'Debian', 276889\
600: 'Fedora', 276824064: 'Linux', 545259520: 'NT', 285343744: 'OpenBS\
D', 1342177280: 'Windows-Emulation', 268435456: 'POSIX', 1879048192: '\
POSIX-Windows-Emulation', 277348352: 'Raspbian', 277086208: 'RHEL', 33\
5544320: 'Unix', 536870912: 'Windows', 276909056: "Schroedinger's Cat"\
, 276910080: 'Heisenbug', 276917248: 'Fedora27', 276918272: 'Fedora28'\
, 276919296: 'Fedora29', 276920320: 'Fedora30', 276921856: 'Fedora31',\
...

num2rte

Value:
{281149440: 'archlinux', 285212672: 'bsd', 276955136: 'centos', 301989\
888: 'darwin', 277020672: 'debian', 1073741824: 'emu', 276889600: 'fed\
ora', 276824064: 'linux', 545259520: 'nt', 285343744: 'openbsd', 27728\
2816: 'openwrt', 302120960: 'osx10', 1342177280: 'wpemu', 268435456: '\
posix', 1879048192: 'pwemu', 277348352: 'raspbian', 277086208: 'rhel',\
 335675392: 'solaris', 335544320: 'unix', 536870912: 'windows', 276909\
056: 'fedora19', 276910080: 'fedora20', 276917248: 'fedora27', 2769182\
72: 'fedora28', 276919296: 'fedora29', 276920320: 'fedora30', 27692185\
...

rte2num

Value:
{'bsd': 285212672, 'darwin': 301989888, 'emu': 1073741824, 'linux': 27\
6824064, 'linux2': 276824064, 'nt': 545259520, 'wpemu': 1342177280, 'p\
osix': 268435456, 'pwemu': 1879048192, 'unix': 335544320, 'win': 53687\
0912, 'win32': 536870912, 'windows': 536870912, 285212672: 285212672, \
301989888: 301989888, 1073741824: 1073741824, 276824064: 276824064, 54\
5259520: 545259520, 1342177280: 1342177280, 268435456: 268435456, 1879\
048192: 1879048192, 536870912: 536870912, 'SunOS5': 335675392, 'arch':\
 281149440, 'archlinux': 281149440, 'centos': 276955136, 'debian': 277\
...