gliberapay

Types

pub type Date {
  Date(year: Int, month: Int, day: Int)
}

Constructors

  • Date(year: Int, month: Int, day: Int)
pub type Error {
  InvalidCsvSyntax(String)
  MissingCsvHeaderRow
  MissingCsvHeaders(missing: List(String))
  InvalidValue(detail: String)
}

Constructors

  • InvalidCsvSyntax(String)
  • MissingCsvHeaderRow
  • MissingCsvHeaders(missing: List(String))
  • InvalidValue(detail: String)
pub type Patron {
  Patron(
    pledge_date: Date,
    patron_id: Int,
    patron_username: String,
    patron_public_name: Option(String),
    donation_currency: String,
    weekly_amount: Option(Float),
    patron_avatar_url: String,
  )
}

Constructors

  • Patron(
      pledge_date: Date,
      patron_id: Int,
      patron_username: String,
      patron_public_name: Option(String),
      donation_currency: String,
      weekly_amount: Option(Float),
      patron_avatar_url: String,
    )

    Arguments

    • patron_public_name

      The name the patron has chosen to display publicly.

      If the patron has not set a public name then this will be None and you may want to use patron_username instead.

    • weekly_amount

      The amount the patron has pledged to donate per week.

      If the patron has set their amount to be private then this will be None.

Functions

pub fn download_patrons_csv_request(
  recipient recipient: String,
) -> Request(String)

Construct a HTTP request to download the public Liberapay patrons CSV for the given recipient.

Once you have a response for the request you can parse the body with the parse_patrons_csv function.

pub fn parse_patrons_csv(
  csv: String,
) -> Result(List(Patron), Error)

Parse a Liberapay patrons CSV, as can be downloaded from the Liberapay, e.g. https://liberapay.com/gleam/patrons/public.csv

If you want to download this in Gleam see the download_patrons_csv function.

Search Document