From aa5652df49f08096269a14cc51eed6e943003340 Mon Sep 17 00:00:00 2001
From: zoldar
See
- Similar to Example: Similar to Example: The format of an Each language-range MAY be given an associated quality value which represents an
+ language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" ) Each language-range MAY be given an associated quality value which represents an
estimate of the user's preference for the languages specified by that range. The
quality value defaults to "q=1". For example, would mean: "I prefer Danish, but will accept British English and other types of English." MyApp.Cldr.Currency.currencies_for_locale!("en")
- => %{ } Note that return value is not guaranteed to be a valid
+ Note that return value is not guaranteed to be a valid
number system for the given locale as demonstrated in the third example. To configure these transliteration pairs, add the to the Where each tuple in the list configures one transliteration map. In this example, two maps are
+ Where each tuple in the list configures one transliteration map. In this example, two maps are
configured: from A list of configurable number systems is returned by If a transliteration is requested between two number pairs that have not been configured for
precompilation, a warning is logged. It is also possible and recommended to use the It is also possible and recommended to use the When formatting a number the format is parsed into format elements that might include
+ When formatting a number the format is parsed into format elements that might include
a currency symbol, a literal string, inserted text between a currency symbol and the
currency amount, a percent sign, the number itself and several other elements. In
some cases it is helpful to be apply specific formatting to each element.
@@ -1168,80 +1168,80 @@ inserted in the final formatted number. An error tuple Functions to implement the number system rule-based-number-format rules of CLDR. These rules are defined only on the "und" locale and represent specialised
number formatting. The standard public API for RBNF is via the The functions on this module are defined at compile time based upon the RBNF rules
-defined in the Unicode CLDR data repository. Available rules are identified by: A rule can then be invoked on an available rule_set. For example This particular call is equivalent to the call through the public API of: A rule can then be invoked on an available rule_set. For example This particular call is equivalent to the call through the public API of: Functions to implement the ordinal rule-based-number-format rules of CLDR. As CLDR notes, the data is incomplete or non-existent for many languages. It
is considered complete for English however. The standard public API for RBNF is via the The functions on this module are defined at compile time based upon the RBNF rules
-defined in the Unicode CLDR data repository. Available rules are identified by: A rule can then be invoked on an available rule_set. For example This call is equivalent to the call through the public API of: A rule can then be invoked on an available rule_set. For example This call is equivalent to the call through the public API of: Functions to implement the spellout rule-based-number-format rules of CLDR. As CLDR notes, the data is incomplete or non-existent for many languages. It
is considered complete for English however. The standard public API for RBNF is via the The functions on this module are defined at compile time based upon the RBNF rules
-defined in the Unicode CLDR data repository. Available rules are identified by: A rule can then be invoked on an available rule_set. For example: This call is equivalent to the call through the public API of: A rule can then be invoked on an available rule_set. For example: This call is equivalent to the call through the public API of: See
- Similar to Example: Similar to Example: Renders export archive filename. Examples: Renders export archive filename. Examples: Safely renders content disposition for an arbitrary export filename. Examples: Safely renders content disposition for an arbitrary export filename. Examples: Creates a streamable Zip archive from the provided (named) Ecto queries. Example usage: Creates a streamable Zip archive from the provided (named) Ecto queries. Example usage: In the case of a DB-IP database: In the case of a MaxMind database: In the case of a DB-IP database: In the case of a MaxMind database: Loading from a local file: Downloading a MaxMind DB (this license key is no longer active): Loading from a local file: Downloading a MaxMind DB (this license key is no longer active): See
- Similar to Example: Similar to Example: Extracts min/max date range from a list of uploads. Examples: Extracts the table name from the provided filename. Raises if the filename doesn't conform to the expected format. Examples: Returns local directory for CSV imports storage. Builds upon Examples: Returns local directory for CSV imports storage. Builds upon Examples: Extracts table name and min/max dates from the filename. Examples: Checks if the provided filename conforms to the expected format. Examples: In case it's necessary to run the whole import job fully synchronously, the
A basic usage scenario looks like this: A basic usage scenario looks like this: In a more realistic scenario, job scheduling will be done inside a GenServer process
+ In a more realistic scenario, job scheduling will be done inside a GenServer process
like LiveView, where notifications can be listened for via See
- Similar to Example: Similar to Example: In
Returns the pre-configured S3 bucket for CSV exports. Example: Example: In
Returns Example: Returns Example:insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
@spec check_password(Plausible.Auth.User.t(), String.t()) ::
+ :ok | {:error, :wrong_password}
+
+ create_api_key(user, name, key)
-
+
View Source
@@ -383,7 +428,7 @@ Pages
delete_api_key(user, id)
-
+
View Source
@@ -411,7 +456,7 @@ Pages
delete_user(user)
-
+
View Source
@@ -433,7 +478,7 @@ Pages
enterprise_configured?(user)
-
+
View Source
@@ -455,7 +500,7 @@ Pages
find_api_key(raw_key)
-
+
View Source
@@ -484,7 +529,7 @@ Pages
find_user_by(opts)
-
+
View Source
@@ -494,6 +539,41 @@ Pages
@spec find_user_by(Keyword.t()) :: Plausible.Auth.User.t() | nil
+
+ @spec get_user_by(Keyword.t()) ::
+ {:ok, Plausible.Auth.User.t()} | {:error, :user_not_found}
+
+ has_active_sites?(user, roles \\ [:owner, :admin, :viewer])
-
+
View Source
@@ -530,7 +610,7 @@ Pages
is_super_admin?(user_id)
-
+
View Source
@@ -609,7 +689,7 @@ Pages
user_owns_sites?(user)
-
+
View Source
diff --git a/Plausible.Billing.Ecto.Feature.html b/Plausible.Billing.Ecto.Feature.html
index efab329c8..55a7ef8e4 100644
--- a/Plausible.Billing.Ecto.Feature.html
+++ b/Plausible.Billing.Ecto.Feature.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.Ecto.FeatureList.html b/Plausible.Billing.Ecto.FeatureList.html
index 5eeb297f3..400f5085e 100644
--- a/Plausible.Billing.Ecto.FeatureList.html
+++ b/Plausible.Billing.Ecto.FeatureList.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.Ecto.Limit.html b/Plausible.Billing.Ecto.Limit.html
index d3e9be1a9..72364e72f 100644
--- a/Plausible.Billing.Ecto.Limit.html
+++ b/Plausible.Billing.Ecto.Limit.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.EnterprisePlan.html b/Plausible.Billing.EnterprisePlan.html
index 4788f104b..135ff56d3 100644
--- a/Plausible.Billing.EnterprisePlan.html
+++ b/Plausible.Billing.EnterprisePlan.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.EnterprisePlanAdmin.html b/Plausible.Billing.EnterprisePlanAdmin.html
index 71be987fb..7e3588c0e 100644
--- a/Plausible.Billing.EnterprisePlanAdmin.html
+++ b/Plausible.Billing.EnterprisePlanAdmin.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.Feature.html b/Plausible.Billing.Feature.html
index c05067c07..5acb5ec56 100644
--- a/Plausible.Billing.Feature.html
+++ b/Plausible.Billing.Feature.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.PaddleApi.html b/Plausible.Billing.PaddleApi.html
index 617c58cea..f5d743979 100644
--- a/Plausible.Billing.PaddleApi.html
+++ b/Plausible.Billing.PaddleApi.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.Plans.html b/Plausible.Billing.Plans.html
index d3ff9e1fe..e97fa81e9 100644
--- a/Plausible.Billing.Plans.html
+++ b/Plausible.Billing.Plans.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.Quota.html b/Plausible.Billing.Quota.html
index 51adad22a..40304e85e 100644
--- a/Plausible.Billing.Quota.html
+++ b/Plausible.Billing.Quota.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.SiteLocker.html b/Plausible.Billing.SiteLocker.html
index f745808e8..4159f9520 100644
--- a/Plausible.Billing.SiteLocker.html
+++ b/Plausible.Billing.SiteLocker.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.Subscription.Status.html b/Plausible.Billing.Subscription.Status.html
index ee54a5dea..ac10d2b5a 100644
--- a/Plausible.Billing.Subscription.Status.html
+++ b/Plausible.Billing.Subscription.Status.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Billing.html b/Plausible.Billing.html
index d1844153f..dd34cbeb4 100644
--- a/Plausible.Billing.html
+++ b/Plausible.Billing.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Cache.Adapter.html b/Plausible.Cache.Adapter.html
index 8c345d3f8..35a1ca22d 100644
--- a/Plausible.Cache.Adapter.html
+++ b/Plausible.Cache.Adapter.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Cache.Stats.html b/Plausible.Cache.Stats.html
index 352409761..815247bbc 100644
--- a/Plausible.Cache.Stats.html
+++ b/Plausible.Cache.Stats.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Cache.Warmer.html b/Plausible.Cache.Warmer.html
index 8c484b44f..688aedd56 100644
--- a/Plausible.Cache.Warmer.html
+++ b/Plausible.Cache.Warmer.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Cache.html b/Plausible.Cache.html
index 76d05ab7c..d8de2a351 100644
--- a/Plausible.Cache.html
+++ b/Plausible.Cache.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.ChangesetHelpers.html b/Plausible.ChangesetHelpers.html
index 2f259f1a4..34a6aea69 100644
--- a/Plausible.ChangesetHelpers.html
+++ b/Plausible.ChangesetHelpers.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Cldr.AcceptLanguage.html b/Plausible.Cldr.AcceptLanguage.html
index a5a06eccb..15ad82030 100644
--- a/Plausible.Cldr.AcceptLanguage.html
+++ b/Plausible.Cldr.AcceptLanguage.html
@@ -14,7 +14,7 @@
-
+
@@ -148,7 +148,7 @@ Pages
the set of natural languages that are preferred as a response to the request.
Language tags function are provided in Cldr.LanguageTag
.Accept-Language
header is as follows in ABNF
format: Accept-Language = "Accept-Language" ":"
1#( language-range [ ";" "q" "=" qvalue ] )
- language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
Accept-Language: da, en-gb;q=0.8, en;q=0.7
Examples
-
iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- %Cldr.LanguageTag{
+
+iex> Plausible.Cldr.AcceptLanguage.best_match("invalid_tag")
+{:error, {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
+ transform: %{},
+ language_variants: []
+ }}
-iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
+ transform: %{},
+ language_variants: []
+ }}
-iex> Plausible.Cldr.AcceptLanguage.best_match("xx,yy;q=0.3")
-{:error,
- {Cldr.NoMatchingLocale,
- "No configured locale could be matched to \"xx,yy;q=0.3\""}}
+iex> Plausible.Cldr.AcceptLanguage.best_match("xx,yy;q=0.3")
+{:error,
+ {Cldr.NoMatchingLocale,
+ "No configured locale could be matched to \"xx,yy;q=0.3\""}}
-iex> Plausible.Cldr.AcceptLanguage.best_match("invalid_tag")
-{:error, {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
Example
-iex> Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- [
- {1.0,
- %Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+ }},
+ {:error,
+ {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+ ]}iex> Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ [
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
- ]}
+ transform: %{},
+ language_variants: []
+ }}
+ ]}
-iex> Plausible.Cldr.AcceptLanguage.parse("invalid_tag")
-{:error,
- {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+iex> Plausible.Cldr.AcceptLanguage.parse("invalid_tag")
+{:error,
+ {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-iex> Plausible.Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3,invalid_tag")
-{:ok,
- [
- {1.0,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3,invalid_tag")
+{:ok,
+ [
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }},
- {:error,
- {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
- ]}
Example
-iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3")
-[
- {1.0,
- %Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+ }},
+ {:error,
+ {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+]iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3")
+[
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
-]
+ transform: %{},
+ language_variants: []
+ }}
+]
Plausible.Cldr.AcceptLanguage.parse! "invalid_tag"
** (Cldr.AcceptLanguageError) "Expected a BCP47 language tag. Could not parse the remaining "g" starting at position 11
(ex_cldr) lib/cldr/accept_language.ex:304: Cldr.AcceptLanguage.parse!/1
-iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3,invalid_tag")
-[
- {1.0,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3,invalid_tag")
+[
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }},
- {:error,
- {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-]
:all
. See FJD: %Cldr.Currency{
+ %{
@@ -499,11 +499,11 @@ The default is FJD: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "FJD",
- count: %{one: "Fijian dollar", other: "Fijian dollars"},
+ count: %{one: "Fijian dollar", other: "Fijian dollars"},
digits: 2,
from: nil,
iso_digits: 2,
@@ -433,12 +433,12 @@ The default is
:all
. See symbol: "FJD",
tender: true,
to: nil
- },
- SUR: %Cldr.Currency{
+ },
+ SUR: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "SUR",
- count: %{one: "Soviet rouble", other: "Soviet roubles"},
+ count: %{one: "Soviet rouble", other: "Soviet roubles"},
digits: 2,
from: nil,
iso_digits: nil,
@@ -448,7 +448,7 @@ The default is :all
. See symbol: "SUR",
tender: true,
to: nil
- },
+ },
...
}}:all
. See Example
FJD: %Cldr.Currency{
+ => %{
FJD: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "FJD",
- count: %{one: "Fijian dollar", other: "Fijian dollars"},
+ count: %{one: "Fijian dollar", other: "Fijian dollars"},
digits: 2,
from: nil,
iso_digits: 2,
@@ -513,12 +513,12 @@ The default is
:all
. See symbol: "FJD",
tender: true,
to: nil
-},
-SUR: %Cldr.Currency{
+},
+SUR: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "SUR",
- count: %{one: "Soviet rouble", other: "Soviet roubles"},
+ count: %{one: "Soviet rouble", other: "Soviet roubles"},
digits: 2,
from: nil,
iso_digits: nil,
@@ -528,7 +528,7 @@ The default is :all
. See symbol: "SUR",
tender: true,
to: nil
-},
+},
...
Examples
-
-iex> Plausible.Cldr.Currency.currency_for_code("AUD")
-{:ok,
- %Cldr.Currency{
+
+}}iex> Plausible.Cldr.Currency.currency_for_code("AUD")
+{:ok,
+ %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "AUD",
- count: %{one: "Australian dollar", other: "Australian dollars"},
+ count: %{one: "Australian dollar", other: "Australian dollars"},
digits: 2,
iso_digits: 2,
name: "Australian Dollar",
@@ -600,15 +600,15 @@ or a
rounding: 0,
symbol: "A$",
tender: true
-}}
+}}
-iex> Plausible.Cldr.Currency.currency_for_code("THB")
-{:ok,
- %Cldr.Currency{
+iex> Plausible.Cldr.Currency.currency_for_code("THB")
+{:ok,
+ %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "THB",
- count: %{one: "Thai baht", other: "Thai baht"},
+ count: %{one: "Thai baht", other: "Thai baht"},
digits: 2,
iso_digits: 2,
name: "Thai Baht",
@@ -616,7 +616,7 @@ or a
rounding: 0,
symbol: "THB",
tender: true
-}}
Examples
-
iex> Plausible.Cldr.Currency.currency_for_code!("AUD")
-%Cldr.Currency{
+
+}iex> Plausible.Cldr.Currency.currency_for_code!("AUD")
+%Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "AUD",
- count: %{one: "Australian dollar", other: "Australian dollars"},
+ count: %{one: "Australian dollar", other: "Australian dollars"},
digits: 2,
iso_digits: 2,
name: "Australian Dollar",
@@ -688,14 +688,14 @@ or a
rounding: 0,
symbol: "A$",
tender: true
-}
+}
-iex> Plausible.Cldr.Currency.currency_for_code!("THB")
-%Cldr.Currency{
+iex> Plausible.Cldr.Currency.currency_for_code!("THB")
+%Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "THB",
- count: %{one: "Thai baht", other: "Thai baht"},
+ count: %{one: "Thai baht", other: "Thai baht"},
digits: 2,
iso_digits: 2,
name: "Thai Baht",
@@ -703,7 +703,7 @@ or a
rounding: 0,
symbol: "THB",
tender: true
-}
Examples
-
iex> {:ok, locale} = Plausible.Cldr.validate_locale("en")
+
iex> {:ok, locale} = Plausible.Cldr.validate_locale("en")
iex> Plausible.Cldr.Currency.currency_from_locale locale
:USD
-iex> {:ok, locale} = Plausible.Cldr.validate_locale("en-AU")
+iex> {:ok, locale} = Plausible.Cldr.validate_locale("en-AU")
iex> Plausible.Cldr.Currency.currency_from_locale locale
:AUD
-iex> Plausible.Cldr.Currency.currency_from_locale("en-GB")
+iex> Plausible.Cldr.Currency.currency_from_locale("en-GB")
:GBP
Example
-
+iex> MyApp.Cldr.Currency.currency_history_for_locale("en")
-{:ok,
- %{
- USD: %{from: ~D[1792-01-01], to: nil},
- USN: %{tender: false},
- USS: %{from: nil, tender: false, to: ~D[2014-03-01]}
- }
-}
iex> MyApp.Cldr.Currency.currency_history_for_locale("en")
+{:ok,
+ %{
+ USD: %{from: ~D[1792-01-01], to: nil},
+ USN: %{tender: false},
+ USS: %{from: nil, tender: false, to: ~D[2014-03-01]}
+ }
+}
:all
. See ExampleMyApp.Cldr.Currency.currency_strings("en")
-=> {:ok,
- %{
+
+ }}MyApp.Cldr.Currency.currency_strings("en")
+=> {:ok,
+ %{
"mexican silver pesos" => :MXP,
"sudanese dinar" => :SDD,
"bad" => :BAD,
@@ -874,7 +874,7 @@ The default is
:all
. See "guyanaese dollars" => :GYD,
"equatorial guinean ekwele" => :GQE,
...
- }}:all
. See Example
-MyApp.Cldr.Currency.currency_strings!("en")
-=> %{
+
+ }MyApp.Cldr.Currency.currency_strings!("en")
+=> %{
"mexican silver pesos" => :MXP,
"sudanese dinar" => :SDD,
"bad" => :BAD,
@@ -944,7 +944,7 @@ The default is
:all
. See "guyanaese dollars" => :GYD,
"equatorial guinean ekwele" => :GQE,
...
- }
Example
-
iex> MyApp.Cldr.Currency.current_currency_from_locale("en")
+
iex> MyApp.Cldr.Currency.current_currency_from_locale("en")
:USD
-iex> MyApp.Cldr.Currency.current_currency_from_locale("en-AU")
+iex> MyApp.Cldr.Currency.current_currency_from_locale("en-AU")
:AUD
Example
-
+iex> Plausible.Cldr.Currency.current_territory_currencies()
iex> Plausible.Cldr.Currency.current_territory_currencies()
Examples
-iex> Plausible.Cldr.Currency.known_currency_code("AUD")
-{:ok, :AUD}
+
+iex> Plausible.Cldr.Currency.known_currency_code("GGG")
+{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}iex> Plausible.Cldr.Currency.known_currency_code("AUD")
+{:ok, :AUD}
-iex> Plausible.Cldr.Currency.known_currency_code("GGG")
-{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}
Examples
-iex> Plausible.Cldr.Currency.known_currency_code?("AUD")
+
iex> Plausible.Cldr.Currency.known_currency_code?("AUD")
true
-iex> Plausible.Cldr.Currency.known_currency_code?("GGG")
+iex> Plausible.Cldr.Currency.known_currency_code?("GGG")
false
-iex> Plausible.Cldr.Currency.known_currency_code?(:XCV)
+iex> Plausible.Cldr.Currency.known_currency_code?(:XCV)
false
Example
-
+iex> Plausible.Cldr.Currency.known_currency_codes()
iex> Plausible.Cldr.Currency.known_currency_codes()
0.05
. Optional.Example
-iex> Plausible.Cldr.Currency.new(:XAE, name: "Custom Name", digits: 0)
-{:ok,
- %Cldr.Currency{
+
+ }}
+iex> MyApp.Cldr.Currency.new(:XAH, name: "Custom Name")
+{:error, "Required options are missing. Required options are [:name, :digits]"}
+iex> Plausible.Cldr.Currency.new(:XAE, name: "XAE", digits: 0)
+{:error, {Cldr.CurrencyAlreadyDefined, "Currency :XAE is already defined."}}iex> Plausible.Cldr.Currency.new(:XAE, name: "Custom Name", digits: 0)
+{:ok,
+ %Cldr.Currency{
alt_code: :XAE,
cash_digits: 0,
cash_rounding: nil,
code: :XAE,
- count: %{other: "Custom Name"},
+ count: %{other: "Custom Name"},
digits: 0,
from: nil,
iso_digits: 0,
@@ -1293,11 +1293,11 @@ such as
0.05
. Optional.symbol
: "XAE",
tender: false,
to: nil
- }}
-iex> MyApp.Cldr.Currency.new(:XAH, name: "Custom Name")
-{:error, "Required options are missing. Required options are [:name, :digits]"}
-iex> Plausible.Cldr.Currency.new(:XAE, name: "XAE", digits: 0)
-{:error, {Cldr.CurrencyAlreadyDefined, "Currency :XAE is already defined."}}Plaus
Examples
-iex> Plausible.Cldr.Currency.pluralize(1, :USD)
-{:ok, "US dollar"}
+
+iex> Plausible.Cldr.Currency.pluralize(1, :USD, locale: "fr")
+{:ok, "dollar des États-Unis"}iex> Plausible.Cldr.Currency.pluralize(1, :USD)
+{:ok, "US dollar"}
-iex> Plausible.Cldr.Currency.pluralize(3, :USD)
-{:ok, "US dollars"}
+iex> Plausible.Cldr.Currency.pluralize(3, :USD)
+{:ok, "US dollars"}
-iex> Plausible.Cldr.Currency.pluralize(12, :USD, locale: "zh")
-{:ok, "美元"}
+iex> Plausible.Cldr.Currency.pluralize(12, :USD, locale: "zh")
+{:ok, "美元"}
-iex> Plausible.Cldr.Currency.pluralize(12, :USD, locale: "fr")
-{:ok, "dollars des États-Unis"}
+iex> Plausible.Cldr.Currency.pluralize(12, :USD, locale: "fr")
+{:ok, "dollars des États-Unis"}
-iex> Plausible.Cldr.Currency.pluralize(1, :USD, locale: "fr")
-{:ok, "dollar des États-Unis"}
Example
-
+iex> MyApp.Cldr.Currency.strings_for_currency :AUD,("en")
-["a$", "australian dollars", "aud", "australian dollar"]
iex> MyApp.Cldr.Currency.strings_for_currency :AUD,("en")
+["a$", "australian dollars", "aud", "australian dollar"]
Examples
-iex> Plausible.Cldr.Locale.fallback_locale_names(:"fr-CA")
-{:ok, [:"fr-CA", :fr, :und]}
+
+iex> Plausible.Cldr.Locale.fallback_locale_names(:nb)
+{:ok, [:nb, :no, :und]}iex> Plausible.Cldr.Locale.fallback_locale_names(:"fr-CA")
+{:ok, [:"fr-CA", :fr, :und]}
# Fallbacks are typically formed by progressively
# stripping variant, territory and script from the
# given locale name. But not always - there are
# certain fallbacks that take a different path.
-iex> Plausible.Cldr.Locale.fallback_locale_names(:nb)
-{:ok, [:nb, :no, :und]}
Examples
-Plausible.Cldr.Locale.fallback_locales(:"fr-CA")
-=> {:ok,
- [#Cldr.LanguageTag<fr-CA [validated]>, #Cldr.LanguageTag<fr [validated]>,
- #Cldr.LanguageTag<und [validated]>]}
+
+Plausible.Cldr.Locale.fallback_locales(:nb))
+=> {:ok,
+ [#Cldr.LanguageTag<nb [validated]>, #Cldr.LanguageTag<no [validated]>,
+ #Cldr.LanguageTag<und [validated]>]}Plausible.Cldr.Locale.fallback_locales(:"fr-CA")
+=> {:ok,
+ [#Cldr.LanguageTag<fr-CA [validated]>, #Cldr.LanguageTag<fr [validated]>,
+ #Cldr.LanguageTag<und [validated]>]}
# Fallbacks are typically formed by progressively
# stripping variant, territory and script from the
# given locale name. But not always - there are
# certain fallbacks that take a different path.
-Plausible.Cldr.Locale.fallback_locales(:nb))
-=> {:ok,
- [#Cldr.LanguageTag<nb [validated]>, #Cldr.LanguageTag<no [validated]>,
- #Cldr.LanguageTag<und [validated]>]}
Examples
+iex> Plausible.Cldr.Locale.locale_from_host("a.b.com")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}iex> Plausible.Cldr.Locale.locale_from_host "a.b.com.au"
-Elixir.Plausible.Cldr.validate_locale(:"en-AU")
+Elixir.Plausible.Cldr.validate_locale(:"en-AU")
-iex> Plausible.Cldr.Locale.locale_from_host("a.b.com.tv")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"tv\""}}
+iex> Plausible.Cldr.Locale.locale_from_host("a.b.com.tv")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"tv\""}}
-iex> Plausible.Cldr.Locale.locale_from_host("a.b.com")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
Examples
-iex> Cldr.Locale.territory_from_host("a.b.com.au")
-{:ok, :AU}
+
+iex> Cldr.Locale.territory_from_host("a.b.com")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}iex> Cldr.Locale.territory_from_host("a.b.com.au")
+{:ok, :AU}
-iex> Cldr.Locale.territory_from_host("a.b.com")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
:zero
, Examples
-
iex> Plausible.Cldr.Number.Cardinal.pluralize 1, "en", %{one: "one"}
+
iex> Plausible.Cldr.Number.Cardinal.pluralize 1, "en", %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one", two: "two", other: "other"}
"other"
-iex> Plausible.Cldr.Number.Cardinal.pluralize 22, "en", %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 22, "en", %{one: "one", two: "two", other: "other"}
"other"
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(1), "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(1), "en", %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one", two: "two"}
nil
-iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
"few"
-iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
"other"
Example
+"000 Tr ¤", ...]#=> Plausible.Cldr.Number.Format.Format.decimal_format_list
-["#", "#,##,##0%",
+["#", "#,##,##0%",
"#,##,##0.###", "#,##,##0.00¤", "#,##,##0.00¤;(#,##,##0.00¤)",
"#,##,##0 %", "#,##0%", "#,##0.###", "#,##0.00 ¤",
"#,##0.00 ¤;(#,##0.00 ¤)", "#,##0.00¤", "#,##0.00¤;(#,##0.00¤)",
@@ -475,7 +475,7 @@ to precompile all the known formats at compile time.
"000 B ¤"
, "000 E ¤", "000 K ¤", "000 MRD ¤", "000 Md ¤", "000 Mio'.' ¤",
"000 Mio ¤", "000 Mld ¤", "000 Mln ¤", "000 Mn ¤", "000 Mrd'.' ¤",
"000 Mrd ¤", "000 Mr ¤", "000 M ¤", "000 NT ¤", "000 N ¤", "000 Tn ¤",
-"000 Tr ¤", ...]
Example
-iex> Plausible.Cldr.Number.Format.decimal_format_list_for(:en)
-{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
+
+ "¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}iex> Plausible.Cldr.Number.Format.decimal_format_list_for(:en)
+{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
"0 billion", "0 million", "0 thousand",
"0 trillion", "00 billion", "00 million", "00 thousand", "00 trillion",
"000 billion", "000 million", "000 thousand", "000 trillion", "000B", "000K",
@@ -532,7 +532,7 @@ the known formats at compile time. Its use is not otherwise recommended.
"¤#,##0.00", "¤#,##0.00;(¤#,##0.00)", "¤000B", "¤000K", "¤000M",
"¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T",
"¤ #,##0.00", "¤ #,##0.00;(¤ #,##0.00)", "¤ 000B", "¤ 000K", "¤ 000M",
- "¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}
Plausible.Cld
Examples
-
+iex> Plausible.Cldr.Number.Format.default_grouping_for(:en)
-{:ok, %{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}}
iex> Plausible.Cldr.Number.Format.default_grouping_for(:en)
+{:ok, %{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}}
Plausible.Cld
Examples
-
+iex> Plausible.Cldr.Number.Format.default_grouping_for!(:en)
-%{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}
iex> Plausible.Cldr.Number.Format.default_grouping_for!(:en)
+%{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}
percent: "#,##0 %",
scientific: "#E0",
standard: "#,##0.###"
- currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]},
- {"10000", [one: "00 k ¤", other: "00 k ¤"]},
- {"100000", [one: "000 k ¤", other: "000 k ¤"]},
- {"1000000", [one: "0 M ¤", other: "0 M ¤"]},
- {"10000000", [one: "00 M ¤", other: "00 M ¤"]},
- {"100000000", [one: "000 M ¤", other: "000 M ¤"]},
- {"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]},
- {"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]},
- {"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]},
- {"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]},
- {"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]},
- {"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}],
+ currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]},
+ {"10000", [one: "00 k ¤", other: "00 k ¤"]},
+ {"100000", [one: "000 k ¤", other: "000 k ¤"]},
+ {"1000000", [one: "0 M ¤", other: "0 M ¤"]},
+ {"10000000", [one: "00 M ¤", other: "00 M ¤"]},
+ {"100000000", [one: "000 M ¤", other: "000 M ¤"]},
+ {"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]},
+ {"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]},
+ {"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]},
+ {"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]},
+ {"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]},
+ {"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}],
...
}
Plausible.Cld
Examples
-
+iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for("en")
-{:ok, 1}
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for("en")
+{:ok, 1}
Plausible.Cld
Examples
-iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for!("en")
+
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for!("en")
1
:zero
, Examples
-
iex> Plausible.Cldr.Number.Ordinal.pluralize 1, :en, %{one: "one"}
+
diff --git a/Plausible.Cldr.Number.PluralRule.Range.html b/Plausible.Cldr.Number.PluralRule.Range.html
index 4137fa685..acf20ecb9 100644
--- a/Plausible.Cldr.Number.PluralRule.Range.html
+++ b/Plausible.Cldr.Number.PluralRule.Range.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Cldr.Number.Symbol.html b/Plausible.Cldr.Number.Symbol.html
index d589dccbd..7b4d61d2c 100644
--- a/Plausible.Cldr.Number.Symbol.html
+++ b/Plausible.Cldr.Number.Symbol.html
@@ -14,7 +14,7 @@
-
+
@@ -378,9 +378,9 @@ is iex> Plausible.Cldr.Number.Ordinal.pluralize 1, :en, %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one", two: "two"}
"two"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 22, :en, %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 22, :en, %{one: "one", two: "two", other: "other"}
"two"
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(1), :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(1), :en, %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one", two: "two"}
"two"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
"other"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
"other"
Plausible.Cld
Example:
-iex> Plausible.Cldr.Number.Symbol.number_symbols_for(:th)
-{:ok, %{
- latn: %Cldr.Number.Symbol{
+
+ }
+ }}iex> Plausible.Cldr.Number.Symbol.number_symbols_for(:th)
+{:ok, %{
+ latn: %Cldr.Number.Symbol{
decimal: ".",
exponential: "E",
group: ",",
@@ -393,8 +393,8 @@ is
Plausible.Cld
plus_sign: "+",
superscripting_exponent: "×",
time_separator: ":"
- },
- thai: %Cldr.Number.Symbol{
+ },
+ thai: %Cldr.Number.Symbol{
decimal: ".",
exponential: "E",
group: ",",
@@ -407,8 +407,8 @@ is Plausible.Cld
plus_sign: "+",
superscripting_exponent: "×",
time_separator: ":"
- }
- }}Examples
+ {Cldr.UnknownNumberSystemError,
+ "The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"}
+}iex> Plausible.Cldr.Number.System.number_system_for "th", :latn
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
iex> Plausible.Cldr.Number.System.number_system_for "en", :default
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
iex> Plausible.Cldr.Number.System.number_system_for "he", :traditional
-{:ok, %{rules: "hebrew", type: :algorithmic}}
+{:ok, %{rules: "hebrew", type: :algorithmic}}
iex> Plausible.Cldr.Number.System.number_system_for "en", :native
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
iex> Plausible.Cldr.Number.System.number_system_for "en", :finance
-{
+{
:error,
- {Cldr.UnknownNumberSystemError,
- "The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"}
-}
Examples
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}iex> Plausible.Cldr.Number.System.number_system_names_for "en"
-{:ok, [:latn]}
+{:ok, [:latn]}
iex> Plausible.Cldr.Number.System.number_system_names_for "zz"
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
Examples
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}iex> Plausible.Cldr.Number.System.number_systems_for "en"
-{:ok, %{default: :latn, native: :latn}}
+{:ok, %{default: :latn, native: :latn}}
iex> Plausible.Cldr.Number.System.number_systems_for "th"
-{:ok, %{default: :latn, native: :thai}}
+{:ok, %{default: :latn, native: :thai}}
iex> Plausible.Cldr.Number.System.number_systems_for "zz"
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
Examples
-ex> Plausible.Cldr.Number.System.system_name_from(:default, "en")
-{:ok, :latn}
+
ex> Plausible.Cldr.Number.System.system_name_from(:default, "en")
+{:ok, :latn}
-iex> Plausible.Cldr.Number.System.system_name_from("latn", "en")
-{:ok, :latn}
+iex> Plausible.Cldr.Number.System.system_name_from("latn", "en")
+{:ok, :latn}
-iex> Plausible.Cldr.Number.System.system_name_from(:native, "en")
-{:ok, :latn}
+iex> Plausible.Cldr.Number.System.system_name_from(:native, "en")
+{:ok, :latn}
-iex> Plausible.Cldr.Number.System.system_name_from(:nope, "en")
-{
+iex> Plausible.Cldr.Number.System.system_name_from(:nope, "en")
+{
:error,
- {Cldr.UnknownNumberSystemError, "The number system :nope is unknown"}
-}
Examples
+{:ok, "壹佰贰拾叁"}iex> Plausible.Cldr.Number.System.to_system 123456, :hebr
-{:ok, "קכ״ג׳תנ״ו"}
+{:ok, "קכ״ג׳תנ״ו"}
iex> Plausible.Cldr.Number.System.to_system 123, :hans
-{:ok, "一百二十三"}
+{:ok, "一百二十三"}
iex> Plausible.Cldr.Number.System.to_system 123, :hant
-{:ok, "一百二十三"}
+{:ok, "一百二十三"}
iex> Plausible.Cldr.Number.System.to_system 123, :hansfin
-{:ok, "壹佰贰拾叁"}
use Cldr
configuration
-in a backend module:defmodule MyApp.Cldr do
+in a backend module:
defmodule MyApp.Cldr do
use Cldr,
- locale: ["en", "fr", "th"],
+ locale: ["en", "fr", "th"],
default_locale: "en",
- precompile_transliterations: [{:latn, :thai}, {:arab, :thai}]
-end
:latn
to :thai
and from :arab
to :thai
.Cldr.Number.System.numeric_systems/0
.
Examples
-
Examples
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556")
+
diff --git a/Plausible.Cldr.Number.html b/Plausible.Cldr.Number.html
index 9829a89b9..c571ce475 100644
--- a/Plausible.Cldr.Number.html
+++ b/Plausible.Cldr.Number.html
@@ -14,7 +14,7 @@
-
+
@@ -441,19 +441,19 @@ using the Elixir standard library functions.iex> Plausible.Cldr.Number.Transliterate.transliterate("123556")
"123556"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default)
"123 556,000"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :default)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :default)
"123556"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", "thai")
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", "thai")
"๑๒๓๕๕๖"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :native)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :native)
"๑๒๓๕๕๖"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai")
+iex> Plausible.Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai")
"Some number is: ๑๒๓๕๕๖"
Examples
-iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de")
-{:ok, 1000.34}
+
+iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de", number: :integer)
+{:error,
+ {Cldr.Number.ParseError,
+ "The string \"+1.000,34\" could not be parsed as a number"}}iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de")
+{:ok, 1000.34}
-iex> Plausible.Cldr.Number.parse("-1_000_000.34")
-{:ok, -1000000.34}
+iex> Plausible.Cldr.Number.parse("-1_000_000.34")
+{:ok, -1000000.34}
-iex> Plausible.Cldr.Number.parse("1.000", locale: "de", number: :integer)
-{:ok, 1000}
+iex> Plausible.Cldr.Number.parse("1.000", locale: "de", number: :integer)
+{:ok, 1000}
-iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de", number: :integer)
-{:error,
- {Cldr.Number.ParseError,
- "The string \"+1.000,34\" could not be parsed as a number"}}
Examples
-iex> Plausible.Cldr.Number.scan("100 US dollars")
+
+iex> Plausible.Cldr.Number.scan("100 dollars des États-Unis")
+...> |> Plausible.Cldr.Number.resolve_currencies(locale: "fr")
+[100, :USD]iex> Plausible.Cldr.Number.scan("100 US dollars")
...> |> Plausible.Cldr.Number.resolve_currencies
-[100, :USD]
+[100, :USD]
-iex> Plausible.Cldr.Number.scan("100 eurosports")
-...> |> Plausible.Cldr.Number.resolve_currencies(fuzzy: 0.75)
-[100, :EUR]
+iex> Plausible.Cldr.Number.scan("100 eurosports")
+...> |> Plausible.Cldr.Number.resolve_currencies(fuzzy: 0.75)
+[100, :EUR]
-iex> Plausible.Cldr.Number.scan("100 dollars des États-Unis")
-...> |> Plausible.Cldr.Number.resolve_currencies(locale: "fr")
-[100, :USD]
Examples
iex> Plausible.Cldr.Number.resolve_currency("US dollars")
-[:USD]
+
+iex> Plausible.Cldr.Number.resolve_currency("not a known currency", locale: "fr")
+{:error,
+ {Cldr.UnknownCurrencyError,
+ "The currency \"not a known currency\" is unknown or not supported"}}iex> Plausible.Cldr.Number.resolve_currency("US dollars")
+[:USD]
-iex> Plausible.Cldr.Number.resolve_currency("100 eurosports", fuzzy: 0.75)
-[:EUR]
+iex> Plausible.Cldr.Number.resolve_currency("100 eurosports", fuzzy: 0.75)
+[:EUR]
-iex> Plausible.Cldr.Number.resolve_currency("dollars des États-Unis", locale: "fr")
-[:USD]
+iex> Plausible.Cldr.Number.resolve_currency("dollars des États-Unis", locale: "fr")
+[:USD]
-iex> Plausible.Cldr.Number.resolve_currency("not a known currency", locale: "fr")
-{:error,
- {Cldr.UnknownCurrencyError,
- "The currency \"not a known currency\" is unknown or not supported"}}
options[:backend].get_locale()
Examples
+[:percent, " of linguists ", :percent]iex> Plausible.Cldr.Number.resolve_per "11%"
-["11", :percent]
+["11", :percent]
iex> Plausible.Cldr.Number.resolve_per "% of linguists"
-[:percent, " of linguists"]
+[:percent, " of linguists"]
iex> Plausible.Cldr.Number.resolve_per "% of linguists %"
-[:percent, " of linguists ", :percent]
options[:backend].get_locale()
+iex> Plausible.Cldr.Number.scan("100%")
-...> |> Plausible.Cldr.Number.resolve_pers()
-[100, :percent]
iex> Plausible.Cldr.Number.scan("100%")
+...> |> Plausible.Cldr.Number.resolve_pers()
+[100, :percent]
Examples
-iex> Plausible.Cldr.Number.scan("£1_000_000.34")
-["£", 1000000.34]
+
+iex> Plausible.Cldr.Number.scan("The loss is -1.000 euros", locale: "de", number: :integer)
+["The loss is ", -1000, " euros"]iex> Plausible.Cldr.Number.scan("£1_000_000.34")
+["£", 1000000.34]
-iex> Plausible.Cldr.Number.scan("I want £1_000_000 dollars")
-["I want £", 1000000, " dollars"]
+iex> Plausible.Cldr.Number.scan("I want £1_000_000 dollars")
+["I want £", 1000000, " dollars"]
-iex> Plausible.Cldr.Number.scan("The prize is 23")
-["The prize is ", 23]
+iex> Plausible.Cldr.Number.scan("The prize is 23")
+["The prize is ", 23]
-iex> Plausible.Cldr.Number.scan("The lottery number is 23 for the next draw")
-["The lottery number is ", 23, " for the next draw"]
+iex> Plausible.Cldr.Number.scan("The lottery number is 23 for the next draw")
+["The lottery number is ", 23, " for the next draw"]
-iex> Plausible.Cldr.Number.scan("The loss is -1.000 euros", locale: "de", number: :integer)
-["The loss is ", -1000, " euros"]
Example
+{:ok, "~1,234"}
iex> Plausible.Cldr.Number.to_approx_string 1234
-{:ok, "~1,234"}
Example
+{:ok, "1,234+"}
iex> Plausible.Cldr.Number.to_at_least_string 1234
-{:ok, "1,234+"}
Example
+{:ok, "≤1,234"}
iex> Plausible.Cldr.Number.to_at_most_string 1234
-{:ok, "≤1,234"}
Example
+{:ok, "1,234–5,678"}
iex> Plausible.Cldr.Number.to_range_string 1234..5678
-{:ok, "1,234–5,678"}
iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
+applied to the symbol than the number. For example:
iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
...> string, :currency_symbol -> "<span class=\"symbol\">" <> string <> "</span>"
...> string, :number -> "<span class=\"number\">" <> string <> "</span>"
...> string, :currency_space -> "<span>" <> string <> "</span>"
...> string, _other -> string
-...> end)
-{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}
Phoenix.HTML.Tag.content_tag/3
+Phoenix.HTML.Tag.content_tag/3
function if wrapping HTML tags since these will ensure HTML entities are
-correctly encoded. For example:iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
-...> string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol")
-...> string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number")
-...> string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string)
+correctly encoded. For example:
iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
+...> string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol")
+...> string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number")
+...> string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string)
...> string, _other -> string
-...> end)
-{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}
Examples
iex> Plausible.Cldr.Number.to_string 12345
-{:ok, "12,345"}
+{:ok, "12,345"}
iex> Plausible.Cldr.Number.to_string 12345, locale: "fr"
-{:ok, "12 345"}
+{:ok, "12 345"}
iex> Plausible.Cldr.Number.to_string 1345.32, currency: :EUR, locale: "es", minimum_grouping_digits: 1
-{:ok, "1.345,32 €"}
+{:ok, "1.345,32 €"}
iex> Plausible.Cldr.Number.to_string 1345.32, currency: :EUR, locale: "es"
-{:ok, "1345,32 €"}
+{:ok, "1345,32 €"}
iex> Plausible.Cldr.Number.to_string 12345, locale: "fr", currency: "USD"
-{:ok, "12 345,00 $US"}
+{:ok, "12 345,00 $US"}
iex> Plausible.Cldr.Number.to_string 12345, format: "#E0"
-{:ok, "1.2345E4"}
+{:ok, "1.2345E4"}
iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB"
-{:ok, "THB 12,345.00"}
+{:ok, "THB 12,345.00"}
iex> Plausible.Cldr.Number.to_string -12345, format: :accounting, currency: "THB"
-{:ok, "(THB 12,345.00)"}
+{:ok, "(THB 12,345.00)"}
iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB",
...> locale: "th"
-{:ok, "฿12,345.00"}
+{:ok, "฿12,345.00"}
iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB",
...> locale: "th", number_system: :native
-{:ok, "฿๑๒,๓๔๕.๐๐"}
+{:ok, "฿๑๒,๓๔๕.๐๐"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :long
-{:ok, "1 thousand"}
+{:ok, "1 thousand"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :long, currency: "USD"
-{:ok, "1,244 US dollars"}
+{:ok, "1,244 US dollars"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :short
-{:ok, "1K"}
+{:ok, "1K"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :short, currency: "EUR"
-{:ok, "€1K"}
+{:ok, "€1K"}
iex> Plausible.Cldr.Number.to_string 1234, format: :spellout
-{:ok, "one thousand two hundred thirty-four"}
+{:ok, "one thousand two hundred thirty-four"}
iex> Plausible.Cldr.Number.to_string 1234, format: :spellout_verbose
-{:ok, "one thousand two hundred and thirty-four"}
+{:ok, "one thousand two hundred and thirty-four"}
iex> Plausible.Cldr.Number.to_string 1989, format: :spellout_year
-{:ok, "nineteen eighty-nine"}
+{:ok, "nineteen eighty-nine"}
iex> Plausible.Cldr.Number.to_string 123, format: :ordinal
-{:ok, "123rd"}
+{:ok, "123rd"}
iex> Plausible.Cldr.Number.to_string 123, format: :roman
-{:ok, "CXXIII"}
+{:ok, "CXXIII"}
iex> Plausible.Cldr.Number.to_string 123, locale: "th-u-nu-thai"
-{:ok, "๑๒๓"}
+{:ok, "๑๒๓"}
Errors
{:error, reason}
will be returned if an error is detected.
-The two most likely causes of an error return are: iex> Plausible.Cldr.Number.to_string(12345, format: "0#")
- {:error, {Cldr.FormatCompileError,
- "Decimal format compiler: syntax error before: \"#\""}}
locale
and
+The two most likely causes of an error return are: iex> Plausible.Cldr.Number.to_string(12345, format: "0#")
+ {:error, {Cldr.FormatCompileError,
+ "Decimal format compiler: syntax error before: \"#\""}}
locale
and
number_system
. This happens typically when the number system is
:algorithmic
rather than the more common :numeric
. In this case the error
-return looks like:
+return looks like: iex> Plausible.Cldr.Number.to_string(1234, locale: "he", number_system: "hebr", format: :percent)
- {:error, {Cldr.UnknownFormatError,
- "The locale :he with number system :hebr does not define a format :percent"}}
iex> Plausible.Cldr.Number.to_string(1234, locale: "he", number_system: "hebr", format: :percent)
+ {:error, {Cldr.UnknownFormatError,
+ "The locale :he with number system :hebr does not define a format :percent"}}
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
iex> Plausible.Cldr.Number.validate_number_system "en", :latn
-{:ok, :latn}
+{:ok, :latn}
iex> Plausible.Cldr.Number.validate_number_system "en", :default
-{:ok, :latn}
+{:ok, :latn}
iex> Plausible.Cldr.Number.validate_number_system "en", :unknown
-{:error,
- {Cldr.UnknownNumberSystemError, "The number system :unknown is unknown"}}
+{:error,
+ {Cldr.UnknownNumberSystemError, "The number system :unknown is unknown"}}
iex> Plausible.Cldr.Number.validate_number_system "zz", :default
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
Cldr.Number.to_string/2
function.iex> Plausible.Cldr.Rbnf.NumberSystem.rule_sets(:und)
-...> |> Enum.sort()
-[
+defined in the Unicode CLDR data repository. Available rules are identified by:
iex> Plausible.Cldr.Rbnf.NumberSystem.rule_sets(:und)
+...> |> Enum.sort()
+[
:armenian_lower,
:armenian_upper,
:cyrillic_lower,
@@ -161,9 +161,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
:roman_upper,
:tamil,
:zz_default
-]
iex> Plausible.Cldr.Rbnf.NumberSystem.roman_upper(123, :und)
-"CXXIII"
+]iex> Plausible.Cldr.Number.to_string(123, format: :roman)
-{:ok, "CXXIII"}
iex> Plausible.Cldr.Rbnf.NumberSystem.roman_upper(123, :und)
+"CXXIII"
iex> Plausible.Cldr.Number.to_string(123, format: :roman)
+{:ok, "CXXIII"}
Cldr.Number.to_string/2
function.iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets(:en)
-[:digits_ordinal]
+defined in the Unicode CLDR data repository. Available rules are identified by:
iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets(:en)
+[:digits_ordinal]
-iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets("fr")
-...> |> Enum.sort()
-[
+iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets("fr")
+...> |> Enum.sort()
+[
:digits_ordinal,
:digits_ordinal_feminine,
:digits_ordinal_feminine_plural,
:digits_ordinal_masculine,
:digits_ordinal_masculine_plural
-]
iex> Plausible.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
-"123rd"
+]iex> Plausible.Cldr.Number.to_string(123, format: :ordinal)
-{:ok, "123rd"}
iex> Plausible.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
+"123rd"
iex> Plausible.Cldr.Number.to_string(123, format: :ordinal)
+{:ok, "123rd"}
Cldr.Number.to_string/2
function.iex> Plausible.Cldr.Rbnf.Spellout.rule_sets("en")
-...> |> Enum.sort()
-[
+defined in the Unicode CLDR data repository. Available rules are identified by:
iex> Plausible.Cldr.Rbnf.Spellout.rule_sets("en")
+...> |> Enum.sort()
+[
:spellout_cardinal,
:spellout_cardinal_verbose,
:spellout_numbering,
@@ -155,9 +155,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
:spellout_numbering_year,
:spellout_ordinal,
:spellout_ordinal_verbose
-]
iex> Plausible.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
-"one hundred twenty-third"
+]iex> Plausible.Cldr.Number.to_string(123, format: :spellout)
-{:ok, "one hundred twenty-three"}
iex> Plausible.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
+"one hundred twenty-third"
iex> Plausible.Cldr.Number.to_string(123, format: :spellout)
+{:ok, "one hundred twenty-three"}
iex> Plausible.Cldr.default_locale()
-%Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+}iex> Plausible.Cldr.default_locale()
+%Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en-001",
cldr_locale_name: :"en-001",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en-001",
script: :Latn,
territory: :"001",
- transform: %{},
- language_variants: []
-}
Example
-iex> Plausible.Cldr.default_territory()
+
iex> Plausible.Cldr.default_territory()
:"001"
iex> Plausible.Cldr.ellipsis("And furthermore")
+
@@ -715,23 +715,23 @@ take an optional locale parameter for which a locale is not supplied.iex> Plausible.Cldr.ellipsis("And furthermore")
"And furthermore…"
-iex> Plausible.Cldr.ellipsis(["And furthermore", "there is much to be done"], locale: :ja)
+iex> Plausible.Cldr.ellipsis(["And furthermore", "there is much to be done"], locale: :ja)
"And furthermore…there is much to be done"
-iex> Plausible.Cldr.ellipsis("And furthermore", format: :word)
+iex> Plausible.Cldr.ellipsis("And furthermore", format: :word)
"And furthermore …"
-iex> Plausible.Cldr.ellipsis(["And furthermore", "there is much to be done"], locale: :ja, format: :word)
+iex> Plausible.Cldr.ellipsis(["And furthermore", "there is much to be done"], locale: :ja, format: :word)
"And furthermore … there is much to be done"
Example
-iex> Plausible.Cldr.put_locale("pl")
-iex> Plausible.Cldr.get_locale()
-%Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+ }iex> Plausible.Cldr.put_locale("pl")
+iex> Plausible.Cldr.get_locale()
+%Cldr.LanguageTag{
backend: Elixir.Plausible.Cldr,
canonical_locale_name: "pl",
cldr_locale_name: :pl,
- extensions: %{},
+ extensions: %{},
language: "pl",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :pl,
territory: :PL,
requested_locale_name: "pl",
script: :Latn,
- transform: %{},
- language_variants: []
- }
Examples
-iex> Plausible.Cldr.known_gettext_locale_name("en")
+
iex> Plausible.Cldr.known_gettext_locale_name("en")
"en"
-iex> Plausible.Cldr.known_gettext_locale_name("en-SA")
+iex> Plausible.Cldr.known_gettext_locale_name("en-SA")
false
Examples
-iex> Plausible.Cldr.known_gettext_locale_name?("en")
+
@@ -941,10 +941,10 @@ to return the first known locale name from a list.iex> Plausible.Cldr.known_gettext_locale_name?("en")
true
-iex> Plausible.Cldr.known_gettext_locale_name?("!!")
+iex> Plausible.Cldr.known_gettext_locale_name?("!!")
false
Examples
-iex> Plausible.Cldr.known_locale_name(:"en-AU")
+
@@ -986,10 +986,10 @@ name is configured and available in Cldr.iex> Plausible.Cldr.known_locale_name(:"en-AU")
:"en-AU"
-iex> Plausible.Cldr.known_locale_name(:"en-SA")
+iex> Plausible.Cldr.known_locale_name(:"en-SA")
false
Examples
-iex> Plausible.Cldr.known_locale_name?(:en)
+
@@ -1043,8 +1043,8 @@ in this module or in iex> Plausible.Cldr.known_locale_name?(:en)
true
-iex> Plausible.Cldr.known_locale_name?(:"!!")
+iex> Plausible.Cldr.known_locale_name?(:"!!")
false
+iex> Plausible.Cldr.known_number_system_types()
-[:default, :finance, :native, :traditional]
iex> Plausible.Cldr.known_number_system_types()
+[:default, :finance, :native, :traditional]
Examples
-iex> Plausible.Cldr.known_rbnf_locale_name(:en)
+
iex> Plausible.Cldr.known_rbnf_locale_name(:en)
:en
-iex> Plausible.Cldr.known_rbnf_locale_name(:"en-SA")
+iex> Plausible.Cldr.known_rbnf_locale_name(:"en-SA")
false
Examples
iex> Plausible.Cldr.known_rbnf_locale_name?(:en)
+
@@ -1294,18 +1294,18 @@ CLDR backend defined by the iex> Plausible.Cldr.known_rbnf_locale_name?(:en)
true
-iex> Plausible.Cldr.known_rbnf_locale_name?(:"!!")
+iex> Plausible.Cldr.known_rbnf_locale_name?(:"!!")
false
t:Cldr.LanguageTag
is se
Examples
+ }
+}iex> import Cldr.LanguageTag.Sigil
-iex> Plausible.Cldr.put_gettext_locale(~l"en")
-{:ok, "en"}
+iex> Plausible.Cldr.put_gettext_locale(~l"en")
+{:ok, "en"}
iex> import Cldr.LanguageTag.Sigil
-iex> Plausible.Cldr.put_gettext_locale(~l"de")
-{
+iex> Plausible.Cldr.put_gettext_locale(~l"de")
+{
:error,
- {
+ {
Cldr.UnknownLocaleError,
"Locale TestBackend.Cldr.Locale.new!(\"de-DE\") does not map to a known gettext locale name"
- }
-}
Examples
-iex> Plausible.Cldr.put_locale("en")
-{:ok,
- %Cldr.LanguageTag{
+
+iex> Plausible.Cldr.put_locale("invalid-locale!")
+{:error, {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"!\" starting at position 15"}}iex> Plausible.Cldr.put_locale("en")
+{:ok,
+ %Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en",
cldr_locale_name: :en,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en",
script: :Latn,
territory: :US,
- transform: %{},
- language_variants: []
- }}
+ transform: %{},
+ language_variants: []
+ }}
-iex> Plausible.Cldr.put_locale("invalid-locale!")
-{:error, {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"!\" starting at position 15"}}
iex> Plausible.Cldr.quote("Quoted String")
+
iex> Plausible.Cldr.quote("Quoted String")
"“Quoted String”"
-iex> Plausible.Cldr.quote("Quoted String", locale: :ja)
+iex> Plausible.Cldr.quote("Quoted String", locale: :ja)
"「Quoted String」"
Examples
-iex> Plausible.Cldr.validate_locale(:en)
-{:ok,
-%Cldr.LanguageTag{
+
+iex> Plausible.Cldr.validate_locale("zzz")
+{:error, {Cldr.InvalidLanguageError, "The language \"zzz\" is invalid"}}iex> Plausible.Cldr.validate_locale(:en)
+{:ok,
+%Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en",
cldr_locale_name: :en,
- extensions: %{},
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en",
script: :Latn,
territory: :US,
- transform: %{},
- language_variants: []
-}}
+ transform: %{},
+ language_variants: []
+}}
-iex> Plausible.Cldr.validate_locale Plausible.Cldr.default_locale()
-{:ok,
-%Cldr.LanguageTag{
+iex> Plausible.Cldr.validate_locale Plausible.Cldr.default_locale()
+{:ok,
+%Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en-001",
cldr_locale_name: :"en-001",
- extensions: %{},
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en-001",
script: :Latn,
territory: :"001",
- transform: %{},
- language_variants: []
-}}
+ transform: %{},
+ language_variants: []
+}}
-iex> Plausible.Cldr.validate_locale("zzz")
-{:error, {Cldr.InvalidLanguageError, "The language \"zzz\" is invalid"}}
Examples
-iex> Plausible.Cldr.validate_number_system_type(:default)
-{:ok, :default}
+
+ {Cldr.UnknownNumberSystemTypeError, "The number system type \"bork\" is invalid"}
+}iex> Plausible.Cldr.validate_number_system_type(:default)
+{:ok, :default}
-iex> Plausible.Cldr.validate_number_system_type(:traditional)
-{:ok, :traditional}
+iex> Plausible.Cldr.validate_number_system_type(:traditional)
+{:ok, :traditional}
-iex> Plausible.Cldr.validate_number_system_type(:latn)
-{
+iex> Plausible.Cldr.validate_number_system_type(:latn)
+{
:error,
- {Cldr.UnknownNumberSystemTypeError, "The number system type :latn is unknown"}
-}
+ {Cldr.UnknownNumberSystemTypeError, "The number system type :latn is unknown"}
+}
-iex> Plausible.Cldr.validate_number_system_type("bork")
-{
+iex> Plausible.Cldr.validate_number_system_type("bork")
+{
:error,
- {Cldr.UnknownNumberSystemTypeError, "The number system type \"bork\" is invalid"}
-}
insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
imported_*
tables for a we
iex> archive_filename("plausible.io", _created_on = ~D[2024-12-31])
+
iex> archive_filename("plausible.io", _created_on = ~D[2024-12-31])
"plausible_io_20241231.zip"
imported_*
tables for a we
iex> content_disposition("plausible_io_20241231.zip")
+
iex> content_disposition("plausible_io_20241231.zip")
"attachment; filename=\"plausible_io_20241231.zip\""
-iex> content_disposition("📊.zip")
+iex> content_disposition("📊.zip")
"attachment; filename=\"plausible-export.zip\"; filename*=utf-8''%F0%9F%93%8A.zip"
imported_*
tables for a we
diff --git a/Plausible.Factory.html b/Plausible.Factory.html
index 0c056c9d4..ccf3a1da6 100644
--- a/Plausible.Factory.html
+++ b/Plausible.Factory.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Funnel.Const.html b/Plausible.Funnel.Const.html
index 734691601..ef03e8592 100644
--- a/Plausible.Funnel.Const.html
+++ b/Plausible.Funnel.Const.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Funnel.Step.html b/Plausible.Funnel.Step.html
index 50d8bd8e9..12e96763f 100644
--- a/Plausible.Funnel.Step.html
+++ b/Plausible.Funnel.Step.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Funnel.html b/Plausible.Funnel.html
index 7fd70a62f..94e73f3e5 100644
--- a/Plausible.Funnel.html
+++ b/Plausible.Funnel.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Funnels.html b/Plausible.Funnels.html
index 3c42da133..f6aaeed90 100644
--- a/Plausible.Funnels.html
+++ b/Plausible.Funnels.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Geo.html b/Plausible.Geo.html
index c68592409..f983a1330 100644
--- a/Plausible.Geo.html
+++ b/Plausible.Geo.html
@@ -14,7 +14,7 @@
-
+
@@ -260,8 +260,8 @@ and MaxMind license key.{:ok, pool} = Ch.start_link(pool_size: 1)
+
+ |> stream_archive(export_queries(_site_id = 1), format: "CSVWithNames")
+ |> Stream.into(File.stream!("export.zip"))
+ |> Stream.run()
+end){:ok, pool} = Ch.start_link(pool_size: 1)
-DBConnection.run(pool, fn conn ->
+DBConnection.run(pool, fn conn ->
conn
- |> stream_archive(export_queries(_site_id = 1), format: "CSVWithNames")
- |> Stream.into(File.stream!("export.zip"))
- |> Stream.run()
-end)
iex> database_type()
-"DBIP-City-Lite"
iex> database_type()
+
iex> database_type()
+"DBIP-City-Lite"
@@ -302,8 +302,8 @@ asynchronously.iex> database_type()
"GeoLite2-City"
Examples
-iex> load_db(path: "/etc/plausible/dbip-city.mmdb")
-:ok
iex> load_db(license_key: "LNpsJCCKPis6XvBP", edition: "GeoLite2-City", async: true)
+
iex> load_db(path: "/etc/plausible/dbip-city.mmdb")
+:ok
@@ -332,21 +332,21 @@ asynchronously.iex> load_db(license_key: "LNpsJCCKPis6XvBP", edition: "GeoLite2-City", async: true)
:ok
Examples
-
diff --git a/Plausible.Goal.Revenue.html b/Plausible.Goal.Revenue.html
index 2cd8b4a6e..6e3da5f41 100644
--- a/Plausible.Goal.Revenue.html
+++ b/Plausible.Goal.Revenue.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Goal.html b/Plausible.Goal.html
index 429802c85..990a20f8d 100644
--- a/Plausible.Goal.html
+++ b/Plausible.Goal.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Goals.html b/Plausible.Goals.html
index a40e6f5e7..c3c788919 100644
--- a/Plausible.Goals.html
+++ b/Plausible.Goals.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Google.API.Mock.html b/Plausible.Google.API.Mock.html
index 473cbf1c2..067d4f597 100644
--- a/Plausible.Google.API.Mock.html
+++ b/Plausible.Google.API.Mock.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Google.API.html b/Plausible.Google.API.html
index eb3090c0e..bffb0ce93 100644
--- a/Plausible.Google.API.html
+++ b/Plausible.Google.API.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Google.GA4.API.html b/Plausible.Google.GA4.API.html
index 7c8e97ad0..63d0a2e75 100644
--- a/Plausible.Google.GA4.API.html
+++ b/Plausible.Google.GA4.API.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Google.GA4.HTTP.html b/Plausible.Google.GA4.HTTP.html
index bc7d68a73..90a0ccc49 100644
--- a/Plausible.Google.GA4.HTTP.html
+++ b/Plausible.Google.GA4.HTTP.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Google.GA4.ReportRequest.html b/Plausible.Google.GA4.ReportRequest.html
index e8beae104..82240c08f 100644
--- a/Plausible.Google.GA4.ReportRequest.html
+++ b/Plausible.Google.GA4.ReportRequest.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Google.HTTP.html b/Plausible.Google.HTTP.html
index b3d300d65..e5530da0d 100644
--- a/Plausible.Google.HTTP.html
+++ b/Plausible.Google.HTTP.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.HTTPClient.Interface.html b/Plausible.HTTPClient.Interface.html
index e610acef1..b61bdd07e 100644
--- a/Plausible.HTTPClient.Interface.html
+++ b/Plausible.HTTPClient.Interface.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.HTTPClient.Non200Error.html b/Plausible.HTTPClient.Non200Error.html
index 3d0cd3c05..cd5d5e244 100644
--- a/Plausible.HTTPClient.Non200Error.html
+++ b/Plausible.HTTPClient.Non200Error.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.HTTPClient.html b/Plausible.HTTPClient.html
index de923b3e6..2e6289e9a 100644
--- a/Plausible.HTTPClient.html
+++ b/Plausible.HTTPClient.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.HelpScout.Vault.html b/Plausible.HelpScout.Vault.html
index d00f9cbcf..a1ae6b47a 100644
--- a/Plausible.HelpScout.Vault.html
+++ b/Plausible.HelpScout.Vault.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.HelpScout.html b/Plausible.HelpScout.html
index 7c6c5551e..81c9e6ce2 100644
--- a/Plausible.HelpScout.html
+++ b/Plausible.HelpScout.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Helpers.JSON.html b/Plausible.Helpers.JSON.html
index fdb071564..61b93f46a 100644
--- a/Plausible.Helpers.JSON.html
+++ b/Plausible.Helpers.JSON.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.ImportDeletionRepo.html b/Plausible.ImportDeletionRepo.html
index dbb78cf92..e188df321 100644
--- a/Plausible.ImportDeletionRepo.html
+++ b/Plausible.ImportDeletionRepo.html
@@ -14,7 +14,7 @@
-
+
@@ -1153,23 +1153,23 @@ pool to disconnect within the given interval.iex> lookup("8.7.6.5")
-%{
- "city" => %{
+
+ }
+ }
+ ]
+}iex> lookup("8.7.6.5")
+%{
+ "city" => %{
"geoname_id" => 5349755,
- "names" => %{
+ "names" => %{
"de" => "Fontana",
"en" => "Fontana",
"ja" => "フォンタナ",
"ru" => "Фонтана"
- }
- },
- "continent" => %{
+ }
+ },
+ "continent" => %{
"code" => "NA",
"geoname_id" => 6255149,
- "names" => %{
+ "names" => %{
"de" => "Nordamerika",
"en" => "North America",
"es" => "Norteamérica",
@@ -355,12 +355,12 @@ asynchronously.
"pt-BR" => "América do Norte",
"ru" => "Северная Америка",
"zh-CN" => "北美洲"
- }
- },
- "country" => %{
+ }
+ },
+ "country" => %{
"geoname_id" => 6252001,
"iso_code" => "US",
- "names" => %{
+ "names" => %{
"de" => "Vereinigte Staaten",
"en" => "United States",
"es" => "Estados Unidos",
@@ -369,20 +369,20 @@ asynchronously.
"pt-BR" => "EUA",
"ru" => "США",
"zh-CN" => "美国"
- }
- },
- "location" => %{
+ }
+ },
+ "location" => %{
"accuracy_radius" => 50,
"latitude" => 34.1211,
"longitude" => -117.4362,
"metro_code" => 803,
"time_zone" => "America/Los_Angeles"
- },
- "postal" => %{"code" => "92336"},
- "registered_country" => %{
+ },
+ "postal" => %{"code" => "92336"},
+ "registered_country" => %{
"geoname_id" => 6252001,
"iso_code" => "US",
- "names" => %{
+ "names" => %{
"de" => "Vereinigte Staaten",
"en" => "United States",
"es" => "Estados Unidos",
@@ -391,13 +391,13 @@ asynchronously.
"pt-BR" => "EUA",
"ru" => "США",
"zh-CN" => "美国"
- }
- },
- "subdivisions" => [
- %{
+ }
+ },
+ "subdivisions" => [
+ %{
"geoname_id" => 5332921,
"iso_code" => "CA",
- "names" => %{
+ "names" => %{
"de" => "Kalifornien",
"en" => "California",
"es" => "California",
@@ -406,10 +406,10 @@ asynchronously.
"pt-BR" => "Califórnia",
"ru" => "Калифорния",
"zh-CN" => "加州"
- }
- }
- ]
-}
insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
iex> date_range([
+...> %{"filename" => "imported_devices_20190101_20210101.csv"},
...> "pages_20200101_20220101.csv"
-...> ])
-Date.range(~D[2019-01-01], ~D[2022-01-01])
+...> ])
+Date.range(~D[2019-01-01], ~D[2022-01-01])
-iex> date_range([])
+iex> date_range([])
nil
@@ -321,8 +321,8 @@ or from local storage for which it uses
-iex> extract_table("my_data.csv")
** (ArgumentError) invalid filename
-iex> extract_table("imported_devices_00010101_20250101.csv")
+iex> extract_table("imported_devices_00010101_20250101.csv")
"imported_devices"
-iex> extract_table("devices_00010101_20250101.csv")
+iex> extract_table("devices_00010101_20250101.csv")
"imported_devices"
$DATA_DIR
or $PERSISTENT_CACHE_DIR
(if set) and falls back to /tmpiex> local_dir = local_dir(_site_id = 37)
-iex> String.ends_with?(local_dir, "/plausible-imports/37")
+
$DATA_DIR
or $PERSISTENT_CACHE_DIR
(if set) and falls back to /tmp
@@ -382,14 +382,14 @@ or from local storage for which it uses iex> parse_filename!("my_data.csv")
+iex> local_dir = local_dir(_site_id = 37)
+iex> String.ends_with?(local_dir, "/plausible-imports/37")
true
+iex> parse_filename!("devices_00010101_20250101.csv")
+{"imported_devices", ~D[0001-01-01], ~D[2025-01-01]}iex> parse_filename!("my_data.csv")
** (ArgumentError) invalid filename
-iex> parse_filename!("imported_devices_00010101_20250101.csv")
-{"imported_devices", ~D[0001-01-01], ~D[2025-01-01]}
+iex> parse_filename!("imported_devices_00010101_20250101.csv")
+{"imported_devices", ~D[0001-01-01], ~D[2025-01-01]}
-iex> parse_filename!("devices_00010101_20250101.csv")
-{"imported_devices", ~D[0001-01-01], ~D[2025-01-01]}
iex> valid_filename?("my_data.csv")
false
-iex> valid_filename?("imported_devices_00010101_20250101.csv")
+iex> valid_filename?("imported_devices_00010101_20250101.csv")
true
-iex> valid_filename?("devices_00010101_20250101.csv")
+iex> valid_filename?("devices_00010101_20250101.csv")
true
Plausible.Workers.ImportAnalytics
worker sends an Oban.Notifier
message
-on completion, failure or transient failure of the import.{:ok, job} = Plausible.Imported.NoopImporter.new_import(
+on completion, failure or transient failure of the import.
{:ok, job} = Plausible.Imported.NoopImporter.new_import(
site,
user,
start_date: ~D[2005-01-01],
- end_date: Date.utc_today(),
+ end_date: Date.utc_today(),
# this option is necessary to setup the calling process as listener
listen?: true
-)
+)
-import_id = job.args[:import_id]
+import_id = job.args[:import_id]
-receive do
- {:notification, :analytics_imports_jobs, %{"event" => "complete", "import_id" => ^import_id}} ->
- IO.puts("Job completed")
+receive do
+ {:notification, :analytics_imports_jobs, %{"event" => "complete", "import_id" => ^import_id}} ->
+ IO.puts("Job completed")
- {:notification, :analytics_imports_jobs, %{"event" => "transient_fail", "import_id" => ^import_id}} ->
- IO.puts("Job failed transiently")
+ {:notification, :analytics_imports_jobs, %{"event" => "transient_fail", "import_id" => ^import_id}} ->
+ IO.puts("Job failed transiently")
- {:notification, :analytics_imports_jobs, %{"event" => "fail", "import_id" => ^import_id}} ->
- IO.puts("Job failed permanently")
-after
+ {:notification, :analytics_imports_jobs, %{"event" => "fail", "import_id" => ^import_id}} ->
+ IO.puts("Job failed permanently")
+after
15_000 ->
- IO.puts("Job didn't finish in 15 seconds")
-end
handle_info/2
.insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
config :plausible, Plausible.S3,
- exports_bucket: System.fetch_env!("S3_EXPORTS_BUCKET")
iex> exports_bucket()
+ exports_bucket: System.fetch_env!("S3_EXPORTS_BUCKET")
@@ -348,8 +348,8 @@ The URL expires in 300 seconds, which should be enough for a redirect.iex> exports_bucket()
"test-exports"
access_key_id
and secret_access_key
to be used by ClickHouse during imports from S3.
+iex> import_clickhouse_credentials()
-%{access_key_id: "minioadmin", secret_access_key: "minioadmin"}
access_key_id
and secret_access_key
to be used by ClickHouse during imports from S3.iex> import_clickhouse_credentials()
+%{access_key_id: "minioadmin", secret_access_key: "minioadmin"}
In
Presigns an upload for an imported file. In the current implementation the bucket always goes into the path component. Example: Presigns an upload for an imported file. In the current implementation the bucket always goes into the path component. Example:
+iex> upload = import_presign_upload(_site_id = 123, _filename = "imported_browsers.csv")
-iex> true = String.ends_with?(upload.s3_url, "/test-imports/123/imported_browsers.csv")
-iex> true = String.contains?(upload.presigned_url, "/test-imports/123/imported_browsers.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&")
iex> upload = import_presign_upload(_site_id = 123, _filename = "imported_browsers.csv")
+iex> true = String.ends_with?(upload.s3_url, "/test-imports/123/imported_browsers.csv")
+iex> true = String.contains?(upload.presigned_url, "/test-imports/123/imported_browsers.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&")
In
Returns the pre-configured S3 bucket for CSV imports.
config :plausible, Plausible.S3,
- imports_bucket: System.fetch_env!("S3_IMPORTS_BUCKET")
Example:
iex> imports_bucket()
+ imports_bucket: System.fetch_env!("S3_IMPORTS_BUCKET")
Example:
iex> imports_bucket()
"test-imports"
diff --git a/Plausible.Sentry.Client.html b/Plausible.Sentry.Client.html
index 2992a00b7..51cc2766c 100644
--- a/Plausible.Sentry.Client.html
+++ b/Plausible.Sentry.Client.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.SentryFilter.html b/Plausible.SentryFilter.html
index f3caf45d8..19115d1a9 100644
--- a/Plausible.SentryFilter.html
+++ b/Plausible.SentryFilter.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Session.CacheStore.html b/Plausible.Session.CacheStore.html
index 4d5831f7e..b5b54014d 100644
--- a/Plausible.Session.CacheStore.html
+++ b/Plausible.Session.CacheStore.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Session.Salts.html b/Plausible.Session.Salts.html
index efca0384d..b13ec633f 100644
--- a/Plausible.Session.Salts.html
+++ b/Plausible.Session.Salts.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.CountryRule.html b/Plausible.Shield.CountryRule.html
index 3c106b997..3177346f1 100644
--- a/Plausible.Shield.CountryRule.html
+++ b/Plausible.Shield.CountryRule.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.CountryRuleCache.html b/Plausible.Shield.CountryRuleCache.html
index 2f0962403..f3154c2f8 100644
--- a/Plausible.Shield.CountryRuleCache.html
+++ b/Plausible.Shield.CountryRuleCache.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.HostnameRule.html b/Plausible.Shield.HostnameRule.html
index a454d735e..8dcd16b5a 100644
--- a/Plausible.Shield.HostnameRule.html
+++ b/Plausible.Shield.HostnameRule.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.HostnameRuleCache.html b/Plausible.Shield.HostnameRuleCache.html
index 734791af7..f35e002e6 100644
--- a/Plausible.Shield.HostnameRuleCache.html
+++ b/Plausible.Shield.HostnameRuleCache.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.IPRule.html b/Plausible.Shield.IPRule.html
index e9c442a6d..d082c5de2 100644
--- a/Plausible.Shield.IPRule.html
+++ b/Plausible.Shield.IPRule.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.IPRuleCache.html b/Plausible.Shield.IPRuleCache.html
index 801b3c280..392f674e1 100644
--- a/Plausible.Shield.IPRuleCache.html
+++ b/Plausible.Shield.IPRuleCache.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.PageRule.html b/Plausible.Shield.PageRule.html
index a9ec1e0e7..f4e917b47 100644
--- a/Plausible.Shield.PageRule.html
+++ b/Plausible.Shield.PageRule.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shield.PageRuleCache.html b/Plausible.Shield.PageRuleCache.html
index 736554208..34d59b0a2 100644
--- a/Plausible.Shield.PageRuleCache.html
+++ b/Plausible.Shield.PageRuleCache.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Shields.html b/Plausible.Shields.html
index dae87369c..1af6f2d82 100644
--- a/Plausible.Shields.html
+++ b/Plausible.Shields.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Cache.html b/Plausible.Site.Cache.html
index a9be1134c..5093eb0ce 100644
--- a/Plausible.Site.Cache.html
+++ b/Plausible.Site.Cache.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Domain.html b/Plausible.Site.Domain.html
index dbfad9d76..45222c183 100644
--- a/Plausible.Site.Domain.html
+++ b/Plausible.Site.Domain.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.GateKeeper.html b/Plausible.Site.GateKeeper.html
index e0a2eb4d8..c63dbe92a 100644
--- a/Plausible.Site.GateKeeper.html
+++ b/Plausible.Site.GateKeeper.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.GoogleAuth.html b/Plausible.Site.GoogleAuth.html
index f5b155872..60c62eb23 100644
--- a/Plausible.Site.GoogleAuth.html
+++ b/Plausible.Site.GoogleAuth.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.ImportedData.html b/Plausible.Site.ImportedData.html
index 5eec642c5..b4a62147d 100644
--- a/Plausible.Site.ImportedData.html
+++ b/Plausible.Site.ImportedData.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Membership.html b/Plausible.Site.Membership.html
index 80813ce47..5248c6df3 100644
--- a/Plausible.Site.Membership.html
+++ b/Plausible.Site.Membership.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Memberships.AcceptInvitation.html b/Plausible.Site.Memberships.AcceptInvitation.html
index f75d8bc83..41c9b8222 100644
--- a/Plausible.Site.Memberships.AcceptInvitation.html
+++ b/Plausible.Site.Memberships.AcceptInvitation.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Memberships.CreateInvitation.html b/Plausible.Site.Memberships.CreateInvitation.html
index b2e4af7ca..6fb356765 100644
--- a/Plausible.Site.Memberships.CreateInvitation.html
+++ b/Plausible.Site.Memberships.CreateInvitation.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Memberships.RejectInvitation.html b/Plausible.Site.Memberships.RejectInvitation.html
index 50561b470..d7fcc01e8 100644
--- a/Plausible.Site.Memberships.RejectInvitation.html
+++ b/Plausible.Site.Memberships.RejectInvitation.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Memberships.RemoveInvitation.html b/Plausible.Site.Memberships.RemoveInvitation.html
index 31a25f0dc..e21237432 100644
--- a/Plausible.Site.Memberships.RemoveInvitation.html
+++ b/Plausible.Site.Memberships.RemoveInvitation.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Memberships.html b/Plausible.Site.Memberships.html
index a730d176f..67f1c3f6e 100644
--- a/Plausible.Site.Memberships.html
+++ b/Plausible.Site.Memberships.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.MonthlyReport.html b/Plausible.Site.MonthlyReport.html
index edfebbb6a..2436fc73e 100644
--- a/Plausible.Site.MonthlyReport.html
+++ b/Plausible.Site.MonthlyReport.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.Removal.html b/Plausible.Site.Removal.html
index d571b6dca..5867bb7e0 100644
--- a/Plausible.Site.Removal.html
+++ b/Plausible.Site.Removal.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.SharedLink.html b/Plausible.Site.SharedLink.html
index 4d2ffe9ab..4be10fc1c 100644
--- a/Plausible.Site.SharedLink.html
+++ b/Plausible.Site.SharedLink.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.TrafficChangeNotification.html b/Plausible.Site.TrafficChangeNotification.html
index 5c5f62853..6316bcad1 100644
--- a/Plausible.Site.TrafficChangeNotification.html
+++ b/Plausible.Site.TrafficChangeNotification.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.UserPreference.html b/Plausible.Site.UserPreference.html
index 2b78bf0b8..8257c142b 100644
--- a/Plausible.Site.UserPreference.html
+++ b/Plausible.Site.UserPreference.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.WeeklyReport.html b/Plausible.Site.WeeklyReport.html
index c2421aaee..b06803113 100644
--- a/Plausible.Site.WeeklyReport.html
+++ b/Plausible.Site.WeeklyReport.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.Site.html b/Plausible.Site.html
index 39e2659a9..1cb85d0e9 100644
--- a/Plausible.Site.html
+++ b/Plausible.Site.html
@@ -14,7 +14,7 @@
-
+
diff --git a/Plausible.SiteAdmin.html b/Plausible.SiteAdmin.html
index f9eb614bc..ff630eb9a 100644
--- a/Plausible.SiteAdmin.html
+++ b/Plausible.SiteAdmin.html
@@ -14,7 +14,7 @@
-
+
@@ -279,7 +279,7 @@ Pages
iex> Filters.parse("{\"page\":\"/blog/**\"}")
-[[:matches, "event:page", ["/blog/**"]]]
+iex> Filters.parse("{\"page\":\"/blog/**\"}")
+[[:matches, "event:page", ["/blog/**"]]]
-iex> Filters.parse("visit:browser!=Chrome")
-[[:is_not, "visit:browser", ["Chrome"]]]
+iex> Filters.parse("visit:browser!=Chrome")
+[[:is_not, "visit:browser", ["Chrome"]]]
-iex> Filters.parse(nil)
-[]
+iex> Filters.parse(nil)
+[]
not_before
is returned. > this_wednesday = ~D[2022-11-09]
> past_saturday = ~D[2022-11-05]
- > weekstart_not_before(this_wednesday, past_saturday)
+ > weekstart_not_before(this_wednesday, past_saturday)
~D[2022-11-07]
In this other example, the fragment returns Tuesday and not the weekstart.
The not_before
boundary is set to Tuesday, which is past the weekstart,
therefore the cap applies.
> this_wednesday = ~D[2022-11-09]
> this_tuesday = ~D[2022-11-08]
- > weekstart_not_before(this_wednesday, this_tuesday)
+ > weekstart_not_before(this_wednesday, this_tuesday)
~D[2022-11-08]
+#cCmIMo#^qoWq82 )?18OqLSt$x`5fG^&oSh@~womp{D`s>Wbz+j;?`N!_c6{+hZ_gFR
zU{PDnTf|DE-U2L-wRo&?YM|xDb9*nkjnZf-77=$vS%Q6H&x0=2JVEZUWTX}tvXP--
zjpcL5+_;$Qdu+Q@vQrp~c#@9b-*m{?mE!xRL#(h?9`g=S>!`6+RZWsVn=@`jkfIl`
z-<3wIiI_Y=y070HXh3cg>C{v^H+w(L$**2|bh#dGwz&AgJ33=U>DD^$jOTMyjM++g
zc1?nJ&z=Z2$U~Juj)5xH*Z9F_LkE5HnxGGlgLT$L1-#e*>uAEmT6yvLSssQg2OjcA
zI_c88^t8DB hU7I7xr?41CdwIWWon1=3yg$*pS}_UKtkbv`fJsy6!j
z&KUi#5OCW62t~L5BNSB)j4#n+{YNO0OMNF48UG^`A-ofcLj4{RlHU151WK_{oT0g*
z@g7oJxesKgBL}jHq6JB))x&9}+>elO&X}!Ri!2d|B6@EEipqLI!x3l?pf&-Fv2c=J
z`3O}YJN|yutfQl3;Vx4*QZN_yqgOva6_q`tb#$Uy(L4cMpK$ZkNfuu%Inmz1HfL?n
z9yt*bRsXINlPqkO)0n&NHpqbT$89tp!$eBIA+g?g?+_f99p52dQo2=P0LEthkM&i@
z+d1yX(;AE;59ye+qDS(2P_piw@2&SGmh5_QMr(*dFJn8D&*v((EZ>y|s2_2s28bQw
z{oP!}xAKHZ*o8k~vmIAnsy|nU4Kea@ZHCz~&Jx@ocQ3;~mhX}O9?K$xTwtPMKsqmg
z=+N04pxeLnFkku$f4)CQw}>zxI5)`u>GWZvAwgWQ(GZ|PKY
$57e9=e6kb@;r{cWC%7pqxdzeQy?ZKyPqS=$uVLBOm0Ne9W0TR8@(q(
z_kl0mdytZU3+!`+`E&My79NQ+<{>=`h6@u?_^<)l1H5fHlsOx-U^D@9sFi~~Eyyz*
zMnkY_+Q(`Pkny~5hpIuHB3_Uf(1y*#Q#FfX*>dU
yBXVJY#)U@iK?VgA1(atNJLN^cp?a?I?MthaymcRVajh|B
zrm%x>>p^+6J)FbX(QS=3T?blS4L<42mpN(
_~u0ck*qV&BJMdz4MR