insights

package
v1.261125.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrencyLabel

func CurrencyLabel(currency string) string

CurrencyLabel names a currency code for people, including the empty code.

func CurrencyTotalsUnavailableReason

func CurrencyTotalsUnavailableReason(metricLabel string, comparisons []CurrencyComparison) string

CurrencyTotalsUnavailableReason explains why a monetary metric has no single total.

func EnrichSalesScopeFromRows added in v1.260325.0

func EnrichSalesScopeFromRows(scope salesScope, rows [][]string, appleIdentifierIdx, skuIdx int) salesScope

EnrichSalesScopeFromRows resolves the app SKU from report data when it is not already set on scope.

func NewInsightsCommand

func NewInsightsCommand(d *shared.Deps) *ffcli.Command

NewInsightsCommand returns the insights command group built on d.

func ParseSalesReportMetrics added in v1.260325.0

func ParseSalesReportMetrics(reader io.Reader, scope salesScope, byCurrency bool) (salesWeekMetrics, error)

ParseSalesReportMetrics reads a gzip-compressed sales TSV from reader and returns aggregated metrics scoped to the given app.

func RowMatchesSalesScope added in v1.260325.0

func RowMatchesSalesScope(scope salesScope, appleIdentifier, parentIdentifier string) (isAppRow bool, isMonetizedRow bool, include bool)

RowMatchesSalesScope determines whether a report row belongs to the app, represents a monetized product, or should be included in aggregation.

Types

type CurrencyAmount

type CurrencyAmount struct {
	Total  *big.Rat
	Reason string
}

type CurrencyAmounts

type CurrencyAmounts map[string]CurrencyAmount

type CurrencyComparison

type CurrencyComparison struct {
	Currency     string
	Current      *float64
	Previous     *float64
	Delta        *float64
	DeltaPercent *float64
	Reason       string
}

CurrencyComparison pairs one currency's totals across two compared periods.

func CompareCurrencyAmounts

func CompareCurrencyAmounts(current, previous CurrencyAmounts) []CurrencyComparison

CompareCurrencyAmounts pairs the per-currency totals of two periods, sorted by currency code. A currency absent from a complete period has a zero total.

type SalesMetrics added in v1.260325.0

type SalesMetrics struct {
	RowCount                       int
	UnitsColumnPresent             bool
	DownloadUnitsAvailable         bool
	DeveloperProceedsColumnPresent bool
	CustomerPriceColumnPresent     bool
	SubscriptionColumnPresent      bool
	UnitsTotal                     float64
	DownloadUnitsTotal             float64
	MonetizedUnitsTotal            float64
	DeveloperProceeds              SalesMoney
	CustomerPrice                  SalesMoney
	SubscriptionRows               int
	SubscriptionUnitsTotal         float64
	SubscriptionDeveloperProceeds  SalesMoney
	RenewalRows                    int
	RenewalUnitsTotal              float64
	RenewalDeveloperProceeds       SalesMoney
}

SalesMetrics holds aggregated metrics from a parsed sales report.

type SalesMoney

type SalesMoney struct {
	LegacyTotal float64
	ByCurrency  CurrencyAmounts
}

func (SalesMoney) Plus

func (m SalesMoney) Plus(other SalesMoney) SalesMoney

type SalesScope added in v1.260325.0

type SalesScope struct {
	AppID  string
	AppSKU string
}

SalesScope identifies an app for scoping sales report row filtering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL