tyrannosaurus.enums

Supporting enums.

Original source: https://github.com/dmyersturnbull/tyrannosaurus Copyright 2020–2021 Douglas Myers-Turnbull Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0

Module Contents

class tyrannosaurus.enums.DevStatus

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

Initialize self. See help(type(self)) for accurate signature.

alpha = alpha
beta = beta
inactive = inactive
mature = mature
planning = planning
pre_alpha = pre-alpha
production = production
property description str

A fragment like “a production state” or “an alpha state”

property dunder str

A string that works for __status__

classmethod guess_from_version(version: str) DevStatus

Makes a really rough guess for the status from a semantic version string:

- Guesses planning for 0.0.x (these are not semantic versions).
- Guesses alpha for pre-1.0
- Guesses production for 1.0+
Parameters

version – A semantic version like “0.1.x”; can also start with 0.0.

property pypi str

A string that is recognized as a PyPi classifier.

property true_name str

A nice name, like “pre-alpha”.

property true_value int

1 for planning, 2 for pre-alpha, … . Same as for PyPi classifiers.

class tyrannosaurus.enums.License

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

Initialize self. See help(type(self)) for accurate signature.

agpl3 = agpl3
apache2 = apache2
cc0 = cc0
ccby = ccby
ccbync = ccbync
gpl3 = gpl3
lgpl3 = lgpl3
mit = mit
mpl2 = mpl2
_read_url(url: str) str
download_header() str
download_license() str
property family str
property full_name str
property header_url str
property license_url str
classmethod of(value: Union[str, License]) License
property spdx str
property url str
class tyrannosaurus.enums.Toml(x: Mapping[str, Any])

A thin wrapper around toml to make getting values easier.

__contains__(items)
__eq__(other)

Return self==value.

__getitem__(items: str)
__repr__()

Return repr(self).

__str__()

Return str(self).

get(items: str, default: Any = None) Optional[Any]
items()
keys()
classmethod read(path: Union[pathlib.PurePath, str]) Toml
class tyrannosaurus.enums.TomlBuilder
add(key: str, value: Any)
build() Toml