Skip to content

Space

Space's Model

Categorize and manage money.

Attributes:

Name Type Description
name

Name of the space.

uuid

Unique identifier of the space.

description

Description of the space.

exchange_account

Exchange account of the space.

created_at

Date of creation of the space.

Examples:

Create a space:

import django_napse.core.models import NapseSpace, ExchangeAccount

exchange_account: ExchangeAccount = ...
space = NapseSpace.objects.create(
    name="Space",
    description="Space description",
    exchange_account=exchange_account,
)

testing property

testing: bool

Testing property.

value property

value: float

Value market of space's wallet.

fleets property

fleets: django.db.models.QuerySet

Fleets of the space.

bots property

bots: django.db.models.QuerySet

Bots of the space.

info

info(verbose: bool = True, beacon: str = '') -> str

Info documentation.

Parameters:

Name Type Description Default
verbose bool

Print to console.

True
beacon str

Indentation for printing.

''

get_stats

get_stats() -> dict[str, int | float | str]

Statistics of space.

delete

delete() -> None

Delete space.

invest

invest(amount: float, ticker: str)

Invest in space.

withdraw

withdraw(amount: float, ticker: str)

Withdraw from space.


Space's manager

create

create(name: str, exchange_account, description: str = '')

Create a Space instance.