betty.privatizer module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.privatizer module

Provide an API to determine if information should be kept private.

class betty.privatizer.Privatizer

  Bases: `object`

  Privatize resources.

  Parameters:

    - lifetime_threshold (`int`)

    - localizer (`betty.locale.Localizer`)

  __init__(lifetime_threshold: int, *, localizer: betty.locale.Localizer)
    Parameters:

      - lifetime_threshold (`int`)

      - localizer (`betty.locale.Localizer`)

  has_expired(subject: betty.model.ancestry.Person | betty.model.ancestry.Event | betty.locale.Date | None, generations_ago: int = 0) → bool

    Check if a subject of the given generation has expired.

    Parameters:

      - subject (`betty.model.ancestry.Person` | `betty.model.ancestry.Event` | `betty.locale.Date` | `None`)

      - generations_ago (`int`)

    Return type:

      `bool`

  privatize(subject: betty.model.ancestry.HasPrivacy) → None

    Privatize a resource.

    Parameters:

      subject (`betty.model.ancestry.HasPrivacy`)

    Return type:

      `None`