team

Teams on Gratipay receive payments and distribute payouts.

gratipay.models.team.slugize(name)[source]

Create a slug from a team name.

class gratipay.models.team.Team(record)[source]

Represent a Gratipay team.

receiving = 0

The total amount of money this team receives during payday. Read-only; modified by set_payment_instruction().

nreceiving_from = 0

The number of participants that are giving to this team. Read-only; modified by set_payment_instruction().

url_path

The path part of the URL for this team on Gratipay.

classmethod from_id(id)[source]

Return an existing team based on id.

classmethod from_slug(slug)[source]

Return an existing team based on slug.

get_payment_distribution()[source]

Returns a data structure in the form of:

[
    [PAYMENT1, PAYMENT2...PAYMENTN],
    nreceiving_from,
    total_amount_received
]

where each PAYMENTN is in the form:

[
    amount,
    number_of_tippers_for_this_amount,
    total_amount_given_at_this_amount,
    proportion_of_payments_at_this_amount,
    proportion_of_total_amount_at_this_amount
]
get_payment_instructions()[source]

Returns the incoming payment instructions for this team.

Since giving is anonymous on Gratipay, this is only to be used internally by other routines, or for exposing values to admins.

gratipay.models.team.cast(path_part, state)[source]

This is an Aspen typecaster. Given a slug and a state dict, raise Response or return Team.