Skip to content

algokit_utils.application_specification

Classes

ApplicationSpecificationARC-0032 application specification
CallConfigDescribes the type of calls a method can be used for based on algosdk.transaction.OnComplete type
DefaultArgumentDictDefaultArgument is a container for any arguments that may
be resolved prior to calling some target method
MethodHintsMethodHints provides hints to the caller about how to call the method
StructArgDictdict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
d = {}
for k, v in iterable:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)

Data

AppSpecStateDictType defining Application Specification state entries
DefaultArgumentTypeLiteral values describing the types of default argument sources
MethodConfigDictDictionary of dict[OnCompletionActionName, CallConfig] representing allowed actions for each on completion type
OnCompleteActionNameString literals representing on completion transaction types

API

algokit_utils.application_specification.AppSpecStateDict

AppSpecStateDict : TypeAlias

None

Type defining Application Specification state entries

class algokit_utils.application_specification.ApplicationSpecification

ApplicationSpecification

ARC-0032 application specification

See https://github.com/algorandfoundation/ARCs/pull/150

export

export(directory: pathlib.Path | str | None = None) → None

write out the artifacts generated by the application to disk

Args: directory(optional): path to the directory where the artifacts should be written

class algokit_utils.application_specification.CallConfig

CallConfig

Describes the type of calls a method can be used for based on algosdk.transaction.OnComplete type

Initialization

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

ALL

ALL

3

Handle the specified on completion type for both create and normal application calls

CALL

CALL

1

Only handle the specified on completion type for application calls

CREATE

CREATE

2

Only handle the specified on completion type for application create calls

NEVER

NEVER

0

Never handle the specified on completion type

__abs__

abs()

abs(self)

__add__

add()

Return self+value.

__and__

and()

Return self&value.

__bool__

bool()

True if self else False

__ceil__

ceil()

Ceiling of an Integral returns itself.

__contains__

contains(other)

Returns True if self has at least the same flags set as other.

__delattr__

delattr()

Implement delattr(self, name).

__dir__

dir()

Default dir() implementation.

__divmod__

divmod()

Return divmod(self, value).

__eq__

eq()

Return self==value.

__float__

float()

float(self)

__floor__

floor()

Flooring an Integral returns itself.

__floordiv__

floordiv()

Return self//value.

__format__

format()

Convert to a string according to format_spec.

__ge__

ge()

Return self>=value.

__getattribute__

getattribute()

Return getattr(self, name).

__getstate__

getstate()

Helper for pickle.

__gt__

gt()

Return self>value.

__hash__

hash()

Return hash(self).

__index__

index()

Return self converted to an integer, if self is suitable for use as an index into a list.

__int__

int()

int(self)

__invert__

invert()

~self

__iter__

iter()

Returns flags in definition order.

__le__

le()

Return self<=value.

__lshift__

lshift()

Return self<<value.

__lt__

lt()

Return self<value.

__mod__

mod()

Return self%value.

__mul__

mul()

Return self*value.

__ne__

ne()

Return self!=value.

__neg__

neg()

-self

__new__

new()

Create and return a new object. See help(type) for accurate signature.

__or__

or()

Return self|value.

__pos__

pos()

+self

__pow__

pow()

Return pow(self, value, mod).

__radd__

radd()

Return value+self.

__rand__

rand()

Return value&self.

__rdivmod__

rdivmod()

Return divmod(value, self).

__reduce__

reduce()

Helper for pickle.

__reduce_ex__

reduce_ex()

Helper for pickle.

__repr__

repr()

Return repr(self).

__rfloordiv__

rfloordiv()

Return value//self.

__rlshift__

rlshift()

Return value<<self.

__rmod__

rmod()

Return value%self.

__rmul__

rmul()

Return value*self.

__ror__

ror()

Return value|self.

__round__

round()

Rounding an Integral returns itself.

Rounding with an ndigits argument also returns an integer.

__rpow__

rpow()

Return pow(value, self, mod).

__rrshift__

rrshift()

Return value>>self.

__rshift__

rshift()

Return self>>value.

__rsub__

rsub()

Return value-self.

__rtruediv__

rtruediv()

Return value/self.

__rxor__

rxor()

Return value^self.

__setattr__

setattr()

Implement setattr(self, name, value).

__sizeof__

sizeof()

Returns size in memory, in bytes.

__str__

str()

Return str(self).

__sub__

sub()

Return self-value.

__truediv__

truediv()

Return self/value.

__trunc__

trunc()

Truncating an Integral returns itself.

__xor__

xor()

Return self^value.

as_integer_ratio

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

The ratio is in lowest terms and has a positive denominator.

(10).as_integer_ratio() (10, 1) (-10).as_integer_ratio() (-10, 1) (0).as_integer_ratio() (0, 1)

bit_count

bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

bin(13) ‘0b1101’ (13).bit_count() 3

bit_length

bit_length()

Number of bits necessary to represent self in binary.

bin(37) ‘0b100101’ (37).bit_length() 6

conjugate

conjugate()

Returns self, the complex conjugate of any int.

class denominator

denominator

the denominator of a rational number in lowest terms

class imag

imag

the imaginary part of a complex number

is_integer

is_integer()

Returns True. Exists for duck type compatibility with float.is_integer.

name

name()

The name of the Enum member.

class numerator

numerator

the numerator of a rational number in lowest terms

class real

real

the real part of a complex number

to_bytes

to_bytes()

Return an array of bytes representing an integer.

length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1. byteorder The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’. signed Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

value

value()

The value of the Enum member.

class algokit_utils.application_specification.DefaultArgumentDict

DefaultArgumentDict

DefaultArgument is a container for any arguments that may be resolved prior to calling some target method

Initialization

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

__contains__

contains()

True if the dictionary has the specified key, else False.

__delattr__

delattr()

Implement delattr(self, name).

__delitem__

delitem()

Delete self[key].

__dir__

dir()

Default dir() implementation.

__eq__

eq()

Return self==value.

__format__

format()

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__

ge()

Return self>=value.

__getattribute__

getattribute()

Return getattr(self, name).

__getitem__

getitem()

Return self[key].

__getstate__

getstate()

Helper for pickle.

__gt__

gt()

Return self>value.

__ior__

ior()

Return self|=value.

__iter__

iter()

Implement iter(self).

__le__

le()

Return self<=value.

__len__

len()

Return len(self).

__lt__

lt()

Return self<value.

__ne__

ne()

Return self!=value.

__new__

new()

Create and return a new object. See help(type) for accurate signature.

__or__

or()

Return self|value.

__reduce__

reduce()

Helper for pickle.

__reduce_ex__

reduce_ex()

Helper for pickle.

__repr__

repr()

Return repr(self).

__reversed__

reversed()

Return a reverse iterator over the dict keys.

__ror__

ror()

Return value|self.

__setattr__

setattr()

Implement setattr(self, name, value).

__setitem__

setitem()

Set self[key] to value.

__sizeof__

sizeof()

D.sizeof() -> size of D in memory, in bytes

__str__

str()

Return str(self).

clear

clear()

D.clear() -> None. Remove all items from D.

copy

copy()

D.copy() -> a shallow copy of D

get

get()

Return the value for key if key is in the dictionary, else default.

items

items()

D.items() -> a set-like object providing a view on D’s items

keys

keys()

D.keys() -> a set-like object providing a view on D’s keys

pop

pop()

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update

update()

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values

values()

D.values() -> an object providing a view on D’s values

algokit_utils.application_specification.DefaultArgumentType

DefaultArgumentType : TypeAlias

None

Literal values describing the types of default argument sources

algokit_utils.application_specification.MethodConfigDict

MethodConfigDict : TypeAlias

None

Dictionary of dict[OnCompletionActionName, CallConfig] representing allowed actions for each on completion type

class algokit_utils.application_specification.MethodHints

MethodHints

MethodHints provides hints to the caller about how to call the method

algokit_utils.application_specification.OnCompleteActionName

OnCompleteActionName : TypeAlias

None

String literals representing on completion transaction types

class algokit_utils.application_specification.StructArgDict

StructArgDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Initialization

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

__contains__

contains()

True if the dictionary has the specified key, else False.

__delattr__

delattr()

Implement delattr(self, name).

__delitem__

delitem()

Delete self[key].

__dir__

dir()

Default dir() implementation.

__eq__

eq()

Return self==value.

__format__

format()

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__

ge()

Return self>=value.

__getattribute__

getattribute()

Return getattr(self, name).

__getitem__

getitem()

Return self[key].

__getstate__

getstate()

Helper for pickle.

__gt__

gt()

Return self>value.

__ior__

ior()

Return self|=value.

__iter__

iter()

Implement iter(self).

__le__

le()

Return self<=value.

__len__

len()

Return len(self).

__lt__

lt()

Return self<value.

__ne__

ne()

Return self!=value.

__new__

new()

Create and return a new object. See help(type) for accurate signature.

__or__

or()

Return self|value.

__reduce__

reduce()

Helper for pickle.

__reduce_ex__

reduce_ex()

Helper for pickle.

__repr__

repr()

Return repr(self).

__reversed__

reversed()

Return a reverse iterator over the dict keys.

__ror__

ror()

Return value|self.

__setattr__

setattr()

Implement setattr(self, name, value).

__setitem__

setitem()

Set self[key] to value.

__sizeof__

sizeof()

D.sizeof() -> size of D in memory, in bytes

__str__

str()

Return str(self).

clear

clear()

D.clear() -> None. Remove all items from D.

copy

copy()

D.copy() -> a shallow copy of D

get

get()

Return the value for key if key is in the dictionary, else default.

items

items()

D.items() -> a set-like object providing a view on D’s items

keys

keys()

D.keys() -> a set-like object providing a view on D’s keys

pop

pop()

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update

update()

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values

values()

D.values() -> an object providing a view on D’s values