From c99cfcbf0fb5665a7796dbf26e7329075285fc78 Mon Sep 17 00:00:00 2001 From: Emmanuel Rondan <55039343+emarondan@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:38:42 -0300 Subject: [PATCH] Drop support for Python 3.8 and lower, add pre-commit --- .bandit.yml | 6 + .flake8 | 2 + .git-blame-ignore-revs | 2 + .github/workflows/main.yml | 14 +- .gitignore | 6 + .isort.cfg | 2 + .pre-commit-config.yaml | 18 + price_parser/__init__.py | 2 +- price_parser/_currencies.py | 441 ++-- price_parser/parser.py | 283 ++- setup.py | 47 +- tests/test_price_parsing.py | 3758 +++++++++++++---------------------- tox.ini | 5 + 13 files changed, 1842 insertions(+), 2744 deletions(-) create mode 100644 .bandit.yml create mode 100644 .flake8 create mode 100644 .git-blame-ignore-revs create mode 100644 .isort.cfg create mode 100644 .pre-commit-config.yaml diff --git a/.bandit.yml b/.bandit.yml new file mode 100644 index 0000000..9308817 --- /dev/null +++ b/.bandit.yml @@ -0,0 +1,6 @@ +skips: +- B101 # assert_used, needed for mypy +- B311 +- B320 +- B410 +exclude_dirs: ['tests'] \ No newline at end of file diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..1d36346 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 88 \ No newline at end of file diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..6537f1f --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# applying pre-commit hooks to the project +ca42e4247d872a174afc539902e156282940ad5d \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fafed84..859c4bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,13 +10,7 @@ jobs: fail-fast: false matrix: include: - - python-version: "3.6" - env: - TOXENV: py - - python-version: "3.7" - env: - TOXENV: py - - python-version: "3.8" + - python-version: "3.9" env: TOXENV: py - python-version: "3.9" @@ -49,3 +43,9 @@ jobs: run: | pip install -U tox tox + + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pre-commit/action@v3.0.0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7f549c7..68477d1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,9 @@ .tox/ .pytest_cache/ .coverage + +# python virtual env +.venv/ +venv/ +.env/ +env/ diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..6860bdb --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +profile = black \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3503b3a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +repos: +- repo: https://github.com/PyCQA/bandit + rev: 1.7.9 + hooks: + - id: bandit + args: [-r, -c, .bandit.yml] +- repo: https://github.com/psf/black.git + rev: 24.8.0 + hooks: + - id: black +- repo: https://github.com/PyCQA/flake8 + rev: 7.1.1 + hooks: + - id: flake8 +- repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort \ No newline at end of file diff --git a/price_parser/__init__.py b/price_parser/__init__.py index 6654e0d..ee77f65 100644 --- a/price_parser/__init__.py +++ b/price_parser/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -from .parser import Price, parse_price +from .parser import Price, parse_price # noqa F401 diff --git a/price_parser/_currencies.py b/price_parser/_currencies.py index a6563aa..b39e87b 100644 --- a/price_parser/_currencies.py +++ b/price_parser/_currencies.py @@ -23,9 +23,8 @@ Some extra abbreviations are added to the list (they are set below ``CURRENCIES`` variable, scroll to the bottom). """ -from typing import List, Dict from itertools import chain - +from typing import Dict, List CURRENCIES: Dict[str, Dict] = { "AED": { @@ -34,7 +33,7 @@ "sn": "د.إ.‏", "d": 2, "r": 0, - "np": "UAE dirhams" + "np": "UAE dirhams", }, "AFN": { "s": "Af", @@ -42,7 +41,7 @@ "sn": "؋", "d": 0, "r": 0, - "np": "Afghan Afghanis" + "np": "Afghan Afghanis", }, "ALL": { "s": "ALL", @@ -50,7 +49,7 @@ "sn": "Lek", "d": 0, "r": 0, - "np": "Albanian lekë" + "np": "Albanian lekë", }, "AMD": { "s": "AMD", @@ -58,7 +57,7 @@ "sn": "դր.", "d": 0, "r": 0, - "np": "Armenian drams" + "np": "Armenian drams", }, "ANG": { "s": "ƒ", @@ -66,7 +65,7 @@ "sn": "ƒ", "d": 2, "r": 0, - "np": "Netherlands Antilles Guilder" + "np": "Netherlands Antilles Guilder", }, "AOA": { "s": "Kz", @@ -74,7 +73,7 @@ "sn": "Kz", "d": 2, "r": 0, - "np": "Angolan kwanza" + "np": "Angolan kwanza", }, "ARS": { "s": "AR$", @@ -82,7 +81,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Argentine pesos" + "np": "Argentine pesos", }, "AUD": { "s": "AU$", @@ -90,7 +89,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Australian dollars" + "np": "Australian dollars", }, "AWG": { "s": "ƒ", @@ -98,7 +97,7 @@ "sn": "ƒ", "d": 2, "r": 0, - "np": "Aruban Guilders" + "np": "Aruban Guilders", }, "AFL": { "s": "Afl.", @@ -106,7 +105,7 @@ "sn": "Afl.", "d": 2, "r": 0, - "np": "Aruban Florins" + "np": "Aruban Florins", }, "AZN": { "s": "man.", @@ -114,7 +113,7 @@ "sn": "ман.", "d": 2, "r": 0, - "np": "Azerbaijani manats" + "np": "Azerbaijani manats", }, "BAM": { "s": "KM", @@ -122,7 +121,7 @@ "sn": "KM", "d": 2, "r": 0, - "np": "Bosnia-Herzegovina convertible marks" + "np": "Bosnia-Herzegovina convertible marks", }, "BDT": { "s": "Tk", @@ -130,7 +129,7 @@ "sn": "৳", "d": 2, "r": 0, - "np": "Bangladeshi takas" + "np": "Bangladeshi takas", }, "BBD": { "s": "Bds$", @@ -138,7 +137,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Barbados dollar" + "np": "Barbados dollar", }, "BGN": { "s": "BGN", @@ -146,7 +145,7 @@ "sn": "лв.", "d": 2, "r": 0, - "np": "Bulgarian leva" + "np": "Bulgarian leva", }, "BHD": { "s": "BD", @@ -154,7 +153,7 @@ "sn": "د.ب.‏", "d": 3, "r": 0, - "np": "Bahraini dinars" + "np": "Bahraini dinars", }, "BIF": { "s": "FBu", @@ -162,7 +161,7 @@ "sn": "FBu", "d": 0, "r": 0, - "np": "Burundian francs" + "np": "Burundian francs", }, "BSD": { "s": "$", @@ -170,7 +169,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Bahamas Dollar" + "np": "Bahamas Dollar", }, "BMD": { "s": "$", @@ -178,7 +177,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Bermuda Dollars" + "np": "Bermuda Dollars", }, "BND": { "s": "BN$", @@ -186,7 +185,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Brunei dollars" + "np": "Brunei dollars", }, "BOB": { "s": "Bs", @@ -194,7 +193,7 @@ "sn": "Bs", "d": 2, "r": 0, - "np": "Bolivian bolivianos" + "np": "Bolivian bolivianos", }, "BOV": { "s": "-", @@ -202,7 +201,7 @@ "sn": "-", "d": 2, "r": 0, - "np": "Bolivian Mvdol" + "np": "Bolivian Mvdol", }, "BRL": { "s": "R$", @@ -210,7 +209,7 @@ "sn": "R$", "d": 2, "r": 0, - "np": "Brazilian reals" + "np": "Brazilian reals", }, "BTN": { "s": "Nu.", @@ -218,7 +217,7 @@ "sn": "Nu.", "d": 2, "r": 0, - "np": "Bhutanese ngultrum" + "np": "Bhutanese ngultrum", }, "BWP": { "s": "BWP", @@ -226,7 +225,7 @@ "sn": "P", "d": 2, "r": 0, - "np": "Botswanan pulas" + "np": "Botswanan pulas", }, "BYN": { "s": "Br", @@ -234,7 +233,7 @@ "sn": "Br", "d": 0, "r": 0, - "np": "Belarusian rubles" + "np": "Belarusian rubles", }, "BZD": { "s": "BZ$", @@ -242,7 +241,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Belize dollars" + "np": "Belize dollars", }, "CAD": { "s": "CA$", @@ -250,7 +249,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Canadian dollars" + "np": "Canadian dollars", }, "CDF": { "s": "CDF", @@ -258,7 +257,7 @@ "sn": "FrCD", "d": 2, "r": 0, - "np": "Congolese francs" + "np": "Congolese francs", }, "CHE": { "s": "-", @@ -266,7 +265,7 @@ "sn": "-", "d": 2, "r": 0, - "np": "WIR Euros (complementary currency)" + "np": "WIR Euros (complementary currency)", }, "CHF": { "s": "CHF", @@ -274,7 +273,7 @@ "sn": "CHF", "d": 2, "r": 0.05, - "np": "Swiss francs" + "np": "Swiss francs", }, "CHW": { "s": "-", @@ -282,7 +281,7 @@ "sn": "-", "d": 2, "r": 0, - "np": "WIR Franc (complementary currency)" + "np": "WIR Franc (complementary currency)", }, "CLF": { "s": "UF", @@ -290,7 +289,7 @@ "sn": "UF", "d": 4, "r": 0, - "np": "Unidad de Fomento (funds code)" + "np": "Unidad de Fomento (funds code)", }, "CLP": { "s": "CL$", @@ -298,7 +297,7 @@ "sn": "$", "d": 0, "r": 0, - "np": "Chilean pesos" + "np": "Chilean pesos", }, "CNY": { "s": "CN¥", @@ -306,7 +305,7 @@ "sn": "CN¥", "d": 2, "r": 0, - "np": "Chinese yuan" + "np": "Chinese yuan", }, "COP": { "s": "CO$", @@ -314,7 +313,7 @@ "sn": "$", "d": 0, "r": 0, - "np": "Colombian pesos" + "np": "Colombian pesos", }, "COU": { "s": "-", @@ -322,7 +321,7 @@ "sn": "-", "d": 2, "r": 0, - "np": "Unidad de Valor Real (UVR) (funds code)" + "np": "Unidad de Valor Real (UVR) (funds code)", }, "CRC": { "s": "₡", @@ -330,7 +329,7 @@ "sn": "₡", "d": 0, "r": 0, - "np": "Costa Rican colóns" + "np": "Costa Rican colóns", }, "CUC": { "s": "CUC$", @@ -338,7 +337,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Cuban convertible pesos" + "np": "Cuban convertible pesos", }, "CUP": { "s": "₱", @@ -346,7 +345,7 @@ "sn": "₱", "d": 0, "r": 0, - "np": "Cuba Pesos" + "np": "Cuba Pesos", }, "CVE": { "s": "CV$", @@ -354,7 +353,7 @@ "sn": "CV$", "d": 0, "r": 0, - "np": "Cape Verdean escudos" + "np": "Cape Verdean escudos", }, "CZK": { "s": "Kč", @@ -362,7 +361,7 @@ "sn": "Kč", "d": 2, "r": 0, - "np": "Czech Republic korunas" + "np": "Czech Republic korunas", }, "DJF": { "s": "Fdj", @@ -370,7 +369,7 @@ "sn": "Fdj", "d": 0, "r": 0, - "np": "Djiboutian francs" + "np": "Djiboutian francs", }, "DKK": { "s": "Dkr", @@ -378,7 +377,7 @@ "sn": "kr", "d": 2, "r": 0, - "np": "Danish kroner" + "np": "Danish kroner", }, "DOP": { "s": "RD$", @@ -386,7 +385,7 @@ "sn": "RD$", "d": 2, "r": 0, - "np": "Dominican pesos" + "np": "Dominican pesos", }, "DZD": { "s": "DA", @@ -394,7 +393,7 @@ "sn": "د.ج.‏", "d": 2, "r": 0, - "np": "Algerian dinars" + "np": "Algerian dinars", }, "EEK": { "s": "Ekr", @@ -402,7 +401,7 @@ "sn": "kr", "d": 2, "r": 0, - "np": "Estonian kroons" + "np": "Estonian kroons", }, "EGP": { "s": "EGP", @@ -410,7 +409,7 @@ "sn": "ج.م.‏", "d": 2, "r": 0, - "np": "Egyptian pounds" + "np": "Egyptian pounds", }, "ERN": { "s": "Nfk", @@ -418,7 +417,7 @@ "sn": "Nfk", "d": 2, "r": 0, - "np": "Eritrean nakfas" + "np": "Eritrean nakfas", }, "ETB": { "s": "Br", @@ -426,23 +425,16 @@ "sn": "Br", "d": 2, "r": 0, - "np": "Ethiopian birrs" - }, - "EUR": { - "s": "€", - "n": "Euro", - "sn": "€", - "d": 2, - "r": 0, - "np": "euros" + "np": "Ethiopian birrs", }, + "EUR": {"s": "€", "n": "Euro", "sn": "€", "d": 2, "r": 0, "np": "euros"}, "FJD": { "s": "$", "n": "Fiji Dollar", "sn": "$", "d": 2, "r": 0, - "np": "Fiji Dollars" + "np": "Fiji Dollars", }, "FKP": { "s": "£", @@ -450,7 +442,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Falkland Islands (Malvinas) Pound" + "np": "Falkland Islands (Malvinas) Pound", }, "GBP": { "s": "£", @@ -458,7 +450,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "British pounds sterling" + "np": "British pounds sterling", }, "GEL": { "s": "GEL", @@ -466,7 +458,7 @@ "sn": "GEL", "d": 2, "r": 0, - "np": "Georgian laris" + "np": "Georgian laris", }, "GGP": { "s": "£", @@ -474,7 +466,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Guernsey Pounds" + "np": "Guernsey Pounds", }, "GHS": { "s": "GH₵", @@ -482,7 +474,7 @@ "sn": "GH₵", "d": 2, "r": 0, - "np": "Ghanaian cedis" + "np": "Ghanaian cedis", }, "GIP": { "s": "£", @@ -490,7 +482,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Gibraltar Pounds" + "np": "Gibraltar Pounds", }, "GMD": { "s": "D", @@ -498,7 +490,7 @@ "sn": "D", "d": 2, "r": 0, - "np": "Gambian dalasi" + "np": "Gambian dalasi", }, "GNF": { "s": "FG", @@ -506,7 +498,7 @@ "sn": "FG", "d": 0, "r": 0, - "np": "Guinean francs" + "np": "Guinean francs", }, "GTQ": { "s": "GTQ", @@ -514,7 +506,7 @@ "sn": "Q", "d": 2, "r": 0, - "np": "Guatemalan quetzals" + "np": "Guatemalan quetzals", }, "GYD": { "s": "$", @@ -522,7 +514,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Guyana Dollars" + "np": "Guyana Dollars", }, "HKD": { "s": "HK$", @@ -530,7 +522,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Hong Kong dollars" + "np": "Hong Kong dollars", }, "HNL": { "s": "HNL", @@ -538,7 +530,7 @@ "sn": "L", "d": 2, "r": 0, - "np": "Honduran lempiras" + "np": "Honduran lempiras", }, "HRK": { "s": "kn", @@ -546,7 +538,7 @@ "sn": "kn", "d": 2, "r": 0, - "np": "Croatian kunas" + "np": "Croatian kunas", }, "HTG": { "s": "G", @@ -554,7 +546,7 @@ "sn": "G", "d": 2, "r": 0, - "np": "Haitian gourde" + "np": "Haitian gourde", }, "HUF": { "s": "Ft", @@ -562,7 +554,7 @@ "sn": "Ft", "d": 0, "r": 0, - "np": "Hungarian forints" + "np": "Hungarian forints", }, "IDR": { "s": "Rp", @@ -570,7 +562,7 @@ "sn": "Rp", "d": 0, "r": 0, - "np": "Indonesian rupiahs" + "np": "Indonesian rupiahs", }, "ILS": { "s": "₪", @@ -578,7 +570,7 @@ "sn": "₪", "d": 2, "r": 0, - "np": "Israeli new sheqels" + "np": "Israeli new sheqels", }, "IMP": { "s": "£", @@ -586,7 +578,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Isle of Man Pounds" + "np": "Isle of Man Pounds", }, "INR": { "s": "Rs", @@ -594,7 +586,7 @@ "sn": "টকা", "d": 2, "r": 0, - "np": "Indian rupees" + "np": "Indian rupees", }, "IQD": { "s": "IQD", @@ -602,7 +594,7 @@ "sn": "د.ع.‏", "d": 3, "r": 0, - "np": "Iraqi dinars" + "np": "Iraqi dinars", }, "IRR": { "s": "IRR", @@ -610,7 +602,7 @@ "sn": "﷼", "d": 0, "r": 0, - "np": "Iranian rials" + "np": "Iranian rials", }, "ISK": { "s": "Ikr", @@ -618,7 +610,7 @@ "sn": "kr", "d": 0, "r": 0, - "np": "Icelandic krónur" + "np": "Icelandic krónur", }, "JEP": { "s": "£", @@ -626,7 +618,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Jersey Pounds" + "np": "Jersey Pounds", }, "JMD": { "s": "J$", @@ -634,7 +626,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Jamaican dollars" + "np": "Jamaican dollars", }, "JOD": { "s": "JD", @@ -642,7 +634,7 @@ "sn": "د.أ.‏", "d": 3, "r": 0, - "np": "Jordanian dinars" + "np": "Jordanian dinars", }, "JPY": { "s": "¥", @@ -651,7 +643,7 @@ "sn2": ["円"], "d": 0, "r": 0, - "np": "Japanese yen" + "np": "Japanese yen", }, "KES": { "s": "Ksh", @@ -659,7 +651,7 @@ "sn": "Ksh", "d": 2, "r": 0, - "np": "Kenyan shillings" + "np": "Kenyan shillings", }, "KGS": { "s": "лв", @@ -667,7 +659,7 @@ "sn": "лв", "d": 2, "r": 0, - "np": "Kyrgyzstan Som" + "np": "Kyrgyzstan Som", }, "KHR": { "s": "KHR", @@ -675,7 +667,7 @@ "sn": "៛", "d": 2, "r": 0, - "np": "Cambodian riels" + "np": "Cambodian riels", }, "KMF": { "s": "CF", @@ -683,7 +675,7 @@ "sn": "FC", "d": 0, "r": 0, - "np": "Comorian francs" + "np": "Comorian francs", }, "KPW": { "s": "₩", @@ -691,7 +683,7 @@ "sn": "원", "d": 0, "r": 0, - "np": "North Korean Won" + "np": "North Korean Won", }, "KRW": { "s": "₩", @@ -699,7 +691,7 @@ "sn": "원", "d": 0, "r": 0, - "np": "South Korean won" + "np": "South Korean won", }, "KWD": { "s": "KD", @@ -707,7 +699,7 @@ "sn": "د.ك.‏", "d": 3, "r": 0, - "np": "Kuwaiti dinars" + "np": "Kuwaiti dinars", }, "KYD": { "s": "$", @@ -715,7 +707,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Cayman Islands Dollars" + "np": "Cayman Islands Dollars", }, "KZT": { "s": "KZT", @@ -723,7 +715,7 @@ "sn": "тңг.", "d": 2, "r": 0, - "np": "Kazakhstani tenges" + "np": "Kazakhstani tenges", }, "LAK": { "s": "₭", @@ -731,7 +723,7 @@ "sn": "₭", "d": 2, "r": 0, - "np": "Laos Kip" + "np": "Laos Kip", }, "LBP": { "s": "LB£", @@ -739,7 +731,7 @@ "sn": "ل.ل.‏", "d": 0, "r": 0, - "np": "Lebanese pounds" + "np": "Lebanese pounds", }, "LKR": { "s": "SLRs", @@ -747,7 +739,7 @@ "sn": "SL Re", "d": 2, "r": 0, - "np": "Sri Lankan rupees" + "np": "Sri Lankan rupees", }, "LRD": { "s": "$", @@ -755,7 +747,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Liberia Dollars" + "np": "Liberia Dollars", }, "LSL": { "s": "L", @@ -763,7 +755,7 @@ "sn": "L", "d": 2, "r": 0, - "np": "Lesotho loti" + "np": "Lesotho loti", }, "LTL": { "s": "Lt", @@ -771,7 +763,7 @@ "sn": "Lt", "d": 2, "r": 0, - "np": "Lithuanian litai" + "np": "Lithuanian litai", }, "LVL": { "s": "Ls", @@ -779,7 +771,7 @@ "sn": "Ls", "d": 2, "r": 0, - "np": "Latvian lati" + "np": "Latvian lati", }, "LYD": { "s": "LD", @@ -787,7 +779,7 @@ "sn": "د.ل.‏", "d": 3, "r": 0, - "np": "Libyan dinars" + "np": "Libyan dinars", }, "MAD": { "s": "MAD", @@ -795,7 +787,7 @@ "sn": "د.م.‏", "d": 2, "r": 0, - "np": "Moroccan dirhams" + "np": "Moroccan dirhams", }, "MDL": { "s": "MDL", @@ -803,7 +795,7 @@ "sn": "MDL", "d": 2, "r": 0, - "np": "Moldovan lei" + "np": "Moldovan lei", }, "MGA": { "s": "MGA", @@ -811,7 +803,7 @@ "sn": "MGA", "d": 0, "r": 0, - "np": "Malagasy Ariaries" + "np": "Malagasy Ariaries", }, "MKD": { "s": "MKD", @@ -819,7 +811,7 @@ "sn": "MKD", "d": 2, "r": 0, - "np": "Macedonian denari" + "np": "Macedonian denari", }, "MMK": { "s": "MMK", @@ -827,7 +819,7 @@ "sn": "K", "d": 0, "r": 0, - "np": "Myanma kyats" + "np": "Myanma kyats", }, "MNT": { "s": "₮", @@ -835,7 +827,7 @@ "sn": "₮", "d": 2, "r": 0, - "np": "Mongolia Tughrik" + "np": "Mongolia Tughrik", }, "MOP": { "s": "MOP$", @@ -843,7 +835,7 @@ "sn": "MOP$", "d": 2, "r": 0, - "np": "Macanese patacas" + "np": "Macanese patacas", }, "MRO": { "s": "UM", @@ -851,7 +843,7 @@ "sn": "UM", "d": 1, "r": 0, - "np": "Mauritanian ouguiya" + "np": "Mauritanian ouguiya", }, "MUR": { "s": "MURs", @@ -859,7 +851,7 @@ "sn": "MURs", "d": 0, "r": 0, - "np": "Mauritian rupees" + "np": "Mauritian rupees", }, "MVR": { "s": "MRf", @@ -867,7 +859,7 @@ "sn": "Rf", "d": 2, "r": 0, - "np": "Maldivian rufiyaa" + "np": "Maldivian rufiyaa", }, "MWK": { "s": "MK", @@ -875,7 +867,7 @@ "sn": "MK", "d": 2, "r": 0, - "np": "Malawian kwacha" + "np": "Malawian kwacha", }, "MXN": { "s": "MX$", @@ -883,7 +875,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Mexican pesos" + "np": "Mexican pesos", }, "MXV": { "s": "-", @@ -891,7 +883,7 @@ "sn": "-", "d": 2, "r": 0, - "np": "Mexican Unidad de Inversion (UDI) (funds code)" + "np": "Mexican Unidad de Inversion (UDI) (funds code)", }, "MYR": { "s": "RM", @@ -899,7 +891,7 @@ "sn": "RM", "d": 2, "r": 0, - "np": "Malaysian ringgits" + "np": "Malaysian ringgits", }, "MZN": { "s": "MTn", @@ -907,7 +899,7 @@ "sn": "MTn", "d": 2, "r": 0, - "np": "Mozambican meticals" + "np": "Mozambican meticals", }, "NAD": { "s": "N$", @@ -915,7 +907,7 @@ "sn": "N$", "d": 2, "r": 0, - "np": "Namibian dollars" + "np": "Namibian dollars", }, "NGN": { "s": "₦", @@ -923,7 +915,7 @@ "sn": "₦", "d": 2, "r": 0, - "np": "Nigerian nairas" + "np": "Nigerian nairas", }, "NIO": { "s": "C$", @@ -931,7 +923,7 @@ "sn": "C$", "d": 2, "r": 0, - "np": "Nicaraguan córdobas" + "np": "Nicaraguan córdobas", }, "NOK": { "s": "Nkr", @@ -939,7 +931,7 @@ "sn": "kr", "d": 2, "r": 0, - "np": "Norwegian kroner" + "np": "Norwegian kroner", }, "NPR": { "s": "NPRs", @@ -947,7 +939,7 @@ "sn": "नेरू", "d": 2, "r": 0, - "np": "Nepalese rupees" + "np": "Nepalese rupees", }, "PRB": { "s": "руб", @@ -955,7 +947,7 @@ "sn": "руб", "d": 2, "r": 0, - "np": "Transnistrian rubles" + "np": "Transnistrian rubles", }, "NZD": { "s": "NZ$", @@ -963,7 +955,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "New Zealand dollars" + "np": "New Zealand dollars", }, "OMR": { "s": "OMR", @@ -971,7 +963,7 @@ "sn": "ر.ع.‏", "d": 3, "r": 0, - "np": "Omani rials" + "np": "Omani rials", }, "PAB": { "s": "B/.", @@ -979,7 +971,7 @@ "sn": "B/.", "d": 2, "r": 0, - "np": "Panamanian balboas" + "np": "Panamanian balboas", }, "PEN": { "s": "S/.", @@ -987,7 +979,7 @@ "sn": "S/.", "d": 2, "r": 0, - "np": "Peruvian nuevos soles" + "np": "Peruvian nuevos soles", }, "PGK": { "s": "K", @@ -995,7 +987,7 @@ "sn": "K", "d": 2, "r": 0, - "np": "Papua New Guinean kina" + "np": "Papua New Guinean kina", }, "PHP": { "s": "₱", @@ -1003,7 +995,7 @@ "sn": "₱", "d": 2, "r": 0, - "np": "Philippine pesos" + "np": "Philippine pesos", }, "PKR": { "s": "PKRs", @@ -1011,7 +1003,7 @@ "sn": "₨", "d": 0, "r": 0, - "np": "Pakistani rupees" + "np": "Pakistani rupees", }, "PLN": { "s": "zł", @@ -1019,7 +1011,7 @@ "sn": "zł", "d": 2, "r": 0, - "np": "Polish zlotys" + "np": "Polish zlotys", }, "PYG": { "s": "₲", @@ -1027,7 +1019,7 @@ "sn": "₲", "d": 0, "r": 0, - "np": "Paraguayan guaranis" + "np": "Paraguayan guaranis", }, "QAR": { "s": "QR", @@ -1035,7 +1027,7 @@ "sn": "ر.ق.‏", "d": 2, "r": 0, - "np": "Qatari rials" + "np": "Qatari rials", }, "RON": { "s": "RON", @@ -1043,7 +1035,7 @@ "sn": "RON", "d": 2, "r": 0, - "np": "Romanian lei" + "np": "Romanian lei", }, "RSD": { "s": "din.", @@ -1051,7 +1043,7 @@ "sn": "дин.", "d": 0, "r": 0, - "np": "Serbian dinars" + "np": "Serbian dinars", }, "RUB": { "s": "RUB", @@ -1059,7 +1051,7 @@ "sn": "руб.", "d": 2, "r": 0, - "np": "Russian rubles" + "np": "Russian rubles", }, "RWF": { "s": "RWF", @@ -1067,7 +1059,7 @@ "sn": "FR", "d": 0, "r": 0, - "np": "Rwandan francs" + "np": "Rwandan francs", }, "SAR": { "s": "SR", @@ -1075,7 +1067,7 @@ "sn": "ر.س.‏", "d": 2, "r": 0, - "np": "Saudi riyals" + "np": "Saudi riyals", }, "SBD": { "s": "$", @@ -1083,7 +1075,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Solomon Islands Dollars" + "np": "Solomon Islands Dollars", }, "SCR": { "s": "₨", @@ -1091,7 +1083,7 @@ "sn": "₨", "d": 2, "r": 0, - "np": "Seychelles Rupees" + "np": "Seychelles Rupees", }, "SDG": { "s": "SDG", @@ -1099,7 +1091,7 @@ "sn": "SDG", "d": 2, "r": 0, - "np": "Sudanese pounds" + "np": "Sudanese pounds", }, "SEK": { "s": "Skr", @@ -1107,7 +1099,7 @@ "sn": "kr", "d": 2, "r": 0, - "np": "Swedish kronor" + "np": "Swedish kronor", }, "SGD": { "s": "S$", @@ -1115,7 +1107,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Singapore dollars" + "np": "Singapore dollars", }, "SHP": { "s": "£", @@ -1123,7 +1115,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Saint Helena Pounds" + "np": "Saint Helena Pounds", }, "SLL": { "s": "Le", @@ -1131,7 +1123,7 @@ "sn": "Le", "d": 2, "r": 0, - "np": "Sierra Leonean leone" + "np": "Sierra Leonean leone", }, "SOS": { "s": "Ssh", @@ -1139,7 +1131,7 @@ "sn": "Ssh", "d": 0, "r": 0, - "np": "Somali shillings" + "np": "Somali shillings", }, "SRD": { "s": "$", @@ -1147,7 +1139,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Suriname Dollars" + "np": "Suriname Dollars", }, "SSP": { "s": "SSP", @@ -1155,7 +1147,7 @@ "sn": "SSP", "d": 2, "r": 0, - "np": "South Sudanese pound" + "np": "South Sudanese pound", }, "STD": { "s": "Db", @@ -1163,7 +1155,7 @@ "sn": "Db", "d": 2, "r": 0, - "np": "São Tomé and Príncipe dobra" + "np": "São Tomé and Príncipe dobra", }, "SVC": { "s": "$", @@ -1171,7 +1163,7 @@ "sn": "$", "d": 0, "r": 0, - "np": "El Salvador Colon" + "np": "El Salvador Colon", }, "SYP": { "s": "SY£", @@ -1179,7 +1171,7 @@ "sn": "ل.س.‏", "d": 0, "r": 0, - "np": "Syrian pounds" + "np": "Syrian pounds", }, "SZL": { "s": "L", @@ -1187,7 +1179,7 @@ "sn": "L", "d": 2, "r": 0, - "np": "Swazi lilangeni" + "np": "Swazi lilangeni", }, "THB": { "s": "฿", @@ -1195,7 +1187,7 @@ "sn": "฿", "d": 2, "r": 0, - "np": "Thai baht" + "np": "Thai baht", }, "TJS": { "s": "-", @@ -1203,7 +1195,7 @@ "sn": "-", "d": 2, "r": 0, - "np": "Tajikistani somoni" + "np": "Tajikistani somoni", }, "TMT": { "s": "T", @@ -1211,7 +1203,7 @@ "sn": "T", "d": 2, "r": 0, - "np": "Turkmenistan manat" + "np": "Turkmenistan manat", }, "TND": { "s": "DT", @@ -1219,7 +1211,7 @@ "sn": "د.ت.‏", "d": 3, "r": 0, - "np": "Tunisian dinars" + "np": "Tunisian dinars", }, "TOP": { "s": "T$", @@ -1227,7 +1219,7 @@ "sn": "T$", "d": 2, "r": 0, - "np": "Tongan paʻanga" + "np": "Tongan paʻanga", }, "TRY": { "s": "TL", @@ -1235,7 +1227,7 @@ "sn": "TL", "d": 2, "r": 0, - "np": "Turkish Lira" + "np": "Turkish Lira", }, "TTD": { "s": "TT$", @@ -1243,7 +1235,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Trinidad and Tobago dollars" + "np": "Trinidad and Tobago dollars", }, "TVD": { "s": "$", @@ -1251,7 +1243,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Tuvalu Dollars" + "np": "Tuvalu Dollars", }, "TWD": { "s": "NT$", @@ -1259,7 +1251,7 @@ "sn": "NT$", "d": 2, "r": 0, - "np": "New Taiwan dollars" + "np": "New Taiwan dollars", }, "TZS": { "s": "TSh", @@ -1267,7 +1259,7 @@ "sn": "TSh", "d": 0, "r": 0, - "np": "Tanzanian shillings" + "np": "Tanzanian shillings", }, "UAH": { "s": "₴", @@ -1275,7 +1267,7 @@ "sn": "₴", "d": 2, "r": 0, - "np": "Ukrainian hryvnias" + "np": "Ukrainian hryvnias", }, "UGX": { "s": "USh", @@ -1283,7 +1275,7 @@ "sn": "USh", "d": 0, "r": 0, - "np": "Ugandan shillings" + "np": "Ugandan shillings", }, "USD": { "s": "$", @@ -1291,7 +1283,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "US dollars" + "np": "US dollars", }, "USN": { "s": "$", @@ -1299,7 +1291,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "United States dollars (next day) (funds code)" + "np": "United States dollars (next day) (funds code)", }, "UYI": { "s": "UYI", @@ -1307,7 +1299,7 @@ "sn": "UYI", "d": 0, "r": 0, - "np": "Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code)" + "np": "Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code)", }, "UYU": { "s": "$U", @@ -1315,7 +1307,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Uruguayan pesos" + "np": "Uruguayan pesos", }, "UZS": { "s": "UZS", @@ -1323,7 +1315,7 @@ "sn": "UZS", "d": 0, "r": 0, - "np": "Uzbekistan som" + "np": "Uzbekistan som", }, "VEF": { "s": "Bs.F.", @@ -1331,7 +1323,7 @@ "sn": "Bs.F.", "d": 2, "r": 0, - "np": "Venezuelan bolívars" + "np": "Venezuelan bolívars", }, "VND": { "s": "₫", @@ -1339,7 +1331,7 @@ "sn": "₫", "d": 0, "r": 0, - "np": "Vietnamese dong" + "np": "Vietnamese dong", }, "VUV": { "s": "VT", @@ -1347,7 +1339,7 @@ "sn": "VT", "d": 0, "r": 0, - "np": "Vanuatu vatu" + "np": "Vanuatu vatu", }, "WST": { "s": "WS$", @@ -1355,7 +1347,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Samoan tala" + "np": "Samoan tala", }, "XAF": { "s": "FCFA", @@ -1363,7 +1355,7 @@ "sn": "FCFA", "d": 0, "r": 0, - "np": "CFA francs BEAC" + "np": "CFA francs BEAC", }, "XAG": { "s": "XAG", @@ -1371,7 +1363,7 @@ "sn": "XAG", "d": 0, "r": 0, - "np": "Silver (one troy ounce)" + "np": "Silver (one troy ounce)", }, "XAU": { "s": "XAU", @@ -1379,7 +1371,7 @@ "sn": "XAU", "d": 0, "r": 0, - "np": "Gold (one troy ounce)" + "np": "Gold (one troy ounce)", }, "XBA": { "s": "XBA", @@ -1387,7 +1379,7 @@ "sn": "XBA", "d": 0, "r": 0, - "np": "European Composite Unit (EURCO) (bond market unit)" + "np": "European Composite Unit (EURCO) (bond market unit)", }, "XBB": { "s": "XBB", @@ -1395,7 +1387,7 @@ "sn": "XBB", "d": 0, "r": 0, - "np": "European Monetary Unit (E.M.U.-6) (bond market unit)" + "np": "European Monetary Unit (E.M.U.-6) (bond market unit)", }, "XBC": { "s": "XBC", @@ -1403,7 +1395,7 @@ "sn": "XBC", "d": 0, "r": 0, - "np": "European Unit of Account 9 (E.U.A.-9) (bond market unit)" + "np": "European Unit of Account 9 (E.U.A.-9) (bond market unit)", }, "XBD": { "s": "XBD", @@ -1411,7 +1403,7 @@ "sn": "XBD", "d": 0, "r": 0, - "np": "European Unit of Account 17 (E.U.A.-17) (bond market unit)" + "np": "European Unit of Account 17 (E.U.A.-17) (bond market unit)", }, "XCD": { "s": "$", @@ -1419,7 +1411,7 @@ "sn": "$", "d": 0, "r": 0, - "np": "East Caribbean Dollars" + "np": "East Caribbean Dollars", }, "XDR": { "s": "XDR", @@ -1427,7 +1419,7 @@ "sn": "XDR", "d": 0, "r": 0, - "np": "Special drawing rights" + "np": "Special drawing rights", }, "XOF": { "s": "CFA", @@ -1435,7 +1427,7 @@ "sn": "CFA", "d": 0, "r": 0, - "np": "CFA francs BCEAO" + "np": "CFA francs BCEAO", }, "XPD": { "s": "XPD", @@ -1443,7 +1435,7 @@ "sn": "XPD", "d": 0, "r": 0, - "np": "Palladium (one troy ounce)" + "np": "Palladium (one troy ounce)", }, "XPF": { "s": "CFP", @@ -1451,7 +1443,7 @@ "sn": "CFP", "d": 0, "r": 0, - "np": "CFP franc (franc Pacifique)" + "np": "CFP franc (franc Pacifique)", }, "XPT": { "s": "XPT", @@ -1459,7 +1451,7 @@ "sn": "XPT", "d": 0, "r": 0, - "np": "Platinum (one troy ounce)" + "np": "Platinum (one troy ounce)", }, "XSU": { "s": "Sucre", @@ -1467,7 +1459,7 @@ "sn": "Sucre", "d": 0, "r": 0, - "np": "SUCRE" + "np": "SUCRE", }, "XTS": { "s": "XTS", @@ -1475,7 +1467,7 @@ "sn": "XTS", "d": 0, "r": 0, - "np": "Code reserved for testing purposes" + "np": "Code reserved for testing purposes", }, "XUA": { "s": "XUA", @@ -1483,7 +1475,7 @@ "sn": "XUA", "d": 0, "r": 0, - "np": "ADB Unit of Account" + "np": "ADB Unit of Account", }, "XXX": { "s": "XXX", @@ -1491,7 +1483,7 @@ "sn": "XXX", "d": 0, "r": 0, - "np": "No currency" + "np": "No currency", }, "YER": { "s": "YR", @@ -1499,7 +1491,7 @@ "sn": "ر.ي.‏", "d": 0, "r": 0, - "np": "Yemeni rials" + "np": "Yemeni rials", }, "ZAR": { "s": "R", @@ -1507,7 +1499,7 @@ "sn": "R", "d": 2, "r": 0, - "np": "South African rand" + "np": "South African rand", }, "ZMK": { "s": "ZK", @@ -1515,7 +1507,7 @@ "sn": "ZK", "d": 0, "r": 0, - "np": "Zambian kwachas" + "np": "Zambian kwachas", }, "ZMW": { "s": "ZK", @@ -1523,7 +1515,7 @@ "sn": "ZK", "d": 2, "r": 0, - "np": "Zambian kwacha" + "np": "Zambian kwacha", }, "ZWD": { "s": "Z$", @@ -1531,7 +1523,7 @@ "sn": "Z$", "d": 2, "r": 0, - "np": "Zimbabwe Dollars" + "np": "Zimbabwe Dollars", }, "ZWL": { "s": "$", @@ -1539,15 +1531,15 @@ "sn": "$", "d": 2, "r": 0, - "np": "Zimbabwean dollars A/10" - } + "np": "Zimbabwean dollars A/10", + }, } # Commonly used unofficial names. # See also: https://en.wikipedia.org/wiki/ISO_4217#Unofficial_currency_codes -CURRENCIES['NTD'] = CURRENCIES['TWD'] -CURRENCIES['RMB'] = CURRENCIES['CNY'] +CURRENCIES["NTD"] = CURRENCIES["TWD"] +CURRENCIES["RMB"] = CURRENCIES["CNY"] REPLACED_BY_EURO = { @@ -1557,7 +1549,7 @@ "sn": "öS", "d": 2, "r": 0, - "np": "Austrian schilling" + "np": "Austrian schilling", }, "BEF": { "s": "fr.", @@ -1565,7 +1557,7 @@ "sn": "fr.", "d": 2, "r": 0, - "np": "Belgian francs" + "np": "Belgian francs", }, "CYP": { "s": "CYP", @@ -1573,7 +1565,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Cypriot pounds" + "np": "Cypriot pounds", }, "DEM": { "s": "DM", @@ -1581,7 +1573,7 @@ "sn": "D-Mark", "d": 2, "r": 0, - "np": "Deutsche marks" + "np": "Deutsche marks", }, "NLG": { "s": "fl.", @@ -1589,7 +1581,7 @@ "sn": "ƒ", "d": 2, "r": 0, - "np": "Dutch guilders" + "np": "Dutch guilders", }, "EEK": { "s": "kr", @@ -1597,7 +1589,7 @@ "sn": "kroon", "d": 2, "r": 0, - "np": "Estonian krooni" + "np": "Estonian krooni", }, "FIM": { "s": "FIM", @@ -1605,7 +1597,7 @@ "sn": "mk.", "d": 2, "r": 0, - "np": "Finnish markkaa" + "np": "Finnish markkaa", }, "FRF": { "s": "F", @@ -1613,7 +1605,7 @@ "sn": "₣", "d": 2, "r": 0, - "np": "French francs" + "np": "French francs", }, "GRD": { "s": "GRD", @@ -1622,7 +1614,7 @@ "sn2": ["Δρ.", "₯"], "d": 2, "r": 0, - "np": "Greek drachmae" + "np": "Greek drachmae", }, "IEP": { "s": "IR£", @@ -1630,7 +1622,7 @@ "sn": "£", "d": 2, "r": 0, - "np": "Irish pounds" + "np": "Irish pounds", }, "ITL": { "s": "L", @@ -1638,7 +1630,7 @@ "sn": "₤", "d": 0, "r": 0, - "np": "Italian lire" + "np": "Italian lire", }, "LVL": { "s": "Ls", @@ -1646,7 +1638,7 @@ "sn": "LVL", "d": 2, "r": 0, - "np": "Latvian lati" + "np": "Latvian lati", }, "LTL": { "s": "Lt", @@ -1655,7 +1647,7 @@ "sn2": ["litų"], "d": 2, "r": 0, - "np": "Lithuanian litai" + "np": "Lithuanian litai", }, "LUF": { "s": "F", @@ -1663,7 +1655,7 @@ "sn": "LUF", "d": 2, "r": 0, - "np": "Luxembourgish francs" + "np": "Luxembourgish francs", }, "MTL": { "s": "Lm", @@ -1671,7 +1663,7 @@ "sn": "₤", "d": 2, "r": 0, - "np": "Maltese liri" + "np": "Maltese liri", }, "PTE": { "s": "$", @@ -1679,7 +1671,7 @@ "sn": "$", "d": 2, "r": 0, - "np": "Portuguese escudos" + "np": "Portuguese escudos", }, "SKK": { "s": "SKK", @@ -1687,7 +1679,7 @@ "sn": "Sk", "d": 2, "r": 0, - "np": "Slovak Koruny" + "np": "Slovak Koruny", }, "SIT": { "s": "SIT", @@ -1696,7 +1688,7 @@ "sn2": ["tolarjev"], "d": 2, "r": 0, - "np": "Slovenian tolar" + "np": "Slovenian tolar", }, "ESP": { "s": "Pta", @@ -1705,7 +1697,7 @@ "sn2": ["₧", "Pts", "Pt"], "d": 0, "r": 0, - "np": "Spanish pesetas" + "np": "Spanish pesetas", }, "VAL": { "s": "£", @@ -1713,7 +1705,7 @@ "sn": "₤", "d": 0, "r": 0, - "np": "Vatican liri" + "np": "Vatican liri", }, } @@ -1728,9 +1720,8 @@ CURRENCY_CODES: List[str] = list(CURRENCIES.keys()) -CURRENCY_SYMBOLS: List[str] = list({c['s'] for c in CURRENCIES.values()}) +CURRENCY_SYMBOLS: List[str] = list({c["s"] for c in CURRENCIES.values()}) CURRENCY_NATIONAL_SYMBOLS: List[str] = list( - {c['sn'] for c in CURRENCIES.values()} | - set(chain.from_iterable(c['sn2'] for c in CURRENCIES.values() - if 'sn2' in c)) + {c["sn"] for c in CURRENCIES.values()} + | set(chain.from_iterable(c["sn2"] for c in CURRENCIES.values() if "sn2" in c)) ) diff --git a/price_parser/parser.py b/price_parser/parser.py index 00dc6fa..4e125ff 100644 --- a/price_parser/parser.py +++ b/price_parser/parser.py @@ -1,33 +1,36 @@ # -*- coding: utf-8 -*- import re import string -from typing import Callable, Optional, Pattern, List, Tuple from decimal import Decimal, InvalidOperation +from typing import Callable, List, Optional, Pattern, Tuple import attr -from ._currencies import (CURRENCY_CODES, CURRENCY_NATIONAL_SYMBOLS, - CURRENCY_SYMBOLS) + +from ._currencies import CURRENCY_CODES, CURRENCY_NATIONAL_SYMBOLS, CURRENCY_SYMBOLS @attr.s(auto_attribs=True) class Price: - amount: Optional[Decimal] # price numeric value, as Decimal - currency: Optional[str] # currency symbol (as appeared in text) + amount: Optional[Decimal] # price numeric value, as Decimal + currency: Optional[str] # currency symbol (as appeared in text) # price value, as a raw string amount_text: Optional[str] = attr.ib(repr=False) @property def amount_float(self) -> Optional[float]: - """ price numeric value, as float """ + """price numeric value, as float""" if self.amount is not None: return float(self.amount) @classmethod - def fromstring(cls, price: Optional[str], - currency_hint: Optional[str] = None, - decimal_separator: Optional[str] = None, - digit_group_separator: Optional[str] = None) -> 'Price': + def fromstring( + cls, + price: Optional[str], + currency_hint: Optional[str] = None, + decimal_separator: Optional[str] = None, + digit_group_separator: Optional[str] = None, + ) -> "Price": """ Given price and currency text extracted from HTML elements, return ``Price`` instance, which provides a clean currency symbol and @@ -54,11 +57,12 @@ def fromstring(cls, price: Optional[str], if currency is not None: currency = currency.strip() if digit_group_separator is not None and price is not None: - price = price.replace(digit_group_separator, '') + price = price.replace(digit_group_separator, "") amount_text = extract_price_text(price) if price is not None else None amount_num = ( parse_number(amount_text, decimal_separator) - if amount_text is not None else None + if amount_text is not None + else None ) return Price( amount=amount_num, @@ -71,8 +75,8 @@ def fromstring(cls, price: Optional[str], def or_regex(symbols: List[str]) -> Pattern: - """ Return a regex which matches any of ``symbols`` """ - return re.compile('|'.join(re.escape(s) for s in symbols)) + """Return a regex which matches any of ``symbols``""" + return re.compile("|".join(re.escape(s) for s in symbols)) # If one of these symbols is found either in price or in currency, @@ -80,44 +84,148 @@ def or_regex(symbols: List[str]) -> Pattern: # of its position in text. SAFE_CURRENCY_SYMBOLS = [ # Variants of $, etc. They need to be before $. - 'Bds$', 'CUC$', 'MOP$', - 'AR$', 'AU$', 'BN$', 'BZ$', 'CA$', 'CL$', 'CO$', 'CV$', 'HK$', 'MX$', - 'NT$', 'NZ$', 'TT$', 'RD$', 'WS$', 'US$', - '$U', 'C$', 'J$', 'N$', 'R$', 'S$', 'T$', 'Z$', 'A$', - 'SY£', 'LB£', 'CN¥', 'GH₵', - + "Bds$", + "CUC$", + "MOP$", + "AR$", + "AU$", + "BN$", + "BZ$", + "CA$", + "CL$", + "CO$", + "CV$", + "HK$", + "MX$", + "NT$", + "NZ$", + "TT$", + "RD$", + "WS$", + "US$", + "$U", + "C$", + "J$", + "N$", + "R$", + "S$", + "T$", + "Z$", + "A$", + "SY£", + "LB£", + "CN¥", + "GH₵", # unique currency symbols - '$', '€', '£', 'zł', 'Zł', 'Kč', '₽', '¥', '¥', - '฿', 'դր.', 'դր', '₦', '₴', '₱', '৳', '₭', '₪', '﷼', '៛', '₩', '₫', '₡', - 'টকা', 'ƒ', '₲', '؋', '₮', 'नेरू', '₨', - '₶', '₾', '֏', 'ރ', '৲', '૱', '௹', '₠', '₢', '₣', '₤', '₧', '₯', - '₰', '₳', '₷', '₸', '₹', '₺', '₼', '₾', '₿', 'ℳ', - 'ر.ق.\u200f', 'د.ك.\u200f', 'د.ع.\u200f', 'ر.ع.\u200f', 'ر.ي.\u200f', - 'ر.س.\u200f', 'د.ج.\u200f', 'د.م.\u200f', 'د.إ.\u200f', 'د.ت.\u200f', - 'د.ل.\u200f', 'ل.س.\u200f', 'د.ب.\u200f', 'د.أ.\u200f', 'ج.م.\u200f', - 'ل.ل.\u200f', - - ' تومان', 'تومان', - + "$", + "€", + "£", + "zł", + "Zł", + "Kč", + "₽", + "¥", + "¥", + "฿", + "դր.", + "դր", + "₦", + "₴", + "₱", + "৳", + "₭", + "₪", + "﷼", + "៛", + "₩", + "₫", + "₡", + "টকা", + "ƒ", + "₲", + "؋", + "₮", + "नेरू", + "₨", + "₶", + "₾", + "֏", + "ރ", + "৲", + "૱", + "௹", + "₠", + "₢", + "₣", + "₤", + "₧", + "₯", + "₰", + "₳", + "₷", + "₸", + "₹", + "₺", + "₼", + "₾", + "₿", + "ℳ", + "ر.ق.\u200f", + "د.ك.\u200f", + "د.ع.\u200f", + "ر.ع.\u200f", + "ر.ي.\u200f", + "ر.س.\u200f", + "د.ج.\u200f", + "د.م.\u200f", + "د.إ.\u200f", + "د.ت.\u200f", + "د.ل.\u200f", + "ل.س.\u200f", + "د.ب.\u200f", + "د.أ.\u200f", + "ج.م.\u200f", + "ل.ل.\u200f", + " تومان", + "تومان", # other common symbols, which we consider unambiguous - 'EUR', 'euro', 'eur', 'CHF', 'DKK', 'Rp', 'lei', - 'руб.', 'руб', 'грн.', 'грн', 'дин.', 'Dinara', 'динар', 'лв.', 'лв', - 'р.', 'тңг', 'тңг.', 'ман.', + "EUR", + "euro", + "eur", + "CHF", + "DKK", + "Rp", + "lei", + "руб.", + "руб", + "грн.", + "грн", + "дин.", + "Dinara", + "динар", + "лв.", + "лв", + "р.", + "тңг", + "тңг.", + "ман.", ] # "D" in some abbreviations means "dollar", and so currency # can be written as SGD$123 or NZD $123. Currency code should take priority # over $ symbol in this case. -DOLLAR_CODES = [k for k in CURRENCY_CODES if k.endswith('D')] +DOLLAR_CODES = [k for k in CURRENCY_CODES if k.endswith("D")] _DOLLAR_REGEX = re.compile( - r''' + r""" \b (?:{}) # currency code like NZD (?= \$? # dollar sign to ignore if attached to the currency code (?:[\W\d]|$) # not a letter ) - '''.format('|'.join(re.escape(k) for k in DOLLAR_CODES)), + """.format( + "|".join(re.escape(k) for k in DOLLAR_CODES) + ), re.VERBOSE, ) @@ -125,27 +233,27 @@ def or_regex(symbols: List[str]) -> Pattern: # Other common currency symbols: 3-letter codes, less safe abbreviations OTHER_CURRENCY_SYMBOLS_SET = ( set( - CURRENCY_CODES + - CURRENCY_SYMBOLS + - CURRENCY_NATIONAL_SYMBOLS + - + CURRENCY_CODES + + CURRENCY_SYMBOLS + + CURRENCY_NATIONAL_SYMBOLS + + # even if they appear in text, currency is likely to be rouble - ['р', 'Р'] + ["р", "Р"] ) - - set(SAFE_CURRENCY_SYMBOLS) # already handled - - {'-', 'XXX'} # placeholder values + - set(SAFE_CURRENCY_SYMBOLS) # already handled + - {"-", "XXX"} # placeholder values - set(string.ascii_uppercase) # very unreliable on their own ) -OTHER_CURRENCY_SYMBOLS = sorted(OTHER_CURRENCY_SYMBOLS_SET, - key=len, reverse=True) +OTHER_CURRENCY_SYMBOLS = sorted(OTHER_CURRENCY_SYMBOLS_SET, key=len, reverse=True) _search_dollar_code = _DOLLAR_REGEX.search _search_safe_currency = or_regex(SAFE_CURRENCY_SYMBOLS).search _search_unsafe_currency = or_regex(OTHER_CURRENCY_SYMBOLS).search -def extract_currency_symbol(price: Optional[str], - currency_hint: Optional[str]) -> Optional[str]: +def extract_currency_symbol( + price: Optional[str], currency_hint: Optional[str] +) -> Optional[str]: """ Guess currency symbol from extracted price and currency strings. Return an empty string if symbol is not found. @@ -157,14 +265,14 @@ def extract_currency_symbol(price: Optional[str], (_search_unsafe_currency, currency_hint), ] - if currency_hint and '$' in currency_hint: + if currency_hint and "$" in currency_hint: methods.insert(0, (_search_dollar_code, currency_hint)) - if price and '$' in price: + if price and "$" in price: methods.insert(0, (_search_dollar_code, price)) - for meth, attr in methods: - m = meth(attr) if attr else None + for meth, value in methods: + m = meth(value) if value else None if m: return m.group(0) @@ -208,38 +316,50 @@ def extract_price_text(price: str) -> Optional[str]: >>> extract_price_text("$.75") '.75' """ - price = re.sub(r'\s+', ' ', price) # clean initial text from non-breaking and extra spaces + price = re.sub( + r"\s+", " ", price + ) # clean initial text from non-breaking and extra spaces - if price.count('€') == 1: - m = re.search(r""" + if price.count("€") == 1: + m = re.search( + r""" [\d\s.,]*?\d # number, probably with thousand separators \s*?€(\s*?)? # euro, probably separated by whitespace - \d(?(1)\d|\d*?) # if separated by whitespace - search one digit, multiple digits otherwise + \d(?(1)\d|\d*?) # if separated by whitespace - search one digit, + # multiple digits otherwise (?:$|[^\d]) # something which is not a digit - """, price, re.VERBOSE) + """, + price, + re.VERBOSE, + ) if m: - return m.group(0).replace(' ', '') + return m.group(0).replace(" ", "") - m = re.search(r""" + m = re.search( + r""" ([.]?\d[\d\s.,]*) # number, probably with thousand separators \s*? # skip whitespace (?:[^%\d]|$) # capture next symbol - it shouldn't be % - """, price, re.VERBOSE) + """, + price, + re.VERBOSE, + ) if m: - price_text = m.group(1).rstrip(',.') + price_text = m.group(1).rstrip(",.") return ( price_text.strip() - if price_text.count('.') == 1 - else price_text.lstrip(',.').strip() + if price_text.count(".") == 1 + else price_text.lstrip(",.").strip() ) - if 'free' in price.lower(): - return '0' + if "free" in price.lower(): + return "0" return None # NOTE: Keep supported separators in sync with parse_number() -_search_decimal_sep = re.compile(r""" +_search_decimal_sep = re.compile( + r""" \d* # null or more digits (there can be more before it) ([.,€]) # decimal separator (?: # 1,2 or 4+ digits. 3 digits is likely to be a thousand separator. @@ -247,11 +367,13 @@ def extract_price_text(price: str) -> Optional[str]: \d{4}\d*? ) $ -""", re.VERBOSE).search +""", + re.VERBOSE, +).search def get_decimal_separator(price: str) -> Optional[str]: - """ Return decimal separator symbol or None if there + """Return decimal separator symbol or None if there is no decimal separator. >>> get_decimal_separator("1000") @@ -272,9 +394,10 @@ def get_decimal_separator(price: str) -> Optional[str]: return m.group(1) -def parse_number(num: str, - decimal_separator: Optional[str] = None) -> Optional[Decimal]: - """ Parse a string with a number to a Decimal, guessing its format: +def parse_number( + num: str, decimal_separator: Optional[str] = None +) -> Optional[Decimal]: + """Parse a string with a number to a Decimal, guessing its format: decimal separator, thousand separator. Return None if parsing fails. >>> parse_number("1,234") @@ -310,18 +433,18 @@ def parse_number(num: str, """ if not num: return None - num = num.strip().replace(' ', '') + num = num.strip().replace(" ", "") decimal_separator = decimal_separator or get_decimal_separator(num) # NOTE: Keep supported separators in sync with _search_decimal_sep if decimal_separator is None: - num = num.replace('.', '').replace(',', '') - elif decimal_separator == '.': - num = num.replace(',', '') - elif decimal_separator == ',': - num = num.replace('.', '').replace(',', '.') + num = num.replace(".", "").replace(",", "") + elif decimal_separator == ".": + num = num.replace(",", "") + elif decimal_separator == ",": + num = num.replace(".", "").replace(",", ".") else: - assert decimal_separator == '€' - num = num.replace('.', '').replace(',', '').replace('€', '.') + assert decimal_separator == "€" + num = num.replace(".", "").replace(",", "").replace("€", ".") try: return Decimal(num) except InvalidOperation: diff --git a/setup.py b/setup.py index ce9340b..8d91f48 100755 --- a/setup.py +++ b/setup.py @@ -1,35 +1,34 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from setuptools import setup, find_packages +from setuptools import find_packages, setup setup( - name='price-parser', - version='0.3.4', - description='Extract price and currency from a raw string', - long_description=open('README.rst', encoding="utf8").read() + "\n\n" + open('CHANGES.rst').read(), - author='Mikhail Korobov', - author_email='kmike84@gmail.com', - url='https://github.com/scrapinghub/price-parser', - packages=find_packages(exclude=['tests']), + name="price-parser", + version="0.3.4", + description="Extract price and currency from a raw string", + long_description=open("README.rst", encoding="utf8").read() + + "\n\n" + + open("CHANGES.rst").read(), + author="Mikhail Korobov", + author_email="kmike84@gmail.com", + url="https://github.com/scrapinghub/price-parser", + packages=find_packages(exclude=["tests"]), package_data={"price_parser": ["py.typed"]}, install_requires=[ - 'attrs >= 17.3.0', + "attrs >= 17.3.0", ], zip_safe=False, classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], ) diff --git a/tests/test_price_parsing.py b/tests/test_price_parsing.py index 6895ec9..4329a9d 100644 --- a/tests/test_price_parsing.py +++ b/tests/test_price_parsing.py @@ -11,8 +11,8 @@ we've found in a wild; PRICE_PARSING_EXAMPLES_NEW is a list of tests for new features. New tests should probably go these two lists. """ -from typing import Optional, Union from decimal import Decimal +from typing import Optional, Union import pytest @@ -20,15 +20,18 @@ class Example(Price): - """ A Price wrapper for tests """ - def __init__(self, - currency_raw: Optional[str], - price_raw: Optional[str], - currency: Optional[str], - amount_text: Optional[str], - amount_float: Optional[Union[float, Decimal]], - decimal_separator: Optional[str] = None, - digit_group_separator: Optional[str] = None) -> None: + """A Price wrapper for tests""" + + def __init__( + self, + currency_raw: Optional[str], + price_raw: Optional[str], + currency: Optional[str], + amount_text: Optional[str], + amount_float: Optional[Union[float, Decimal]], + decimal_separator: Optional[str] = None, + digit_group_separator: Optional[str] = None, + ) -> None: self.currency_raw = currency_raw self.price_raw = price_raw self.decimal_separator = decimal_separator @@ -49,9 +52,9 @@ def __eq__(self, other): if not isinstance(other, Price): return super().__eq__(other) return ( - self.amount == other.amount and - self.currency == other.currency and - self.amount_text == other.amount_text + self.amount == other.amount + and self.currency == other.currency + and self.amount_text == other.amount_text ) @@ -61,2462 +64,1406 @@ def idfn(val): PRICE_PARSING_EXAMPLES_BUGS_CAUGHT = [ - Example(None, 'US$:12.99', - 'US$', '12.99', 12.99), - Example('GBP', '34.992001', - 'GBP', '34.992001', 34.992001), - Example('GBP', '29.1583', - 'GBP', '29.1583', 29.1583), - Example(None, '1.11000000000000009770', - None, '1.11000000000000009770', Decimal('1.11000000000000009770')), - Example(None, ' 423.923 KD', - 'KD', '423.923', 423.923, decimal_separator='.'), - Example(None, ' 123,456.789 OMR', - 'OMR', '123,456.789', 123456.789, - decimal_separator='.', digit_group_separator=','), + Example(None, "US$:12.99", "US$", "12.99", 12.99), + Example("GBP", "34.992001", "GBP", "34.992001", 34.992001), + Example("GBP", "29.1583", "GBP", "29.1583", 29.1583), + Example( + None, + "1.11000000000000009770", + None, + "1.11000000000000009770", + Decimal("1.11000000000000009770"), + ), + Example(None, " 423.923 KD", "KD", "423.923", 423.923, decimal_separator="."), + Example( + None, + " 123,456.789 OMR", + "OMR", + "123,456.789", + 123456.789, + decimal_separator=".", + digit_group_separator=",", + ), ] PRICE_PARSING_EXAMPLES_NEW = [ - Example(None, 'PTE 120 000 000', - 'PTE', '120 000 000', 120000000), - Example(None, 'DEM 170 000', - 'DEM', '170 000', 170000), - Example(None, '₤1700.', - '₤', '1700', 1700), - Example(None, '$ 1.144.000', - '$', '1.144.000', 1144000), - Example(None, 'A$190.00', - 'A$', '190.00', 190), - Example(None, '205,68 € 205.68', - '€', '205,68', 205.68), - Example(None, 'AED 8000 (USD 2179)', - 'AED', '8000', 8000), - Example(None, '13800 ₶', - '₶', '13800', 13800), - Example(None, '12,000원', - '원', '12,000', 12000), - Example(None, '3,500円', - '円', '3,500', 3500) + Example(None, "PTE 120 000 000", "PTE", "120 000 000", 120000000), + Example(None, "DEM 170 000", "DEM", "170 000", 170000), + Example(None, "₤1700.", "₤", "1700", 1700), + Example(None, "$ 1.144.000", "$", "1.144.000", 1144000), + Example(None, "A$190.00", "A$", "190.00", 190), + Example(None, "205,68 € 205.68", "€", "205,68", 205.68), + Example(None, "AED 8000 (USD 2179)", "AED", "8000", 8000), + Example(None, "13800 ₶", "₶", "13800", 13800), + Example(None, "12,000원", "원", "12,000", 12000), + Example(None, "3,500円", "円", "3,500", 3500), ] PRICE_PARSING_EXAMPLES = [ - Example('90 728.00 руб 103 100.00 руб', '399 167.00 руб 420 176.16 руб', - 'руб', '399 167.00', 399167), - Example('45,00 zł', '45,00 zł', - 'zł', '45,00', 45), - Example('$', '$ 22.00', - '$', '22.00', 22), - Example('$3.99', '$14.99', - '$', '14.99', 14.99), - Example('Price:', '$11.95', - '$', '11.95', 11.95), - Example('$19.95', '$19.95', - '$', '19.95', 19.95), - Example('Price From £ 39.95', '39.95', - '£', '39.95', 39.95), - Example('comprar', 'R$260,00', - 'R$', '260,00', 260), - Example('$79.00', '$79.00', - '$', '79.00', 79), - Example('34,50 € *', '34,50 € *', - '€', '34,50', 34.5), - Example('35,70 €', '35,70 €', - '€', '35,70', 35.7), - Example('Price', '$147.44', - '$', '147.44', 147.44), - Example('Up to', '$4.70', - '$', '4.70', 4.7), - Example('$999.99', '$924.99', - '$', '924.99', 924.99), - Example('€', '690,00', - '€', '690,00', 690), - Example('Cena', 'Běžná cena 9 800 Kč', - 'Kč', '9 800', 9800), - Example('729,00 €', '479,00 €', - '€', '479,00', 479), - Example('naše cena', 'běžná cena 590 Kč', - 'Kč', '590', 590), - Example('Statt 249,00 EUR **', '249,00 EUR', - 'EUR', '249,00', 249), - Example('€13.95', '€13.95', - '€', '13.95', 13.95), - Example('€36', '€89', - '€', '89', 89), - Example('171900 руб.', '171900 руб.', - 'руб.', '171900', 171900), - Example('$1.06', '$0.31', - '$', '0.31', 0.31), - Example('$45.49', '$45.49', - '$', '45.49', 45.49), - Example('$', '28', - '$', '28', 28), - Example('4.81 16 von 5', '4.81', - None, '4.81', 4.81), - Example('CHF 86.00 *', 'CHF 47.00 *', - 'CHF', '47.00', 47), - Example('320 руб. 400 руб.', '419 руб.', - 'руб.', '419', 419), - Example('129,99 €', '129,99 €', - '€', '129,99', 129.99), - Example('Cena', '1,10 €', - '€', '1,10', 1.1), - Example('Price:', '$559.00', - '$', '559.00', 559), - Example('$49.99', '$49.99', - '$', '49.99', 49.99), - Example('Price: $32.00', '$32.00', - '$', '32.00', 32), - Example('Price (high to low)', '$699,000', - '$', '699,000', 699000), - Example('€ 11.69', '€ 11.69', - '€', '11.69', 11.69), - Example('100,00 руб.', '100,00', - 'руб.', '100,00', 100), - Example('€ 1', '17,35', - '€', '17,35', 17.35), - Example('$19.95', '$19.95', - '$', '19.95', 19.95), - Example('-', '£11.95', - '£', '11.95', 11.95), - Example('грн.', '5 870', - 'грн.', '5 870', 5870), - Example('Price', '80 Kč', - 'Kč', '80', 80), - Example('€ 640,', '€ 610,', - '€', '610', 610), - Example('Cena', '299 Kč', - 'Kč', '299', 299), - Example('1128240 рублей', '1128240 рублей', - 'руб', '1128240', 1128240), - Example('Now £9.99 $13.71 11,16 € £8.33 $13.71 9,30 €', '£9.99', - '£', '9.99', 9.99), - Example('Free!', 'Free!', - None, '0', 0), - Example('49,96€', '49,96€', - '€', '49,96', 49.96), - Example('SKU:', '$9.00', - '$', '9.00', 9), - Example('£ 8.29', '8.29', - '£', '8.29', 8.29), - Example('Р', '6 300 Р', - 'Р', '6 300', 6300), - Example('99,99 EUR (-30,00%) 69,99 EUR', '99,99 EUR', - 'EUR', '99,99', 99.99), - Example('Р', '1 890 Р', - 'Р', '1 890', 1890), - Example('Disposable Arts', '15,95 €', - '€', '15,95', 15.95), - Example('zł', '16.00', - 'zł', '16.00', 16), - Example('£ 4.99', '4.99', - '£', '4.99', 4.99), - Example('Price', '$119. 95', - '$', '119. 95', 119.95), - Example('269 Kč', '269 Kč', - 'Kč', '269', 269), - Example('>', '13,30 €', - '€', '13,30', 13.3), - Example('₪ 115', '₪98', - '₪', '98', 98), - Example('80,00 €', '80,00 €', - '€', '80,00', 80), - Example('33,95 €', '29,95 €', - '€', '29,95', 29.95), - Example('£ 80.00', '80.00', - '£', '80.00', 80), - Example('EUR', '€16.95', - '€', '16.95', 16.95), - Example('DKK', '23,40', - 'DKK', '23,40', 23.4), - Example('Price: $ 34.44', '34.44', - '$', '34.44', 34.44), - Example('Rp 31.500', 'Rp 31.500', - 'Rp', '31.500', 31500), - Example('běžná cena 6,00 Kč', 'běžná cena 6,00 Kč', - 'Kč', '6,00', 6), - Example('€', '19,59', - '€', '19,59', 19.59), - Example('Out of stock', '2 285,81 грн.', - 'грн.', '2 285,81', 2285.81), - Example('$ 119,999', '$ 119,999', - '$', '119,999', 119999), - Example('1,20 €', '1,20 €', - '€', '1,20', 1.2), - Example('€ 1.99', '1.99', - '€', '1.99', 1.99), - Example('Cena 283,50 PLN', 'Cena 283,50 PLN', - 'PLN', '283,50', 283.5), - Example('SKU:', '99.99', - None, '99.99', 99.99), - Example('$', '$ 979.00', - '$', '979.00', 979), - Example('Cena 169,00 Kč', '169,00 Kč', - 'Kč', '169,00', 169), - Example('Р', '94,456 Р', - 'Р', '94,456', 94456), - Example('€', '180', - '€', '180', 180), - Example('Savings: $0.90', '2.85', - '$', '2.85', 2.85), - Example('฿ 3.3900', '฿ 3.3900', - '฿', '3.3900', 3.39), - Example('5,90 €', '5,90 €', - '€', '5,90', 5.90), - Example('1 930 р.', '1 030 р.', - 'р.', '1 030', 1030), - Example('$', '$ 22.00', - '$', '22.00', 22), - Example('HUF', '39900', - 'HUF', '39900', 39900), - Example('59,00 €', '79,00 €', - '€', '79,00', 79), - Example('(-38,23%)', '429,00 EUR', - 'EUR', '429,00', 429), - Example('302,44€ Χωρίς ΦΠΑ: 243,90€', '302,44€', - '€', '302,44', 302.44), - Example('RENAULT', '129.900', - None, '129.900', 129900), - Example('USD', '£54.17', - '£', '54.17', 54.17), - Example('$3.00', '$3.00', - '$', '3.00', 3), - Example('3,49 zł 1,75 zł', '3,49 zł 1,75 zł', - 'zł', '3,49', 3.49), - Example('59,90 EUR 599,00 EUR pro Kilogramm', '59,90 EUR', - 'EUR', '59,90', 59.9), - Example('Vanaf € 49.95', 'Vanaf € 49.95', - '€', '49.95', 49.95), - Example('$299.00', '$299.00', - '$', '299.00', 299), - Example('€', '€30,40 **', - '€', '30,40', 30.4), - Example('$59.99', '$59.99', - '$', '59.99', 59.99), - Example('EUR', '2800', - 'EUR', '2800', 2800), - Example('225,00 € *', '225,00 € *', - '€', '225,00', 225), - Example('17 940,00 руб', '17 940,00 руб', - 'руб', '17 940,00', 17940), - Example('159,50 €', '159,50 €', - '€', '159,50', 159.5), - Example('£18.99', '£18.99', - '£', '18.99', 18.99), - Example('2.999,00 EUR (-10,00%) 2.699,00 EUR', '699,00 EUR', - 'EUR', '699,00', 699), - Example('$', '45.33', - '$', '45.33', 45.33), - Example('грн.', '33', - 'грн.', '33', 33), - Example('EUR', '16,50 €', - '€', '16,50', 16.5), - Example('₫', '880,000 ₫', - '₫', '880,000', 880000), - Example('руб.', '13.50', - 'руб.', '13.50', 13.5), - Example('336 р.', '336 р.', - 'р.', '336', 336), - Example('....', '200', - None, '200', 200), - Example('Our Price:', '$860.00', - '$', '860.00', 860), - Example('10 €', '10 €', - '€', '10', 10), - Example('€', '13', - '€', '13', 13), - Example('60,00 DKK', '60,00 DKK', - 'DKK', '60,00', 60), - Example('63,90 EUR', '63,90 EUR', - 'EUR', '63,90', 63.9), - Example('$', '$ 11.99', - '$', '11.99', 11.99), - Example('25,00 €', '25,00 €', - '€', '25,00', 25), - Example('Cena', '106,40 €', - '€', '106,40', 106.4), - Example('EA', '$426.20/EA', - '$', '426.20', 426.2), - Example('zł', '5.76', - 'zł', '5.76', 5.76), - Example('$4.50', '$4.50', - '$', '4.50', 4.5), - Example('51090 M Фильтроэлемент OMEGA', '2 660 руб', - 'руб', '2 660', 2660), - Example('Р', '5 000 Р', - 'Р', '5 000', 5000), - Example('Add to Cart', '$4.60', - '$', '4.60', 4.6), - Example('£14.99', '£14.99', - '£', '14.99', 14.99), - Example('SKU:', '$150.00', - '$', '150.00', 150), - Example('€', '70,31', - '€', '70,31', 70.31), - Example('/', '$379', - '$', '379', 379), - Example('€', '139,95', - '€', '139,95', 139.95), - Example('Add to cart', '22,90 €', - '€', '22,90', 22.9), - Example('94,99 zł', '94,99 zł', - 'zł', '94,99', 94.99), - Example('Price', '89.99', - None, '89.99', 89.99), - Example('USD', '$4.00', - '$', '4.00', 4), - Example('$', 'Type of Transfer *', - '$', None, None), - Example('Add to Order', '$892.00', - '$', '892.00', 892), - Example('грн', '60800', - 'грн', '60800', 60800), - Example('zł', '1849.00', - 'zł', '1849.00', 1849), - Example('OK', '0,00 EUR', - 'EUR', '0,00', 0), - Example('руб.', '5 450 руб.', - 'руб.', '5 450', 5450), - Example('Price: $15.95/mo', 'Price: $15.95/mo', - '$', '15.95', 15.95), - Example('MX924 IX', '850 руб.', - 'руб.', '850', 850), - Example('6,000.00 руб. 5,500.00 руб.', '6,000.00 руб. 5,500.00 руб.', - 'руб.', '6,000.00', 6000), - Example('5.590,00 € *', '9.990,00 €', - '€', '9.990,00', 9990), - Example('1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30', '$175.00', - '$', '175.00', 175), - Example('Price', '$99.99', - '$', '99.99', 99.99), - Example('€', '119,00', - '€', '119,00', 119), - Example('$', '$ 11.96', - '$', '11.96', 11.96), - Example('€', '9,94', - '€', '9,94', 9.94), - Example('$69.00', '$69.00', - '$', '69.00', 69), - Example('AQUAFINESSE', 'AQUAFINESSE', - None, None, None), - Example('£55.00', '£50.00', - '£', '50.00', 50), - Example('$39.99', '$39.99', - '$', '39.99', 39.99), - Example('65 000 руб. 75 000 руб.', '75 000 руб.', - 'руб.', '75 000', 75000), - Example('DKK/stk', '17,95', - 'DKK', '17,95', 17.95), - Example('841,00 zł', '841,00 zł – 995,00 zł', - 'zł', '841,00', 841), - Example('$', '$ 18.95', - '$', '18.95', 18.95), - Example('9.0', '434', - None, '434', 434), - Example('£14.50', '£21.00', - '£', '21.00', 21), - Example('ab', '19,90 €', - '€', '19,90', 19.9), - Example('30 руб', '30 руб', - 'руб', '30', 30), - Example('€', '684,25', - '€', '684,25', 684.25), - Example('€ 125.00', '€ 45.00', - '€', '45.00', 45), - Example("ht / L'unité", '17.90', - None, '17.90', 17.9), - Example('$0.00', '$0.00', - '$', '0.00', 0), - Example('49 Kč', '49 Kč', - 'Kč', '49', 49), - Example('Cena 685,00 Kč', '1 995,00 Kč', - 'Kč', '1 995,00', 1995), - Example('€ 2,99', '€ 2,99', - '€', '2,99', 2.99), - Example('Cкидка до 10% от цены купона', '475 руб.', - 'руб.', '475', 475), - Example('€', '11,76', - '€', '11,76', 11.76), - Example('$99.99', '$99.99', - '$', '99.99', 99.99), - Example('1\xa0298,00 €', '1\xa0298,00 €', - '€', '1 298,00', 1298.00), - Example('$1\xa0298,00', '$1\xa0298,00', - '$', '1 298,00', 1298.00), - Example('1\xa0298,00', '1\xa0298,00', - None, '1 298,00', 1298.00), - Example(None, '.75 €', - '€', '.75', 0.75), - Example('$.75', '$.75', - '$', '.75', 0.75), - Example('$..75', '$..75', - '$', '.75', 0.75), - Example('$.75,333', '$.75,333', - '$', '.75,333', 75333), - Example('$.750.30', '$.750.30', - '$', '750.30', 750.30), - Example('i', 'i', - None, None, None), + Example( + "90 728.00 руб 103 100.00 руб", + "399 167.00 руб 420 176.16 руб", + "руб", + "399 167.00", + 399167, + ), + Example("45,00 zł", "45,00 zł", "zł", "45,00", 45), + Example("$", "$ 22.00", "$", "22.00", 22), + Example("$3.99", "$14.99", "$", "14.99", 14.99), + Example("Price:", "$11.95", "$", "11.95", 11.95), + Example("$19.95", "$19.95", "$", "19.95", 19.95), + Example("Price From £ 39.95", "39.95", "£", "39.95", 39.95), + Example("comprar", "R$260,00", "R$", "260,00", 260), + Example("$79.00", "$79.00", "$", "79.00", 79), + Example("34,50 € *", "34,50 € *", "€", "34,50", 34.5), + Example("35,70 €", "35,70 €", "€", "35,70", 35.7), + Example("Price", "$147.44", "$", "147.44", 147.44), + Example("Up to", "$4.70", "$", "4.70", 4.7), + Example("$999.99", "$924.99", "$", "924.99", 924.99), + Example("€", "690,00", "€", "690,00", 690), + Example("Cena", "Běžná cena 9 800 Kč", "Kč", "9 800", 9800), + Example("729,00 €", "479,00 €", "€", "479,00", 479), + Example("naše cena", "běžná cena 590 Kč", "Kč", "590", 590), + Example("Statt 249,00 EUR **", "249,00 EUR", "EUR", "249,00", 249), + Example("€13.95", "€13.95", "€", "13.95", 13.95), + Example("€36", "€89", "€", "89", 89), + Example("171900 руб.", "171900 руб.", "руб.", "171900", 171900), + Example("$1.06", "$0.31", "$", "0.31", 0.31), + Example("$45.49", "$45.49", "$", "45.49", 45.49), + Example("$", "28", "$", "28", 28), + Example("4.81 16 von 5", "4.81", None, "4.81", 4.81), + Example("CHF 86.00 *", "CHF 47.00 *", "CHF", "47.00", 47), + Example("320 руб. 400 руб.", "419 руб.", "руб.", "419", 419), + Example("129,99 €", "129,99 €", "€", "129,99", 129.99), + Example("Cena", "1,10 €", "€", "1,10", 1.1), + Example("Price:", "$559.00", "$", "559.00", 559), + Example("$49.99", "$49.99", "$", "49.99", 49.99), + Example("Price: $32.00", "$32.00", "$", "32.00", 32), + Example("Price (high to low)", "$699,000", "$", "699,000", 699000), + Example("€ 11.69", "€ 11.69", "€", "11.69", 11.69), + Example("100,00 руб.", "100,00", "руб.", "100,00", 100), + Example("€ 1", "17,35", "€", "17,35", 17.35), + Example("$19.95", "$19.95", "$", "19.95", 19.95), + Example("-", "£11.95", "£", "11.95", 11.95), + Example("грн.", "5 870", "грн.", "5 870", 5870), + Example("Price", "80 Kč", "Kč", "80", 80), + Example("€ 640,", "€ 610,", "€", "610", 610), + Example("Cena", "299 Kč", "Kč", "299", 299), + Example("1128240 рублей", "1128240 рублей", "руб", "1128240", 1128240), + Example( + "Now £9.99 $13.71 11,16 € £8.33 $13.71 9,30 €", + "£9.99", + "£", + "9.99", + 9.99, + ), + Example("Free!", "Free!", None, "0", 0), + Example("49,96€", "49,96€", "€", "49,96", 49.96), + Example("SKU:", "$9.00", "$", "9.00", 9), + Example("£ 8.29", "8.29", "£", "8.29", 8.29), + Example("Р", "6 300 Р", "Р", "6 300", 6300), + Example("99,99 EUR (-30,00%) 69,99 EUR", "99,99 EUR", "EUR", "99,99", 99.99), + Example("Р", "1 890 Р", "Р", "1 890", 1890), + Example("Disposable Arts", "15,95 €", "€", "15,95", 15.95), + Example("zł", "16.00", "zł", "16.00", 16), + Example("£ 4.99", "4.99", "£", "4.99", 4.99), + Example("Price", "$119. 95", "$", "119. 95", 119.95), + Example("269 Kč", "269 Kč", "Kč", "269", 269), + Example(">", "13,30 €", "€", "13,30", 13.3), + Example("₪ 115", "₪98", "₪", "98", 98), + Example("80,00 €", "80,00 €", "€", "80,00", 80), + Example("33,95 €", "29,95 €", "€", "29,95", 29.95), + Example("£ 80.00", "80.00", "£", "80.00", 80), + Example("EUR", "€16.95", "€", "16.95", 16.95), + Example("DKK", "23,40", "DKK", "23,40", 23.4), + Example("Price: $ 34.44", "34.44", "$", "34.44", 34.44), + Example("Rp 31.500", "Rp 31.500", "Rp", "31.500", 31500), + Example("běžná cena 6,00 Kč", "běžná cena 6,00 Kč", "Kč", "6,00", 6), + Example("€", "19,59", "€", "19,59", 19.59), + Example("Out of stock", "2 285,81 грн.", "грн.", "2 285,81", 2285.81), + Example("$ 119,999", "$ 119,999", "$", "119,999", 119999), + Example("1,20 €", "1,20 €", "€", "1,20", 1.2), + Example("€ 1.99", "1.99", "€", "1.99", 1.99), + Example("Cena 283,50 PLN", "Cena 283,50 PLN", "PLN", "283,50", 283.5), + Example("SKU:", "99.99", None, "99.99", 99.99), + Example("$", "$ 979.00", "$", "979.00", 979), + Example("Cena 169,00 Kč", "169,00 Kč", "Kč", "169,00", 169), + Example("Р", "94,456 Р", "Р", "94,456", 94456), + Example("€", "180", "€", "180", 180), + Example("Savings: $0.90", "2.85", "$", "2.85", 2.85), + Example("฿ 3.3900", "฿ 3.3900", "฿", "3.3900", 3.39), + Example("5,90 €", "5,90 €", "€", "5,90", 5.90), + Example("1 930 р.", "1 030 р.", "р.", "1 030", 1030), + Example("$", "$ 22.00", "$", "22.00", 22), + Example("HUF", "39900", "HUF", "39900", 39900), + Example("59,00 €", "79,00 €", "€", "79,00", 79), + Example("(-38,23%)", "429,00 EUR", "EUR", "429,00", 429), + Example("302,44€ Χωρίς ΦΠΑ: 243,90€", "302,44€", "€", "302,44", 302.44), + Example("RENAULT", "129.900", None, "129.900", 129900), + Example("USD", "£54.17", "£", "54.17", 54.17), + Example("$3.00", "$3.00", "$", "3.00", 3), + Example("3,49 zł 1,75 zł", "3,49 zł 1,75 zł", "zł", "3,49", 3.49), + Example("59,90 EUR 599,00 EUR pro Kilogramm", "59,90 EUR", "EUR", "59,90", 59.9), + Example("Vanaf € 49.95", "Vanaf € 49.95", "€", "49.95", 49.95), + Example("$299.00", "$299.00", "$", "299.00", 299), + Example("€", "€30,40 **", "€", "30,40", 30.4), + Example("$59.99", "$59.99", "$", "59.99", 59.99), + Example("EUR", "2800", "EUR", "2800", 2800), + Example("225,00 € *", "225,00 € *", "€", "225,00", 225), + Example("17 940,00 руб", "17 940,00 руб", "руб", "17 940,00", 17940), + Example("159,50 €", "159,50 €", "€", "159,50", 159.5), + Example("£18.99", "£18.99", "£", "18.99", 18.99), + Example("2.999,00 EUR (-10,00%) 2.699,00 EUR", "699,00 EUR", "EUR", "699,00", 699), + Example("$", "45.33", "$", "45.33", 45.33), + Example("грн.", "33", "грн.", "33", 33), + Example("EUR", "16,50 €", "€", "16,50", 16.5), + Example("₫", "880,000 ₫", "₫", "880,000", 880000), + Example("руб.", "13.50", "руб.", "13.50", 13.5), + Example("336 р.", "336 р.", "р.", "336", 336), + Example("....", "200", None, "200", 200), + Example("Our Price:", "$860.00", "$", "860.00", 860), + Example("10 €", "10 €", "€", "10", 10), + Example("€", "13", "€", "13", 13), + Example("60,00 DKK", "60,00 DKK", "DKK", "60,00", 60), + Example("63,90 EUR", "63,90 EUR", "EUR", "63,90", 63.9), + Example("$", "$ 11.99", "$", "11.99", 11.99), + Example("25,00 €", "25,00 €", "€", "25,00", 25), + Example("Cena", "106,40 €", "€", "106,40", 106.4), + Example("EA", "$426.20/EA", "$", "426.20", 426.2), + Example("zł", "5.76", "zł", "5.76", 5.76), + Example("$4.50", "$4.50", "$", "4.50", 4.5), + Example("51090 M Фильтроэлемент OMEGA", "2 660 руб", "руб", "2 660", 2660), + Example("Р", "5 000 Р", "Р", "5 000", 5000), + Example("Add to Cart", "$4.60", "$", "4.60", 4.6), + Example("£14.99", "£14.99", "£", "14.99", 14.99), + Example("SKU:", "$150.00", "$", "150.00", 150), + Example("€", "70,31", "€", "70,31", 70.31), + Example("/", "$379", "$", "379", 379), + Example("€", "139,95", "€", "139,95", 139.95), + Example("Add to cart", "22,90 €", "€", "22,90", 22.9), + Example("94,99 zł", "94,99 zł", "zł", "94,99", 94.99), + Example("Price", "89.99", None, "89.99", 89.99), + Example("USD", "$4.00", "$", "4.00", 4), + Example("$", "Type of Transfer *", "$", None, None), + Example("Add to Order", "$892.00", "$", "892.00", 892), + Example("грн", "60800", "грн", "60800", 60800), + Example("zł", "1849.00", "zł", "1849.00", 1849), + Example("OK", "0,00 EUR", "EUR", "0,00", 0), + Example("руб.", "5 450 руб.", "руб.", "5 450", 5450), + Example("Price: $15.95/mo", "Price: $15.95/mo", "$", "15.95", 15.95), + Example("MX924 IX", "850 руб.", "руб.", "850", 850), + Example( + "6,000.00 руб. 5,500.00 руб.", + "6,000.00 руб. 5,500.00 руб.", + "руб.", + "6,000.00", + 6000, + ), + Example("5.590,00 € *", "9.990,00 €", "€", "9.990,00", 9990), + Example( + "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26" + " 27 28 29 30", + "$175.00", + "$", + "175.00", + 175, + ), + Example("Price", "$99.99", "$", "99.99", 99.99), + Example("€", "119,00", "€", "119,00", 119), + Example("$", "$ 11.96", "$", "11.96", 11.96), + Example("€", "9,94", "€", "9,94", 9.94), + Example("$69.00", "$69.00", "$", "69.00", 69), + Example("AQUAFINESSE", "AQUAFINESSE", None, None, None), + Example("£55.00", "£50.00", "£", "50.00", 50), + Example("$39.99", "$39.99", "$", "39.99", 39.99), + Example("65 000 руб. 75 000 руб.", "75 000 руб.", "руб.", "75 000", 75000), + Example("DKK/stk", "17,95", "DKK", "17,95", 17.95), + Example("841,00 zł", "841,00 zł – 995,00 zł", "zł", "841,00", 841), + Example("$", "$ 18.95", "$", "18.95", 18.95), + Example("9.0", "434", None, "434", 434), + Example("£14.50", "£21.00", "£", "21.00", 21), + Example("ab", "19,90 €", "€", "19,90", 19.9), + Example("30 руб", "30 руб", "руб", "30", 30), + Example("€", "684,25", "€", "684,25", 684.25), + Example("€ 125.00", "€ 45.00", "€", "45.00", 45), + Example("ht / L'unité", "17.90", None, "17.90", 17.9), + Example("$0.00", "$0.00", "$", "0.00", 0), + Example("49 Kč", "49 Kč", "Kč", "49", 49), + Example("Cena 685,00 Kč", "1 995,00 Kč", "Kč", "1 995,00", 1995), + Example("€ 2,99", "€ 2,99", "€", "2,99", 2.99), + Example("Cкидка до 10% от цены купона", "475 руб.", "руб.", "475", 475), + Example("€", "11,76", "€", "11,76", 11.76), + Example("$99.99", "$99.99", "$", "99.99", 99.99), + Example("1\xa0298,00 €", "1\xa0298,00 €", "€", "1 298,00", 1298.00), + Example("$1\xa0298,00", "$1\xa0298,00", "$", "1 298,00", 1298.00), + Example("1\xa0298,00", "1\xa0298,00", None, "1 298,00", 1298.00), + Example(None, ".75 €", "€", ".75", 0.75), + Example("$.75", "$.75", "$", ".75", 0.75), + Example("$..75", "$..75", "$", ".75", 0.75), + Example("$.75,333", "$.75,333", "$", ".75,333", 75333), + Example("$.750.30", "$.750.30", "$", "750.30", 750.30), + Example("i", "i", None, None, None), ] PRICE_PARSING_EXAMPLES_2 = [ - Example('7,99 €', '7,99 €', - '€', '7,99', 7.99), - Example('2 Piece - $6.75 2 Piece - $6.75', '$6.75', - '$', '6.75', 6.75), - Example('£7', '£24.99', - '£', '24.99', 24.99), - Example('23,00 €', '23,00 €', - '€', '23,00', 23.00), - Example('€', 'bežná cena 12,96 €', - '€', '12,96', 12.96), - Example('$', '3,20 €', - '€', '3,20', 3.2), - Example('€ 2.109,00', '€ 2.109,00', - '€', '2.109,00', 2109), - Example('руб.', '32690', - 'руб.', '32690', 32690), - Example(': 3 250 000 €', ': 3 250 000 €', - '€', '3 250 000', 3250000), - Example('$20.00', '$20.00', - '$', '20.00', 20), - Example('Цена:', '950 грн.', - 'грн.', '950', 950), - Example('TTC', '149,00', - None, '149,00', 149.00), - Example('A partire da 9,08 €', '166,81 € iva inclusa', - '€', '166,81', 166.81), + Example("7,99 €", "7,99 €", "€", "7,99", 7.99), + Example("2 Piece - $6.75 2 Piece - $6.75", "$6.75", "$", "6.75", 6.75), + Example("£7", "£24.99", "£", "24.99", 24.99), + Example("23,00 €", "23,00 €", "€", "23,00", 23.00), + Example("€", "bežná cena 12,96 €", "€", "12,96", 12.96), + Example("$", "3,20 €", "€", "3,20", 3.2), + Example("€ 2.109,00", "€ 2.109,00", "€", "2.109,00", 2109), + Example("руб.", "32690", "руб.", "32690", 32690), + Example(": 3 250 000 €", ": 3 250 000 €", "€", "3 250 000", 3250000), + Example("$20.00", "$20.00", "$", "20.00", 20), + Example("Цена:", "950 грн.", "грн.", "950", 950), + Example("TTC", "149,00", None, "149,00", 149.00), + Example("A partire da 9,08 €", "166,81 € iva inclusa", "€", "166,81", 166.81), # Example('Ref:', '4229', # None, None, ), - Example('EUR', '679.00', - 'EUR', '679.00', 679.00), - Example('10,50 € 10,50 €', '10,50 €', - '€', '10,50', 10.50), - Example('2,20 € *', '2,20 € *', - '€', '2,20', 2.2), - Example('€', '€ 10.00 € 8.00 – € 10.00', - '€', '10.00', 10), - Example('Bestellen', '€16,95', - '€', '16,95', 16.95), - Example('$', '$ 95.00', - '$', '95.00', 95.00), - Example('Р', '1 400 Р', - 'Р', '1 400', 1400), - Example('£', '£ 15.00', - '£', '15.00', 15), - Example('Price: $119.00', '$119.00', - '$', '119.00', 119), - Example('50,- Kč', '50,- Kč', - 'Kč', '50', 50), - Example('What is this?', '$25.95', - '$', '25.95', 25.95), - Example('$29.99 Excluding Sales Tax in Illinois', '$29.99', - '$', '29.99', 29.99), - Example('ID:', '125,00 zł', - 'zł', '125,00', 125), - Example('Offer Price: Rs 1,306.14', 'Rs 3,600.00', - 'Rs', '3,600.00', 3600), - Example('29 RON', '29 RON', - 'RON', '29', 29), - Example('Р', '2 690 Р', - 'Р', '2 690', 2690), - Example('$134.96', '$134.96', - '$', '134.96', 134.96), - Example('362,68 € χωρίς Φ.Π.Α', '449,72 €', - '€', '449,72', 449.72), - Example('MSRP: $588.00', '499.80', - '$', '499.80', 499.80), - Example('15.00 €', '15.00 €', - '€', '15.00', 15), - Example('Цена: от 2 750 руб.', '2 750 руб.', - 'руб.', '2 750', 2750), - Example('P.V.P. 4,56 €', 'P.V.P. 4,56 €', - '€', '4,56', 4.56), - Example('SPECIAL Add to Cart for Price', '$40.00', - '$', '40.00', 40), - Example('2,90 €', '2,90', - '€', '2,90', 2.9), - Example('Цена: 19 000 руб.', 'Цена: 19 000 руб.', - 'руб.', '19 000', 19000), - Example('COMMANDER', '184,20 €HT', - '€', '184,20', 184.2), - Example('Цена: 1 849 руб.', '1 849 руб.', - 'руб.', '1 849', 1849), - Example('€', '12,00', - '€', '12,00', 12), - Example('Discounted Price £ 205.99', '205.99', - '£', '205.99', 205.99), - Example('SKU', 'No longer available', - None, None, None), - Example('€14.90', '€69.90', - '€', '69.90', 69.9), - Example('руб.', '876 руб.', - 'руб.', '876', 876), - Example('$79.95', '$79.95', - '$', '79.95', 79.95), - Example('3,990 Ft 2,990 Ft', '3,990 Ft', - 'Ft', '3,990', 3990), - Example('Cena 298,00 Kč', '288,00 Kč', - 'Kč', '288,00', 288), - Example('Pris NOK 899,00', '899,00', - 'NOK', '899,00', 899), - Example('50,00 €', '50,00 €', - '€', '50,00', 50), - Example('59,99 €', '54,99 €', - '€', '54,99', 54.99), - Example('EAN', '139,00 € *', - '€', '139,00', 139), - Example('Now', '238.00', - None, '238.00', 238), - Example('(You save $15.01)', '$119.99', - '$', '119.99', 119.99), - Example('Item #:', '$ 99.95', - '$', '99.95', 99.95), - Example('UK:', '£14.99', - '£', '14.99', 14.99), - Example('р.', '150', - 'р.', '150', 150), - Example('12x de R$ 44,00 sem juros', 'R$ 528,00', - 'R$', '528,00', 528), - Example('€', '14,90', - '€', '14,90', 14.9), - Example('5 290 Kč s DPH', '5 290 Kč', - 'Kč', '5 290', 5290), - Example('(Out of Stock)', '39.95', - None, '39.95', 39.95), - Example('₪370', '₪370', - '₪', '370', 370), - Example('HUF', '39000', - 'HUF', '39000', 39000), - Example('Kč', '1 995 Kč', - 'Kč', '1 995', 1995), - Example('C$5.95', 'C$5.95', - 'C$', '5.95', 5.95), - Example('руб.', '22800.00', - 'руб.', '22800.00', 22800), - Example('Cena', '359 Kč', - 'Kč', '359', 359), - Example('Nuestro precio', '189,00 €', - '€', '189,00', 189), - Example('PLN', '179.62', - 'PLN', '179.62', 179.62), - Example('€', '145,79', - '€', '145,79', 145.79), - Example('$', '$ 695.00', - '$', '695.00', 695), - Example('Р', '2 999 Р', - 'Р', '2 999', 2999), - Example('6,50 € *', '6,50', - '€', '6,50', 6.50), - Example('Price: $61.00', '$61.00', - '$', '61.00', 61.00), - Example('Pris NOK 1 999,00', '5 799,00', - 'NOK', '5 799,00', 5799), - Example('7,31 €', '7,31 €', - '€', '7,31', 7.31), - Example('53,20 €', '53,20 €', - '€', '53,20', 53.20), - Example('Cena', '668 Kč', - 'Kč', '668', 668), - Example('€ 28,25', '€ 27,95', - '€', '27,95', 27.95), - Example('From', 'From $109.90', - '$', '109.90', 109.9), - Example('Unit Price: $4.75', '$4.75', - '$', '4.75', 4.75), - Example('Więcej', '14,90 zł', - 'zł', '14,90', 14.90), - Example('$23.00', '$23.00', - '$', '23.00', 23), - Example('€ 0.00', '€ 33.00', - '€', '33.00', 33), - Example('Zľava 36 €', '78 €', - '€', '78', 78), - Example('£', '5.00', - '£', '5.00', 5), - Example('€', '29,90', - '€', '29,90', 29.9), - Example('Р', '860 Р', - 'Р', '860', 860), - Example('60,55 €', '60,55 €', - '€', '60,55', 60.55), - Example('€', '129.00', - '€', '129.00', 129), - Example('£13.50', '£13.50', - '£', '13.50', 13.50), - Example('SKU:', '$39.99', - '$', '39.99', 39.99), - Example('Disponibilidade: Pronta entrega R$60,00 até 2x de R$30,00', 'R$60,00', - 'R$', '60,00', 60), - Example('67,99 €', '64,59 €', - '€', '64,59', 64.59), - Example('€ 9,90', '€ 13,50', - '€', '13,50', 13.50), - Example('Р', '30 Р', - 'Р', '30', 30), - Example('€', '€ 139.00', - '€', '139.00', 139), - Example('There are 163 products.', 'From 26 to 50 €', - '€', '26', 26), - Example('Pris NOK 1 999,00', '139,00', - 'NOK', '139,00', 139), - Example('/sqft', '1.52', - None, '1.52', 1.52), - Example('$4.95', '$4.95', - '$', '4.95', 4.95), - Example('$38', '$12', - '$', '12', 12), - Example('Cena 4.10 €', '4.10', - '€', '4.10', 4.1), - Example('руб.', '590', - 'руб.', '590', 590), - Example('€', '99,90', - '€', '99,90', 99.9), - Example('9,50 EUR', '9,50 EUR', - 'EUR', '9,50', 9.50), - Example('$74.99', '$74.99', - '$', '74.99', 74.99), - Example('$', '$ 3.22', - '$', '3.22', 3.22), - Example('£', '3,301.00 £', - '£', '3,301.00', 3301), - Example('41,78 EUR', '41,78 EUR', - 'EUR', '41,78', 41.78), - Example('44,50 EUR', '44,50 EUR', - 'EUR', '44,50', 44.50), - Example('£4.00', '£4.00', - '£', '4.00', 4), - Example('Р', '7 390 Р', - 'Р', '7 390', 7390), - Example('eMail', '34.99€', - '€', '34.99', 34.99), - Example('€', '12,99', - '€', '12,99', 12.99), - Example('RRP: £ 180.00', '149.00', - '£', '149.00', 149), - Example('9.00 руб.', '27.00 руб.', - 'руб.', '27.00', 27), - Example('Price: $19.95', '$7.95', - '$', '7.95', 7.95), - Example('$16,500', '$16,500', - '$', '16,500', 16500), - Example('•', '$59.99', - '$', '59.99', 59.99), - Example('USD', '349.95', - 'USD', '349.95', 349.95), - Example("35€ 99 dont 0,02 € d'éco-part", '35€ 99', - '€', '35€99', 35.99), - Example('5,72 €', '5,72 €', - '€', '5,72', 5.72), - Example('199,00 грн.', '199,00 грн.', - 'грн.', '199,00', 199), - Example('£4.07', '£4.07', - '£', '4.07', 4.07), - Example('$15.00', '$15.00', - '$', '15.00', 15), - Example('€', '20.00', - '€', '20.00', 20), - Example('€', '14.50', - '€', '14.50', 14.5), - Example('DKK', '59,00', - 'DKK', '59,00', 59), - Example('9 472 Ft', '9 472 Ft', - 'Ft', '9 472', 9472), - Example('Cena', '95 Kč', - 'Kč', '95', 95), - Example('tax excl.', '€ 0,00', - '€', '0,00', 0), - Example('TL', '69,50', - 'TL', '69,50', 69.5), - Example('Price', 'Rp 169.000', - 'Rp', '169.000', 169000), - Example('En stock', '4,50 €', - '€', '4,50', 4.50), - Example('$183.00', '$145.00', - '$', '145.00', 145), - Example('£', '11.70', - '£', '11.70', 11.7), - Example('25,13 €', '25,13 €', - '€', '25,13', 25.13), - Example('58,00 zł', '58,00 zł', - 'zł', '58,00', 58), - Example('€', '15,55', - '€', '15,55', 15.55), - Example('Prezzo SVB: 19,95 €', 'Prezzo SVB: 19,95 €', - '€', '19,95', 19.95), - Example('In stock', '$185.00', - '$', '185.00', 185), - Example('18 €', '18 €', - '€', '18', 18), - Example('0€', '0 €', - '€', '0', 0), - Example('*', '9,41 €', - '€', '9,41', 9.41), - Example('грн.', '1 075', - 'грн.', '1 075', 1075), - Example('More', '$22.99', - '$', '22.99', 22.99), - Example('Р', '9 282 Р', - 'Р', '9 282', 9282), - Example('RM5', 'RM50', - 'RM', '50', 50), - Example('7,60 €', '7,60 €', - '€', '7,60', 7.6), - Example('$', '0.00', - '$', '0.00', 0), - Example('. AMOSTRA .', 'R$ 6,00', - 'R$', '6,00', 6), - Example('5 833,00 € -5% 6 140,00 € Tasse incl. IVA 4%', '5 833,00 €', - '€', '5 833,00', 5833), - Example('€ 26,95', '€ 26,95', - '€', '26,95', 26.95), - Example('35,00 €', '35,00 €', - '€', '35,00', 35), - Example('Р', '2 500 Р', - 'Р', '2 500', 2500), - Example('499,00 €', '499,00 €', - '€', '499,00', 499), - Example('руб.', '1 120 900', - 'руб.', '1 120 900', 1120900), - Example('125,00 125,00 €', '125,00', - '€', '125,00', 125), - Example('₽', '7362', - '₽', '7362', 7362), - Example('SKU:', '€12.99', - '€', '12.99', 12.99), - Example('р.', '600', - 'р.', '600', 600), - Example('79,50 €', '29,90€', - '€', '29,90', 29.9), - Example('$150.00', '$150.00', - '$', '150.00', 150), - Example('Р', '1 987 Р', - 'Р', '1 987', 1987), - Example('€69.00', '€69.00', - '€', '69.00', 69), - Example('USD', '280', - 'USD', '280', 280), - Example('Rabatt', '6 450,00', - None, '6 450,00', 6450), - Example('SKU:', '$178.00', - '$', '178.00', 178), - Example('$', '$ 300.00', - '$', '300.00', 300), - Example('0€', '19,1€', - '€', '19,1', 19.1), - Example('R$49,90', 'R$49,90', - 'R$', '49,90', 49.9), - Example('En stock', '790,00 € HT', - '€', '790,00', 790), - Example('Cena', 'Cena 14,79 €', - '€', '14,79', 14.79), - Example('For Sale', '$395,000', - '$', '395,000', 395000), - Example('€', '10.14', - '€', '10.14', 10.14), - Example('₫', '5.00 trên 5', - '₫', '5.00', 5), - Example('$ 599.00', '549.00', - '$', '549.00', 549), - Example('$19', '$19', - '$', '19', 19), - Example('$210', '$210', - '$', '210', 210), - Example('$', '$ 79.95', - '$', '79.95', 79.95), - Example('руб.', '279 000', - 'руб.', '279 000', 279000), - Example('2 390 €', '2 390 €', - '€', '2 390', 2390), - Example('$', '$ 281.40 $ 265.70', - '$', '281.40', 281.4), - Example('3200 руб. 1500 руб.', '3200 руб. 1500 руб.', - 'руб.', '3200', 3200), - Example('$1,299.00', '$999.00', - '$', '999.00', 999), - Example('15,00 Kč', '15,00 Kč', - 'Kč', '15,00', 15), - Example('€', '€ 20.70', - '€', '20.70', 20.7), - Example('out of stock', '30.00', - None, '30.00', 30), - Example('220,00 €', '398,00 €', - '€', '398,00', 398), - Example('£94.50 GBP', '£94.50 GBP', - '£', '94.50', 94.5), - Example('5 427 Kč', '5 427 Kč', - 'Kč', '5 427', 5427), - Example('$ 24.99', '$ 24.99', - '$', '24.99', 24.99), - Example('£ 2.00', '2.00', - '£', '2.00', 2), - Example('>', '10,00 €', - '€', '10,00', 10), - Example('32,50 EUR', '32,50 EUR', - 'EUR', '32,50', 32.5), - Example('In stock', 'Rs1,599.00', - 'Rs', '1,599.00', 1599), - Example('$', '14.95', - '$', '14.95', 14.95), - Example('RRP: £ 49.99', '42.90', - '£', '42.90', 42.9), - Example('Rs206.00 Rs164.00 SAVE 20%', 'Rs164.00', - 'Rs', '164.00', 164), - Example('Price:', '$6,200.00', - '$', '6,200.00', 6200), - Example('PLN', '69.99', - 'PLN', '69.99', 69.99), - Example('€', '48,39', - '€', '48,39', 48.39), - Example('1.350.000', '320.000', - None, '320.000', 320000), - Example('1.650,00 € *', '2.130,00 €', - '€', '2.130,00', 2130), - Example('£537.00', '£179.00', - '£', '179.00', 179), - Example('SKU:', '$39.99', - '$', '39.99', 39.99), - Example('SGD$4.90', 'SGD$4.90', - 'SGD', '4.90', 4.9), - Example('SGD4.90 $', 'SGD4.90 $', - 'SGD', '4.90', 4.9), - Example('$ SGD4.90', '$ SGD4.90', - 'SGD', '4.90', 4.9), + Example("EUR", "679.00", "EUR", "679.00", 679.00), + Example("10,50 € 10,50 €", "10,50 €", "€", "10,50", 10.50), + Example("2,20 € *", "2,20 € *", "€", "2,20", 2.2), + Example("€", "€ 10.00 € 8.00 – € 10.00", "€", "10.00", 10), + Example("Bestellen", "€16,95", "€", "16,95", 16.95), + Example("$", "$ 95.00", "$", "95.00", 95.00), + Example("Р", "1 400 Р", "Р", "1 400", 1400), + Example("£", "£ 15.00", "£", "15.00", 15), + Example("Price: $119.00", "$119.00", "$", "119.00", 119), + Example("50,- Kč", "50,- Kč", "Kč", "50", 50), + Example("What is this?", "$25.95", "$", "25.95", 25.95), + Example("$29.99 Excluding Sales Tax in Illinois", "$29.99", "$", "29.99", 29.99), + Example("ID:", "125,00 zł", "zł", "125,00", 125), + Example("Offer Price: Rs 1,306.14", "Rs 3,600.00", "Rs", "3,600.00", 3600), + Example("29 RON", "29 RON", "RON", "29", 29), + Example("Р", "2 690 Р", "Р", "2 690", 2690), + Example("$134.96", "$134.96", "$", "134.96", 134.96), + Example("362,68 € χωρίς Φ.Π.Α", "449,72 €", "€", "449,72", 449.72), + Example("MSRP: $588.00", "499.80", "$", "499.80", 499.80), + Example("15.00 €", "15.00 €", "€", "15.00", 15), + Example("Цена: от 2 750 руб.", "2 750 руб.", "руб.", "2 750", 2750), + Example("P.V.P. 4,56 €", "P.V.P. 4,56 €", "€", "4,56", 4.56), + Example("SPECIAL Add to Cart for Price", "$40.00", "$", "40.00", 40), + Example("2,90 €", "2,90", "€", "2,90", 2.9), + Example("Цена: 19 000 руб.", "Цена: 19 000 руб.", "руб.", "19 000", 19000), + Example("COMMANDER", "184,20 €HT", "€", "184,20", 184.2), + Example("Цена: 1 849 руб.", "1 849 руб.", "руб.", "1 849", 1849), + Example("€", "12,00", "€", "12,00", 12), + Example("Discounted Price £ 205.99", "205.99", "£", "205.99", 205.99), + Example("SKU", "No longer available", None, None, None), + Example("€14.90", "€69.90", "€", "69.90", 69.9), + Example("руб.", "876 руб.", "руб.", "876", 876), + Example("$79.95", "$79.95", "$", "79.95", 79.95), + Example("3,990 Ft 2,990 Ft", "3,990 Ft", "Ft", "3,990", 3990), + Example("Cena 298,00 Kč", "288,00 Kč", "Kč", "288,00", 288), + Example("Pris NOK 899,00", "899,00", "NOK", "899,00", 899), + Example("50,00 €", "50,00 €", "€", "50,00", 50), + Example("59,99 €", "54,99 €", "€", "54,99", 54.99), + Example("EAN", "139,00 € *", "€", "139,00", 139), + Example("Now", "238.00", None, "238.00", 238), + Example("(You save $15.01)", "$119.99", "$", "119.99", 119.99), + Example("Item #:", "$ 99.95", "$", "99.95", 99.95), + Example("UK:", "£14.99", "£", "14.99", 14.99), + Example("р.", "150", "р.", "150", 150), + Example("12x de R$ 44,00 sem juros", "R$ 528,00", "R$", "528,00", 528), + Example("€", "14,90", "€", "14,90", 14.9), + Example("5 290 Kč s DPH", "5 290 Kč", "Kč", "5 290", 5290), + Example("(Out of Stock)", "39.95", None, "39.95", 39.95), + Example("₪370", "₪370", "₪", "370", 370), + Example("HUF", "39000", "HUF", "39000", 39000), + Example("Kč", "1 995 Kč", "Kč", "1 995", 1995), + Example("C$5.95", "C$5.95", "C$", "5.95", 5.95), + Example("руб.", "22800.00", "руб.", "22800.00", 22800), + Example("Cena", "359 Kč", "Kč", "359", 359), + Example("Nuestro precio", "189,00 €", "€", "189,00", 189), + Example("PLN", "179.62", "PLN", "179.62", 179.62), + Example("€", "145,79", "€", "145,79", 145.79), + Example("$", "$ 695.00", "$", "695.00", 695), + Example("Р", "2 999 Р", "Р", "2 999", 2999), + Example("6,50 € *", "6,50", "€", "6,50", 6.50), + Example("Price: $61.00", "$61.00", "$", "61.00", 61.00), + Example("Pris NOK 1 999,00", "5 799,00", "NOK", "5 799,00", 5799), + Example("7,31 €", "7,31 €", "€", "7,31", 7.31), + Example("53,20 €", "53,20 €", "€", "53,20", 53.20), + Example("Cena", "668 Kč", "Kč", "668", 668), + Example("€ 28,25", "€ 27,95", "€", "27,95", 27.95), + Example("From", "From $109.90", "$", "109.90", 109.9), + Example("Unit Price: $4.75", "$4.75", "$", "4.75", 4.75), + Example("Więcej", "14,90 zł", "zł", "14,90", 14.90), + Example("$23.00", "$23.00", "$", "23.00", 23), + Example("€ 0.00", "€ 33.00", "€", "33.00", 33), + Example("Zľava 36 €", "78 €", "€", "78", 78), + Example("£", "5.00", "£", "5.00", 5), + Example("€", "29,90", "€", "29,90", 29.9), + Example("Р", "860 Р", "Р", "860", 860), + Example("60,55 €", "60,55 €", "€", "60,55", 60.55), + Example("€", "129.00", "€", "129.00", 129), + Example("£13.50", "£13.50", "£", "13.50", 13.50), + Example("SKU:", "$39.99", "$", "39.99", 39.99), + Example( + "Disponibilidade: Pronta entrega R$60,00 até 2x de R$30,00", + "R$60,00", + "R$", + "60,00", + 60, + ), + Example("67,99 €", "64,59 €", "€", "64,59", 64.59), + Example("€ 9,90", "€ 13,50", "€", "13,50", 13.50), + Example("Р", "30 Р", "Р", "30", 30), + Example("€", "€ 139.00", "€", "139.00", 139), + Example("There are 163 products.", "From 26 to 50 €", "€", "26", 26), + Example("Pris NOK 1 999,00", "139,00", "NOK", "139,00", 139), + Example("/sqft", "1.52", None, "1.52", 1.52), + Example("$4.95", "$4.95", "$", "4.95", 4.95), + Example("$38", "$12", "$", "12", 12), + Example("Cena 4.10 €", "4.10", "€", "4.10", 4.1), + Example("руб.", "590", "руб.", "590", 590), + Example("€", "99,90", "€", "99,90", 99.9), + Example("9,50 EUR", "9,50 EUR", "EUR", "9,50", 9.50), + Example("$74.99", "$74.99", "$", "74.99", 74.99), + Example("$", "$ 3.22", "$", "3.22", 3.22), + Example("£", "3,301.00 £", "£", "3,301.00", 3301), + Example("41,78 EUR", "41,78 EUR", "EUR", "41,78", 41.78), + Example("44,50 EUR", "44,50 EUR", "EUR", "44,50", 44.50), + Example("£4.00", "£4.00", "£", "4.00", 4), + Example("Р", "7 390 Р", "Р", "7 390", 7390), + Example("eMail", "34.99€", "€", "34.99", 34.99), + Example("€", "12,99", "€", "12,99", 12.99), + Example("RRP: £ 180.00", "149.00", "£", "149.00", 149), + Example("9.00 руб.", "27.00 руб.", "руб.", "27.00", 27), + Example("Price: $19.95", "$7.95", "$", "7.95", 7.95), + Example("$16,500", "$16,500", "$", "16,500", 16500), + Example("•", "$59.99", "$", "59.99", 59.99), + Example("USD", "349.95", "USD", "349.95", 349.95), + Example("35€ 99 dont 0,02 € d'éco-part", "35€ 99", "€", "35€99", 35.99), + Example("5,72 €", "5,72 €", "€", "5,72", 5.72), + Example("199,00 грн.", "199,00 грн.", "грн.", "199,00", 199), + Example("£4.07", "£4.07", "£", "4.07", 4.07), + Example("$15.00", "$15.00", "$", "15.00", 15), + Example("€", "20.00", "€", "20.00", 20), + Example("€", "14.50", "€", "14.50", 14.5), + Example("DKK", "59,00", "DKK", "59,00", 59), + Example("9 472 Ft", "9 472 Ft", "Ft", "9 472", 9472), + Example("Cena", "95 Kč", "Kč", "95", 95), + Example("tax excl.", "€ 0,00", "€", "0,00", 0), + Example("TL", "69,50", "TL", "69,50", 69.5), + Example("Price", "Rp 169.000", "Rp", "169.000", 169000), + Example("En stock", "4,50 €", "€", "4,50", 4.50), + Example("$183.00", "$145.00", "$", "145.00", 145), + Example("£", "11.70", "£", "11.70", 11.7), + Example("25,13 €", "25,13 €", "€", "25,13", 25.13), + Example("58,00 zł", "58,00 zł", "zł", "58,00", 58), + Example("€", "15,55", "€", "15,55", 15.55), + Example("Prezzo SVB: 19,95 €", "Prezzo SVB: 19,95 €", "€", "19,95", 19.95), + Example("In stock", "$185.00", "$", "185.00", 185), + Example("18 €", "18 €", "€", "18", 18), + Example("0€", "0 €", "€", "0", 0), + Example("*", "9,41 €", "€", "9,41", 9.41), + Example("грн.", "1 075", "грн.", "1 075", 1075), + Example("More", "$22.99", "$", "22.99", 22.99), + Example("Р", "9 282 Р", "Р", "9 282", 9282), + Example("RM5", "RM50", "RM", "50", 50), + Example("7,60 €", "7,60 €", "€", "7,60", 7.6), + Example("$", "0.00", "$", "0.00", 0), + Example(". AMOSTRA .", "R$ 6,00", "R$", "6,00", 6), + Example( + "5 833,00 € -5% 6 140,00 € Tasse incl. IVA 4%", + "5 833,00 €", + "€", + "5 833,00", + 5833, + ), + Example("€ 26,95", "€ 26,95", "€", "26,95", 26.95), + Example("35,00 €", "35,00 €", "€", "35,00", 35), + Example("Р", "2 500 Р", "Р", "2 500", 2500), + Example("499,00 €", "499,00 €", "€", "499,00", 499), + Example("руб.", "1 120 900", "руб.", "1 120 900", 1120900), + Example("125,00 125,00 €", "125,00", "€", "125,00", 125), + Example("₽", "7362", "₽", "7362", 7362), + Example("SKU:", "€12.99", "€", "12.99", 12.99), + Example("р.", "600", "р.", "600", 600), + Example("79,50 €", "29,90€", "€", "29,90", 29.9), + Example("$150.00", "$150.00", "$", "150.00", 150), + Example("Р", "1 987 Р", "Р", "1 987", 1987), + Example("€69.00", "€69.00", "€", "69.00", 69), + Example("USD", "280", "USD", "280", 280), + Example("Rabatt", "6 450,00", None, "6 450,00", 6450), + Example("SKU:", "$178.00", "$", "178.00", 178), + Example("$", "$ 300.00", "$", "300.00", 300), + Example("0€", "19,1€", "€", "19,1", 19.1), + Example("R$49,90", "R$49,90", "R$", "49,90", 49.9), + Example("En stock", "790,00 € HT", "€", "790,00", 790), + Example("Cena", "Cena 14,79 €", "€", "14,79", 14.79), + Example("For Sale", "$395,000", "$", "395,000", 395000), + Example("€", "10.14", "€", "10.14", 10.14), + Example("₫", "5.00 trên 5", "₫", "5.00", 5), + Example("$ 599.00", "549.00", "$", "549.00", 549), + Example("$19", "$19", "$", "19", 19), + Example("$210", "$210", "$", "210", 210), + Example("$", "$ 79.95", "$", "79.95", 79.95), + Example("руб.", "279 000", "руб.", "279 000", 279000), + Example("2 390 €", "2 390 €", "€", "2 390", 2390), + Example("$", "$ 281.40 $ 265.70", "$", "281.40", 281.4), + Example("3200 руб. 1500 руб.", "3200 руб. 1500 руб.", "руб.", "3200", 3200), + Example("$1,299.00", "$999.00", "$", "999.00", 999), + Example("15,00 Kč", "15,00 Kč", "Kč", "15,00", 15), + Example("€", "€ 20.70", "€", "20.70", 20.7), + Example("out of stock", "30.00", None, "30.00", 30), + Example("220,00 €", "398,00 €", "€", "398,00", 398), + Example("£94.50 GBP", "£94.50 GBP", "£", "94.50", 94.5), + Example("5 427 Kč", "5 427 Kč", "Kč", "5 427", 5427), + Example("$ 24.99", "$ 24.99", "$", "24.99", 24.99), + Example("£ 2.00", "2.00", "£", "2.00", 2), + Example(">", "10,00 €", "€", "10,00", 10), + Example("32,50 EUR", "32,50 EUR", "EUR", "32,50", 32.5), + Example("In stock", "Rs1,599.00", "Rs", "1,599.00", 1599), + Example("$", "14.95", "$", "14.95", 14.95), + Example("RRP: £ 49.99", "42.90", "£", "42.90", 42.9), + Example("Rs206.00 Rs164.00 SAVE 20%", "Rs164.00", "Rs", "164.00", 164), + Example("Price:", "$6,200.00", "$", "6,200.00", 6200), + Example("PLN", "69.99", "PLN", "69.99", 69.99), + Example("€", "48,39", "€", "48,39", 48.39), + Example("1.350.000", "320.000", None, "320.000", 320000), + Example("1.650,00 € *", "2.130,00 €", "€", "2.130,00", 2130), + Example("£537.00", "£179.00", "£", "179.00", 179), + Example("SKU:", "$39.99", "$", "39.99", 39.99), + Example("SGD$4.90", "SGD$4.90", "SGD", "4.90", 4.9), + Example("SGD4.90 $", "SGD4.90 $", "SGD", "4.90", 4.9), + Example("$ SGD4.90", "$ SGD4.90", "SGD", "4.90", 4.9), ] PRICE_PARSING_EXAMPLES_NO_PRICE = [ - Example('EUR', None, - 'EUR', None, None), - Example('Kč', None, - 'Kč', None, None), - Example('50', None, - None, None, None), - Example('>', None, - None, None, None), - Example('REI', None, - None, None, None), - Example('rate', None, - None, None, None), + Example("EUR", None, "EUR", None, None), + Example("Kč", None, "Kč", None, None), + Example("50", None, None, None, None), + Example(">", None, None, None, None), + Example("REI", None, None, None, None), + Example("rate", None, None, None, None), ] PRICE_PARSING_EXAMPLES_NO_CURRENCY = [ - Example(None, '67', - None, '67', 67), - Example(None, 'naša cena 67,30 €', - '€', '67,30', 67.30), - Example(None, 'EUR29.66 (inc VAT 20% - UK & EEC) EUR24.71 (exc VAT 20% - UK & EEC)', - 'EUR', '29.66', 29.66), - Example(None, '17,00 €', - '€', '17,00', 17), - Example(None, '0,29 € + iva', - '€', '0,29', 0.29), - Example(None, '39,00 €', - '€', '39,00', 39), - Example(None, '24,00 Kč', - 'Kč', '24,00', 24), - Example(None, 'běžná cena 7 940 Kč', - 'Kč', '7 940', 7940), - Example(None, '$46.00', - '$', '46.00', 46.00), - Example(None, '$9.99 & Under', - '$', '9.99', 9.99), - Example(None, 'běžná cena 459,00 Kč', - 'Kč', '459,00', 459), - Example(None, '$60.00', - '$', '60.00', 60), - Example(None, '0,82 €', - '€', '0,82', 0.82), - Example(None, '599 Kč', - 'Kč', '599', 599), - Example(None, '€10.90', - '€', '10.90', 10.90), - Example(None, '299,00 EUR', - 'EUR', '299,00', 299), - Example(None, 'naša cena 21,95 €', - '€', '21,95', 21.95), - Example(None, '343,05 €', - '€', '343,05', 343.05), - Example(None, '1 139,00 €', - '€', '1 139,00', 1139), - Example(None, '157,000 تومان', - 'تومان', '157,000', 157000), - Example(None, '35.00', - None, '35.00', 35), - Example(None, '8.000.000 ₫', - '₫', '8.000.000', 8000000), - Example(None, '6790 Dinara', - 'Dinara', '6790', 6790), - Example(None, '3.99', - None, '3.99', 3.99), - Example(None, '£ 165.00', - '£', '165.00', 165.00), - Example(None, '$844,900', - '$', '844,900', 844900), - Example(None, '140,00 pln', - 'pln', '140,00', 140), - Example(None, '2,99 €', - '€', '2,99', 2.99), - Example(None, '145,00 lei', - 'lei', '145,00', 145), - Example(None, '3,90 €', - '€', '3,90', 3.90), - Example(None, '$149.99', - '$', '149.99', 149.99), - Example(None, '4,30 €', - '€', '4,30', 4.30), - Example(None, '$36.95', - '$', '36.95', 36.95), - Example(None, '2 499,00 zł', - 'zł', '2 499,00', 2499), - Example(None, '800 руб.', - 'руб.', '800', 800), - Example(None, '89.00', - None, '89.00', 89), - Example(None, '3 100р.', - 'р.', '3 100', 3100), - Example(None, '0,85 €', - '€', '0,85', 0.85), - Example(None, '35,95 €', - '€', '35,95', 35.95), - Example(None, '$0.42', - '$', '0.42', 0.42), - Example(None, '80,000 تومان', - 'تومان', '80,000', 80000), - Example(None, '550,00 € *', - '€', '550,00', 550), - Example(None, '25,00 zł', - 'zł', '25,00', 25), - Example(None, '17,45 EUR', - 'EUR', '17,45', 17.45), - Example(None, '49,00 €', - '€', '49,00', 49), - Example(None, '169.00', - None, '169.00', 169), - Example(None, '8,99 €', - '€', '8,99', 8.99), - Example(None, '1 099 Kč', - 'Kč', '1 099', 1099), - Example(None, '17.99', - None, '17.99', 17.99), - Example(None, '$274.95', - '$', '274.95', 274.95), - Example(None, '70,20 €', - '€', '70,20', 70.20), - Example(None, '289,00 zł', - 'zł', '289,00', 289), - Example(None, '18,00 €', - '€', '18,00', 18), - Example(None, '12,00 €', - '€', '12,00', 12), - Example(None, '$19.97', - '$', '19.97', 19.97), + Example(None, "67", None, "67", 67), + Example(None, "naša cena 67,30 €", "€", "67,30", 67.30), + Example( + None, + "EUR29.66 (inc VAT 20% - UK & EEC) EUR24.71 (exc VAT 20% - UK & EEC)", + "EUR", + "29.66", + 29.66, + ), + Example(None, "17,00 €", "€", "17,00", 17), + Example(None, "0,29 € + iva", "€", "0,29", 0.29), + Example(None, "39,00 €", "€", "39,00", 39), + Example(None, "24,00 Kč", "Kč", "24,00", 24), + Example(None, "běžná cena 7 940 Kč", "Kč", "7 940", 7940), + Example(None, "$46.00", "$", "46.00", 46.00), + Example(None, "$9.99 & Under", "$", "9.99", 9.99), + Example(None, "běžná cena 459,00 Kč", "Kč", "459,00", 459), + Example(None, "$60.00", "$", "60.00", 60), + Example(None, "0,82 €", "€", "0,82", 0.82), + Example(None, "599 Kč", "Kč", "599", 599), + Example(None, "€10.90", "€", "10.90", 10.90), + Example(None, "299,00 EUR", "EUR", "299,00", 299), + Example(None, "naša cena 21,95 €", "€", "21,95", 21.95), + Example(None, "343,05 €", "€", "343,05", 343.05), + Example(None, "1 139,00 €", "€", "1 139,00", 1139), + Example(None, "157,000 تومان", "تومان", "157,000", 157000), + Example(None, "35.00", None, "35.00", 35), + Example(None, "8.000.000 ₫", "₫", "8.000.000", 8000000), + Example(None, "6790 Dinara", "Dinara", "6790", 6790), + Example(None, "3.99", None, "3.99", 3.99), + Example(None, "£ 165.00", "£", "165.00", 165.00), + Example(None, "$844,900", "$", "844,900", 844900), + Example(None, "140,00 pln", "pln", "140,00", 140), + Example(None, "2,99 €", "€", "2,99", 2.99), + Example(None, "145,00 lei", "lei", "145,00", 145), + Example(None, "3,90 €", "€", "3,90", 3.90), + Example(None, "$149.99", "$", "149.99", 149.99), + Example(None, "4,30 €", "€", "4,30", 4.30), + Example(None, "$36.95", "$", "36.95", 36.95), + Example(None, "2 499,00 zł", "zł", "2 499,00", 2499), + Example(None, "800 руб.", "руб.", "800", 800), + Example(None, "89.00", None, "89.00", 89), + Example(None, "3 100р.", "р.", "3 100", 3100), + Example(None, "0,85 €", "€", "0,85", 0.85), + Example(None, "35,95 €", "€", "35,95", 35.95), + Example(None, "$0.42", "$", "0.42", 0.42), + Example(None, "80,000 تومان", "تومان", "80,000", 80000), + Example(None, "550,00 € *", "€", "550,00", 550), + Example(None, "25,00 zł", "zł", "25,00", 25), + Example(None, "17,45 EUR", "EUR", "17,45", 17.45), + Example(None, "49,00 €", "€", "49,00", 49), + Example(None, "169.00", None, "169.00", 169), + Example(None, "8,99 €", "€", "8,99", 8.99), + Example(None, "1 099 Kč", "Kč", "1 099", 1099), + Example(None, "17.99", None, "17.99", 17.99), + Example(None, "$274.95", "$", "274.95", 274.95), + Example(None, "70,20 €", "€", "70,20", 70.20), + Example(None, "289,00 zł", "zł", "289,00", 289), + Example(None, "18,00 €", "€", "18,00", 18), + Example(None, "12,00 €", "€", "12,00", 12), + Example(None, "$19.97", "$", "19.97", 19.97), # Example(None, '(save $2.95)', # '$', None, None), - Example(None, '749,00 euro', - 'euro', '749,00', 749), - Example(None, '$48.25', - '$', '48.25', 48.25), - Example(None, '5.00', - None, '5.00', 5.00), - Example(None, '18,00 € *', - '€', '18,00', 18), - Example(None, '$3.00', - '$', '3.00', 3.00), - Example(None, '1,85 EUR', - 'EUR', '1,85', 1.85), - Example(None, '4.25', - None, '4.25', 4.25), - Example(None, '£1.20', - '£', '1.20', 1.20), - Example(None, '$196.50', - '$', '196.50', 196.50), - Example(None, 'Price: $129.00', - '$', '129.00', 129.00), - Example(None, '179,00 €', - '€', '179,00', 179.00), - Example(None, '$80.00', - '$', '80.00', 80.00), - Example(None, '14.50', - None, '14.50', 14.50), - Example(None, 'From $ 24.95', - '$', '24.95', 24.95), - Example(None, '$5.11', - '$', '5.11', 5.11), - Example(None, 'EUR 6,99', - 'EUR', '6,99', 6.99), - Example(None, '40% OFF', - None, None, None), - Example(None, '29.99', - None, '29.99', 29.99), - Example(None, '14.00€', - '€', '14.00', 14.00), - Example(None, '22.00', - None, '22.00', 22.00), - Example(None, '$1000.00', - '$', '1000.00', 1000.00), - Example(None, '$12.95', - '$', '12.95', 12.95), - Example(None, 'běžná cena 987,20 Kč', - 'Kč', '987,20', 987.20), - Example(None, '104,64 zł', - 'zł', '104,64', 104.64), - Example(None, '163,80 €', - '€', '163,80', 163.80), - Example(None, '$89.00', - '$', '89.00', 89.00), - Example(None, '1 600 руб.', - 'руб.', '1 600', 1600), - Example(None, '20,95 € *', - '€', '20,95', 20.95), - Example(None, '9,50 €', - '€', '9,50', 9.50), - Example(None, '170,00 €', - '€', '170,00', 170), - Example(None, '170,00€', - '€', '170,00', 170), - Example(None, '6.00', - None, '6.00', 6.00), - Example(None, '$24.00', - '$', '24.00', 24.00), - Example(None, '9.95', - None, '9.95', 9.95), - Example(None, '34.12 (40.94 inc VAT)', - None, '34.12', 34.12), - Example(None, 'Rp 350.000', - 'Rp', '350.000', 350000), - Example(None, '$55.00', - '$', '55.00', 55.00), - Example(None, '$595.00', - '$', '595.00', 595.00), - Example(None, '7,00 €', - '€', '7,00', 7), - Example(None, '119.95', - None, '119.95', 119.95), - Example(None, '1.95', - None, '1.95', 1.95), - Example(None, '390,00 €', - '€', '390,00', 390), - Example(None, '3.24', - None, '3.24', 3.24), - Example(None, '12 590 Kč', - 'Kč', '12 590', 12590), - Example(None, '330 Kč', - 'Kč', '330', 330), - Example(None, '8 500 руб.', - 'руб.', '8 500', 8500), - Example(None, '589,00 €', - '€', '589,00', 589), - Example(None, '1,099.99', - None, '1,099.99', 1099.99), - Example(None, '14 196 Р', - 'Р', '14 196', 14196), - Example(None, '19.00', - None, '19.00', 19.00), - Example(None, '870 Kč', - 'Kč', '870', 870), - Example(None, '59,00 €', - '€', '59,00', 59), - Example(None, 'Pris från 172 kr', - 'kr', '172', 172), - Example(None, '1 573 Kč', - 'Kč', '1 573', 1573), - Example(None, '$2.99', - '$', '2.99', 2.99), - Example(None, '13,90 €', - '€', '13,90', 13.90), - Example(None, '29.95', - None, '29.95', 29.95), - Example(None, '/', - None, None, None), - Example(None, '16,90 €', - '€', '16,90', 16.90), - Example(None, '149.95', - None, '149.95', 149.95), - Example(None, '8.90', - None, '8.90', 8.90), - Example(None, '419', - None, '419', 419), - Example(None, '$50.00', - '$', '50.00', 50.00), - Example(None, '3 291,00 €', - '€', '3 291,00', 3291), - Example(None, '13,00 €', - '€', '13,00', 13), - Example(None, 'DKK 449,00', - 'DKK', '449,00', 449), - Example(None, '$20.00', - '$', '20.00', 20.00), - Example(None, '$154', - '$', '154', 154), - Example(None, '22.48', - None, '22.48', 22.48), - Example(None, '20,00 EUR', - 'EUR', '20,00', 20), - Example(None, '73,460 €', - '€', '73,460', 73460), - Example(None, '850 руб', - 'руб', '850', 850), - Example(None, '$14.99', - '$', '14.99', 14.99), - Example(None, '$79.95', - '$', '79.95', 79.95), - Example(None, '40,00 €', - '€', '40,00', 40), - Example(None, '149,98 €', - '€', '149,98', 149.98), - Example(None, '1 150 грн.', - 'грн.', '1 150', 1150), - Example(None, '399.00', - None, '399.00', 399.00), - Example(None, '33,90 €', - '€', '33,90', 33.90), - Example(None, '79,50 €', - '€', '79,50', 79.50), - Example(None, '40 130', - None, '40 130', 40130), - Example(None, '$69.99', - '$', '69.99', 69.99), - Example(None, '1 090 Kč', - 'Kč', '1 090', 1090), - Example(None, '395 Kč', - 'Kč', '395', 395), - Example(None, '53,95 €', - '€', '53,95', 53.95), - Example(None, '£0.99', - '£', '0.99', 0.99), - Example(None, '5,60 € *', - '€', '5,60', 5.60), - Example(None, '29,50 zł', - 'zł', '29,50', 29.50), - Example(None, '2 990', - None, '2 990', 2990), - Example(None, '0,00', - None, '0,00', 0), - Example(None, '$24.99 with card', - '$', '24.99', 24.99), - Example(None, '18,00€', - '€', '18,00', 18), - Example(None, '€600,00', - '€', '600,00', 600), - Example(None, '£25.00 (tax incl.)', - '£', '25.00', 25), - Example(None, '8,55 €', - '€', '8,55', 8.55), - Example(None, '1,422.50', - None, '1,422.50', 1422.50), - Example(None, '244,00 €', - '€', '244,00', 244.00), - Example(None, '12,90 €', - '€', '12,90', 12.90), - Example(None, '12 900,00 руб', - 'руб', '12 900,00', 12900), - Example(None, '1.727 Ft', - 'Ft', '1.727', 1727), - Example(None, '79,00 €', - '€', '79,00', 79), - Example(None, 'NZD $100.70', - 'NZD', '100.70', 100.70), - Example(None, '479.00', - None, '479.00', 479.00), - Example(None, '$ 69.00', - '$', '69.00', 69.00), - Example(None, '135,00 €', - '€', '135,00', 135.00), - Example(None, '25.00', - None, '25.00', 25.0), - Example(None, '94,90 €', - '€', '94,90', 94.90), - Example(None, '149.99', - None, '149.99', 149.99), - Example(None, '44,00 €', - '€', '44,00', 44.00), - Example(None, '$24.99', - '$', '24.99', 24.99), - Example(None, '22,00 EUR', - 'EUR', '22,00', 22.00), - Example(None, '89,90 €', - '€', '89,90', 89.90), - Example(None, '$24.95', - '$', '24.95', 24.95), - Example(None, '£ 1.99', - '£', '1.99', 1.99), - Example(None, '1 099,00 zł', - 'zł', '1 099,00', 1099), - Example(None, 'běžná cena 28 270,00 Kč', - 'Kč', '28 270,00', 28270), - Example(None, 'da € 72.00', - '€', '72.00', 72.00), - Example(None, '$15.95', - '$', '15.95', 15.95), - Example(None, 'تومان56,000', - 'تومان', '56,000', 56000), - Example(None, '$1,695.00', - '$', '1,695.00', 1695.00), - Example(None, '£595.00', - '£', '595.00', 595.00), - Example(None, '$11.95', - '$', '11.95', 11.95), - Example(None, '290,00 Kč', - 'Kč', '290,00', 290), - Example(None, '199.90 Fr.', - 'Fr.', '199.90', 199.90), - Example(None, '197 PLN', - 'PLN', '197', 197), - Example(None, '9.99', - None, '9.99', 9.99), - Example(None, '$56.00', - '$', '56.00', 56.00), - Example(None, '4 980 Kč', - 'Kč', '4 980', 4980), - Example(None, '124,00 €', - '€', '124,00', 124), - Example(None, '$104.99', - '$', '104.99', 104.99), - Example(None, '39,00 €', - '€', '39,00', 39), - Example(None, '1 029,00 €', - '€', '1 029,00', 1029), - Example(None, 'Běžná cena 299,00 Kč', - 'Kč', '299,00', 299), - Example(None, '745,00 €', - '€', '745,00', 745), - Example(None, '$89.00', - '$', '89.00', 89), - Example(None, '$29.95', - '$', '29.95', 29.95), - Example(None, '2.00', - None, '2.00', 2.00), - Example(None, '249.99', - None, '249.99', 249.99), - Example(None, '24.99', - None, '24.99', 24.99), - Example(None, '1 499 Kč', - 'Kč', '1 499', 1499), - Example(None, '199,95 €', - '€', '199,95', 199.95), - Example(None, '6,00 €', - '€', '6,00', 6), - Example(None, '$28.49', - '$', '28.49', 28.49), - Example(None, '200.000 đ', - 'đ', '200.000', 200000), - Example(None, '9,24 €', - '€', '9,24', 9.24), - Example(None, '48,00 €', - '€', '48,00', 48.00), - Example(None, 'Cena : 890 Kč', - 'Kč', '890', 890), - Example(None, '790.00', - None, '790.00', 790.00), - Example(None, '17 260 руб.', - 'руб.', '17 260', 17260), - Example(None, '227,000 تومان', - 'تومان', '227,000', 227000), - Example(None, '295,88 €', - '€', '295,88', 295.88), - Example(None, '£1399', - '£', '1399', 1399), - Example(None, '11,33 Br', - 'Br', '11,33', 11.33), - Example(None, '325.95', - None, '325.95', 325.95), - Example(None, '$19.50', - '$', '19.50', 19.50), - Example(None, '19,00 €', - '€', '19,00', 19), - Example(None, '2 999,00 €', - '€', '2 999,00', 2999), - Example(None, '49.95', - None, '49.95', 49.95), - Example(None, '99 LEI', - 'LEI', '99', 99), - Example(None, '249 Kč', - 'Kč', '249', 249), - Example(None, '3.79', - None, '3.79', 3.79), - Example(None, 'běžná cena 890 Kč', - 'Kč', '890', 890), - Example(None, '$809,000', - '$', '809,000', 809000), - Example(None, '450 000 ₫', - '₫', '450 000', 450000), - Example(None, '30,00 €', - '€', '30,00', 30.00), - Example(None, '14.95', - None, '14.95', 14.95), - Example(None, '12.50', - None, '12.50', 12.50), - Example(None, '129,00 € (-15%)', - '€', '129,00', 129.00), - Example(None, '12,90 €', - '€', '12,90', 12.90), - Example(None, 'A partir de 11,70 €', - '€', '11,70', 11.70), - Example(None, '15.49', - None, '15.49', 15.49), - Example(None, '12.34 €', - '€', '12.34', 12.34), - Example(None, '€799,00', - '€', '799,00', 799), - Example(None, '230 лв.', - 'лв.', '230', 230), - Example(None, '14.55 €', - '€', '14.55', 14.55), - Example(None, '133,86 LEI', - 'LEI', '133,86', 133.86), - Example(None, '7 990,00 Kč', - 'Kč', '7 990,00', 7990), - Example(None, '350.00', - None, '350.00', 350.00), - Example(None, 'Cena: 55,72 zł brutto', - 'zł', '55,72', 55.72), - Example(None, 'O blenderach Omniblend', - None, None, None), - Example(None, '3,822.00', - None, '3,822.00', 3822), - Example(None, '0,15 €', - '€', '0,15', 0.15), - Example(None, '430,00 €', - '€', '430,00', 430), - Example(None, '$29.00', - '$', '29.00', 29.00), - Example(None, '39.99', - None, '39.99', 39.99), - Example(None, '$15.00', - '$', '15.00', 15.00), - Example(None, '21,00 Lei', - 'Lei', '21,00', 21.00), - Example(None, 'naše cena 250,00 Kč', - 'Kč', '250,00', 250.00), - Example(None, '$24.95', - '$', '24.95', 24.95), - Example(None, '162.18', - None, '162.18', 162.18), - Example(None, '39,60 EUR', - 'EUR', '39,60', 39.60), - Example(None, '10,75 €', - '€', '10,75', 10.75), - Example(None, '219 руб.', - 'руб.', '219', 219), - Example(None, '89,00 € *', - '€', '89,00', 89.00), - Example(None, '151,200 تومان', - 'تومان', '151,200', 151200), - Example(None, '$159.99', - '$', '159.99', 159.99), - Example(None, '2.49', - None, '2.49', 2.49), - Example(None, '7.38', - None, '7.38', 7.38), - Example(None, '62,00 zł', - 'zł', '62,00', 62.00), - Example(None, '$20.00', - '$', '20.00', 20), - Example(None, '$ 50.00', - '$', '50.00', 50), - Example(None, '34.99', - None, '34.99', 34.99), - Example(None, '318,00 €', - '€', '318,00', 318), - Example(None, '11.499,00 EUR', - 'EUR', '11.499,00', 11499), - Example(None, '571.12坪', # area, not currency - None, '571.12', 571.12), - Example(None, '€ 75.00', - '€', '75.00', 75.00), - Example(None, '11,90 € *', - '€', '11,90', 11.90), - Example(None, '€0.51', - '€', '0.51', 0.51), - Example(None, '6,50 €', - '€', '6,50', 6.50), - Example(None, '790 Kč', - 'Kč', '790', 790), - Example(None, 'ab 2.99 €', - '€', '2.99', 2.99), - Example(None, '369', - None, '369', 369), - Example(None, '134.96', - None, '134.96', 134.96), - Example(None, '135 lei', - 'lei', '135', 135), - Example(None, '2,99 € *', - '€', '2,99', 2.99), - Example(None, '$9.99', - '$', '9.99', 9.99), - Example(None, '2.950,00 €', - '€', '2.950,00', 2950), - Example(None, '19.99', - None, '19.99', 19.99), - Example(None, '49 lei', - 'lei', '49', 49), - Example(None, '31,07 € (bez DPH)', - '€', '31,07', 31.07), - Example(None, '56.00', - None, '56.00', 56.00), - Example(None, '54.95', - None, '54.95', 54.95), - Example(None, '$ 80.00', - '$', '80.00', 80.00), - Example(None, '$39.00', - '$', '39.00', 39.00), - Example(None, 'Rp 221.000', - 'Rp', '221.000', 221000), - Example(None, '35,90 EUR', - 'EUR', '35,90', 35.90), - Example(None, '4 835,50 €', - '€', '4 835,50', 4835.50), - Example(None, '75,00€', - '€', '75,00', 75), - Example(None, '$21.95', - '$', '21.95', 21.95), - Example(None, '737,00', - None, '737,00', 737), - Example(None, '129,00 € **', - '€', '129,00', 129), - Example(None, '2 399 Kč', - 'Kč', '2 399', 2399), - Example(None, '430 руб', - 'руб', '430', 430), - Example(None, '69.95', - None, '69.95', 69.95), - Example(None, '$0.00', - '$', '0.00', 0), - Example(None, '49.56', - None, '49.56', 49.56), - Example(None, '0,00 EUR', - 'EUR', '0,00', 0), - Example(None, '145,00 Kč', - 'Kč', '145,00', 145), - Example(None, '99,00 lei', - 'lei', '99,00', 99), - Example(None, '$750,000', - '$', '750,000', 750000), - Example(None, '$49.99', - '$', '49.99', 49.99), - Example(None, '29.00', - None, '29.00', 29.00), - Example(None, '$7.20', - '$', '7.20', 7.20), - Example(None, '69.00', - None, '69.00', 69.00), - Example(None, '4.47', - None, '4.47', 4.47), - Example(None, '39,90 € *', - '€', '39,90', 39.90), - Example(None, '469,00 €', - '€', '469,00', 469), - Example(None, '24.38', - None, '24.38', 24.38), - Example(None, '6,24', - None, '6,24', 6.24), - Example(None, '$89.00', - '$', '89.00', 89.00), - Example(None, '24,35 €', - '€', '24,35', 24.35), - Example(None, 'Pris från 805 kr', - 'kr', '805', 805), - Example(None, '295 Kč', - 'Kč', '295', 295), - Example(None, '175.00', - None, '175.00', 175.00), - Example(None, '7 990 kr', - 'kr', '7 990', 7990), - Example(None, '14,00 €', - '€', '14,00', 14), - Example(None, '249 Kč', - 'Kč', '249', 249), - Example(None, '£39.95', - '£', '39.95', 39.95), - Example(None, '10,75 TL', - 'TL', '10,75', 10.75), - Example(None, '$25.00', - '$', '25.00', 25.00), - Example(None, '1 720,00 zł', - 'zł', '1 720,00', 1720), - Example(None, 'běžná cena 749 Kč', - 'Kč', '749', 749), - Example(None, '425,00 €', - '€', '425,00', 425), - Example(None, '59.00', - None, '59.00', 59.00), - Example(None, '1,120.00', - None, '1,120.00', 1120), - Example(None, 'a partire da 7,32 € *', - '€', '7,32', 7.32), - Example(None, '148.50 Inc GST', - None, '148.50', 148.50), # India? - Example(None, '7.49', - None, '7.49', 7.49), - Example(None, '80.00', - None, '80.00', 80.00), - Example(None, '93 499 Kč', - 'Kč', '93 499', 93499), - Example(None, '1.599,00 € *', - '€', '1.599,00', 1599), - Example(None, 'ab 3,63 EUR', - 'EUR', '3,63', 3.63), - Example(None, '29,90 EUR', - 'EUR', '29,90', 29.90), - Example(None, '$3.95', - '$', '3.95', 3.95), - Example(None, '3430 лв.', - 'лв.', '3430', 3430), - Example(None, '724,00 €', - '€', '724,00', 724), - Example(None, '18,00 €', - '€', '18,00', 18), - Example(None, '6,75 €', - '€', '6,75', 6.75), - Example(None, '29,90 € *', - '€', '29,90', 29.90), - Example(None, '135.99', - None, '135.99', 135.99), - Example(None, '30,000 تومان', - 'تومان', '30,000', 30000), + Example(None, "749,00 euro", "euro", "749,00", 749), + Example(None, "$48.25", "$", "48.25", 48.25), + Example(None, "5.00", None, "5.00", 5.00), + Example(None, "18,00 € *", "€", "18,00", 18), + Example(None, "$3.00", "$", "3.00", 3.00), + Example(None, "1,85 EUR", "EUR", "1,85", 1.85), + Example(None, "4.25", None, "4.25", 4.25), + Example(None, "£1.20", "£", "1.20", 1.20), + Example(None, "$196.50", "$", "196.50", 196.50), + Example(None, "Price: $129.00", "$", "129.00", 129.00), + Example(None, "179,00 €", "€", "179,00", 179.00), + Example(None, "$80.00", "$", "80.00", 80.00), + Example(None, "14.50", None, "14.50", 14.50), + Example(None, "From $ 24.95", "$", "24.95", 24.95), + Example(None, "$5.11", "$", "5.11", 5.11), + Example(None, "EUR 6,99", "EUR", "6,99", 6.99), + Example(None, "40% OFF", None, None, None), + Example(None, "29.99", None, "29.99", 29.99), + Example(None, "14.00€", "€", "14.00", 14.00), + Example(None, "22.00", None, "22.00", 22.00), + Example(None, "$1000.00", "$", "1000.00", 1000.00), + Example(None, "$12.95", "$", "12.95", 12.95), + Example(None, "běžná cena 987,20 Kč", "Kč", "987,20", 987.20), + Example(None, "104,64 zł", "zł", "104,64", 104.64), + Example(None, "163,80 €", "€", "163,80", 163.80), + Example(None, "$89.00", "$", "89.00", 89.00), + Example(None, "1 600 руб.", "руб.", "1 600", 1600), + Example(None, "20,95 € *", "€", "20,95", 20.95), + Example(None, "9,50 €", "€", "9,50", 9.50), + Example(None, "170,00 €", "€", "170,00", 170), + Example(None, "170,00€", "€", "170,00", 170), + Example(None, "6.00", None, "6.00", 6.00), + Example(None, "$24.00", "$", "24.00", 24.00), + Example(None, "9.95", None, "9.95", 9.95), + Example(None, "34.12 (40.94 inc VAT)", None, "34.12", 34.12), + Example(None, "Rp 350.000", "Rp", "350.000", 350000), + Example(None, "$55.00", "$", "55.00", 55.00), + Example(None, "$595.00", "$", "595.00", 595.00), + Example(None, "7,00 €", "€", "7,00", 7), + Example(None, "119.95", None, "119.95", 119.95), + Example(None, "1.95", None, "1.95", 1.95), + Example(None, "390,00 €", "€", "390,00", 390), + Example(None, "3.24", None, "3.24", 3.24), + Example(None, "12 590 Kč", "Kč", "12 590", 12590), + Example(None, "330 Kč", "Kč", "330", 330), + Example(None, "8 500 руб.", "руб.", "8 500", 8500), + Example(None, "589,00 €", "€", "589,00", 589), + Example(None, "1,099.99", None, "1,099.99", 1099.99), + Example(None, "14 196 Р", "Р", "14 196", 14196), + Example(None, "19.00", None, "19.00", 19.00), + Example(None, "870 Kč", "Kč", "870", 870), + Example(None, "59,00 €", "€", "59,00", 59), + Example(None, "Pris från 172 kr", "kr", "172", 172), + Example(None, "1 573 Kč", "Kč", "1 573", 1573), + Example(None, "$2.99", "$", "2.99", 2.99), + Example(None, "13,90 €", "€", "13,90", 13.90), + Example(None, "29.95", None, "29.95", 29.95), + Example(None, "/", None, None, None), + Example(None, "16,90 €", "€", "16,90", 16.90), + Example(None, "149.95", None, "149.95", 149.95), + Example(None, "8.90", None, "8.90", 8.90), + Example(None, "419", None, "419", 419), + Example(None, "$50.00", "$", "50.00", 50.00), + Example(None, "3 291,00 €", "€", "3 291,00", 3291), + Example(None, "13,00 €", "€", "13,00", 13), + Example(None, "DKK 449,00", "DKK", "449,00", 449), + Example(None, "$20.00", "$", "20.00", 20.00), + Example(None, "$154", "$", "154", 154), + Example(None, "22.48", None, "22.48", 22.48), + Example(None, "20,00 EUR", "EUR", "20,00", 20), + Example(None, "73,460 €", "€", "73,460", 73460), + Example(None, "850 руб", "руб", "850", 850), + Example(None, "$14.99", "$", "14.99", 14.99), + Example(None, "$79.95", "$", "79.95", 79.95), + Example(None, "40,00 €", "€", "40,00", 40), + Example(None, "149,98 €", "€", "149,98", 149.98), + Example(None, "1 150 грн.", "грн.", "1 150", 1150), + Example(None, "399.00", None, "399.00", 399.00), + Example(None, "33,90 €", "€", "33,90", 33.90), + Example(None, "79,50 €", "€", "79,50", 79.50), + Example(None, "40 130", None, "40 130", 40130), + Example(None, "$69.99", "$", "69.99", 69.99), + Example(None, "1 090 Kč", "Kč", "1 090", 1090), + Example(None, "395 Kč", "Kč", "395", 395), + Example(None, "53,95 €", "€", "53,95", 53.95), + Example(None, "£0.99", "£", "0.99", 0.99), + Example(None, "5,60 € *", "€", "5,60", 5.60), + Example(None, "29,50 zł", "zł", "29,50", 29.50), + Example(None, "2 990", None, "2 990", 2990), + Example(None, "0,00", None, "0,00", 0), + Example(None, "$24.99 with card", "$", "24.99", 24.99), + Example(None, "18,00€", "€", "18,00", 18), + Example(None, "€600,00", "€", "600,00", 600), + Example(None, "£25.00 (tax incl.)", "£", "25.00", 25), + Example(None, "8,55 €", "€", "8,55", 8.55), + Example(None, "1,422.50", None, "1,422.50", 1422.50), + Example(None, "244,00 €", "€", "244,00", 244.00), + Example(None, "12,90 €", "€", "12,90", 12.90), + Example(None, "12 900,00 руб", "руб", "12 900,00", 12900), + Example(None, "1.727 Ft", "Ft", "1.727", 1727), + Example(None, "79,00 €", "€", "79,00", 79), + Example(None, "NZD $100.70", "NZD", "100.70", 100.70), + Example(None, "479.00", None, "479.00", 479.00), + Example(None, "$ 69.00", "$", "69.00", 69.00), + Example(None, "135,00 €", "€", "135,00", 135.00), + Example(None, "25.00", None, "25.00", 25.0), + Example(None, "94,90 €", "€", "94,90", 94.90), + Example(None, "149.99", None, "149.99", 149.99), + Example(None, "44,00 €", "€", "44,00", 44.00), + Example(None, "$24.99", "$", "24.99", 24.99), + Example(None, "22,00 EUR", "EUR", "22,00", 22.00), + Example(None, "89,90 €", "€", "89,90", 89.90), + Example(None, "$24.95", "$", "24.95", 24.95), + Example(None, "£ 1.99", "£", "1.99", 1.99), + Example(None, "1 099,00 zł", "zł", "1 099,00", 1099), + Example(None, "běžná cena 28 270,00 Kč", "Kč", "28 270,00", 28270), + Example(None, "da € 72.00", "€", "72.00", 72.00), + Example(None, "$15.95", "$", "15.95", 15.95), + Example(None, "تومان56,000", "تومان", "56,000", 56000), + Example(None, "$1,695.00", "$", "1,695.00", 1695.00), + Example(None, "£595.00", "£", "595.00", 595.00), + Example(None, "$11.95", "$", "11.95", 11.95), + Example(None, "290,00 Kč", "Kč", "290,00", 290), + Example(None, "199.90 Fr.", "Fr.", "199.90", 199.90), + Example(None, "197 PLN", "PLN", "197", 197), + Example(None, "9.99", None, "9.99", 9.99), + Example(None, "$56.00", "$", "56.00", 56.00), + Example(None, "4 980 Kč", "Kč", "4 980", 4980), + Example(None, "124,00 €", "€", "124,00", 124), + Example(None, "$104.99", "$", "104.99", 104.99), + Example(None, "39,00 €", "€", "39,00", 39), + Example(None, "1 029,00 €", "€", "1 029,00", 1029), + Example(None, "Běžná cena 299,00 Kč", "Kč", "299,00", 299), + Example(None, "745,00 €", "€", "745,00", 745), + Example(None, "$89.00", "$", "89.00", 89), + Example(None, "$29.95", "$", "29.95", 29.95), + Example(None, "2.00", None, "2.00", 2.00), + Example(None, "249.99", None, "249.99", 249.99), + Example(None, "24.99", None, "24.99", 24.99), + Example(None, "1 499 Kč", "Kč", "1 499", 1499), + Example(None, "199,95 €", "€", "199,95", 199.95), + Example(None, "6,00 €", "€", "6,00", 6), + Example(None, "$28.49", "$", "28.49", 28.49), + Example(None, "200.000 đ", "đ", "200.000", 200000), + Example(None, "9,24 €", "€", "9,24", 9.24), + Example(None, "48,00 €", "€", "48,00", 48.00), + Example(None, "Cena : 890 Kč", "Kč", "890", 890), + Example(None, "790.00", None, "790.00", 790.00), + Example(None, "17 260 руб.", "руб.", "17 260", 17260), + Example(None, "227,000 تومان", "تومان", "227,000", 227000), + Example(None, "295,88 €", "€", "295,88", 295.88), + Example(None, "£1399", "£", "1399", 1399), + Example(None, "11,33 Br", "Br", "11,33", 11.33), + Example(None, "325.95", None, "325.95", 325.95), + Example(None, "$19.50", "$", "19.50", 19.50), + Example(None, "19,00 €", "€", "19,00", 19), + Example(None, "2 999,00 €", "€", "2 999,00", 2999), + Example(None, "49.95", None, "49.95", 49.95), + Example(None, "99 LEI", "LEI", "99", 99), + Example(None, "249 Kč", "Kč", "249", 249), + Example(None, "3.79", None, "3.79", 3.79), + Example(None, "běžná cena 890 Kč", "Kč", "890", 890), + Example(None, "$809,000", "$", "809,000", 809000), + Example(None, "450 000 ₫", "₫", "450 000", 450000), + Example(None, "30,00 €", "€", "30,00", 30.00), + Example(None, "14.95", None, "14.95", 14.95), + Example(None, "12.50", None, "12.50", 12.50), + Example(None, "129,00 € (-15%)", "€", "129,00", 129.00), + Example(None, "12,90 €", "€", "12,90", 12.90), + Example(None, "A partir de 11,70 €", "€", "11,70", 11.70), + Example(None, "15.49", None, "15.49", 15.49), + Example(None, "12.34 €", "€", "12.34", 12.34), + Example(None, "€799,00", "€", "799,00", 799), + Example(None, "230 лв.", "лв.", "230", 230), + Example(None, "14.55 €", "€", "14.55", 14.55), + Example(None, "133,86 LEI", "LEI", "133,86", 133.86), + Example(None, "7 990,00 Kč", "Kč", "7 990,00", 7990), + Example(None, "350.00", None, "350.00", 350.00), + Example(None, "Cena: 55,72 zł brutto", "zł", "55,72", 55.72), + Example(None, "O blenderach Omniblend", None, None, None), + Example(None, "3,822.00", None, "3,822.00", 3822), + Example(None, "0,15 €", "€", "0,15", 0.15), + Example(None, "430,00 €", "€", "430,00", 430), + Example(None, "$29.00", "$", "29.00", 29.00), + Example(None, "39.99", None, "39.99", 39.99), + Example(None, "$15.00", "$", "15.00", 15.00), + Example(None, "21,00 Lei", "Lei", "21,00", 21.00), + Example(None, "naše cena 250,00 Kč", "Kč", "250,00", 250.00), + Example(None, "$24.95", "$", "24.95", 24.95), + Example(None, "162.18", None, "162.18", 162.18), + Example(None, "39,60 EUR", "EUR", "39,60", 39.60), + Example(None, "10,75 €", "€", "10,75", 10.75), + Example(None, "219 руб.", "руб.", "219", 219), + Example(None, "89,00 € *", "€", "89,00", 89.00), + Example(None, "151,200 تومان", "تومان", "151,200", 151200), + Example(None, "$159.99", "$", "159.99", 159.99), + Example(None, "2.49", None, "2.49", 2.49), + Example(None, "7.38", None, "7.38", 7.38), + Example(None, "62,00 zł", "zł", "62,00", 62.00), + Example(None, "$20.00", "$", "20.00", 20), + Example(None, "$ 50.00", "$", "50.00", 50), + Example(None, "34.99", None, "34.99", 34.99), + Example(None, "318,00 €", "€", "318,00", 318), + Example(None, "11.499,00 EUR", "EUR", "11.499,00", 11499), + Example(None, "571.12坪", None, "571.12", 571.12), # area, not currency + Example(None, "€ 75.00", "€", "75.00", 75.00), + Example(None, "11,90 € *", "€", "11,90", 11.90), + Example(None, "€0.51", "€", "0.51", 0.51), + Example(None, "6,50 €", "€", "6,50", 6.50), + Example(None, "790 Kč", "Kč", "790", 790), + Example(None, "ab 2.99 €", "€", "2.99", 2.99), + Example(None, "369", None, "369", 369), + Example(None, "134.96", None, "134.96", 134.96), + Example(None, "135 lei", "lei", "135", 135), + Example(None, "2,99 € *", "€", "2,99", 2.99), + Example(None, "$9.99", "$", "9.99", 9.99), + Example(None, "2.950,00 €", "€", "2.950,00", 2950), + Example(None, "19.99", None, "19.99", 19.99), + Example(None, "49 lei", "lei", "49", 49), + Example(None, "31,07 € (bez DPH)", "€", "31,07", 31.07), + Example(None, "56.00", None, "56.00", 56.00), + Example(None, "54.95", None, "54.95", 54.95), + Example(None, "$ 80.00", "$", "80.00", 80.00), + Example(None, "$39.00", "$", "39.00", 39.00), + Example(None, "Rp 221.000", "Rp", "221.000", 221000), + Example(None, "35,90 EUR", "EUR", "35,90", 35.90), + Example(None, "4 835,50 €", "€", "4 835,50", 4835.50), + Example(None, "75,00€", "€", "75,00", 75), + Example(None, "$21.95", "$", "21.95", 21.95), + Example(None, "737,00", None, "737,00", 737), + Example(None, "129,00 € **", "€", "129,00", 129), + Example(None, "2 399 Kč", "Kč", "2 399", 2399), + Example(None, "430 руб", "руб", "430", 430), + Example(None, "69.95", None, "69.95", 69.95), + Example(None, "$0.00", "$", "0.00", 0), + Example(None, "49.56", None, "49.56", 49.56), + Example(None, "0,00 EUR", "EUR", "0,00", 0), + Example(None, "145,00 Kč", "Kč", "145,00", 145), + Example(None, "99,00 lei", "lei", "99,00", 99), + Example(None, "$750,000", "$", "750,000", 750000), + Example(None, "$49.99", "$", "49.99", 49.99), + Example(None, "29.00", None, "29.00", 29.00), + Example(None, "$7.20", "$", "7.20", 7.20), + Example(None, "69.00", None, "69.00", 69.00), + Example(None, "4.47", None, "4.47", 4.47), + Example(None, "39,90 € *", "€", "39,90", 39.90), + Example(None, "469,00 €", "€", "469,00", 469), + Example(None, "24.38", None, "24.38", 24.38), + Example(None, "6,24", None, "6,24", 6.24), + Example(None, "$89.00", "$", "89.00", 89.00), + Example(None, "24,35 €", "€", "24,35", 24.35), + Example(None, "Pris från 805 kr", "kr", "805", 805), + Example(None, "295 Kč", "Kč", "295", 295), + Example(None, "175.00", None, "175.00", 175.00), + Example(None, "7 990 kr", "kr", "7 990", 7990), + Example(None, "14,00 €", "€", "14,00", 14), + Example(None, "249 Kč", "Kč", "249", 249), + Example(None, "£39.95", "£", "39.95", 39.95), + Example(None, "10,75 TL", "TL", "10,75", 10.75), + Example(None, "$25.00", "$", "25.00", 25.00), + Example(None, "1 720,00 zł", "zł", "1 720,00", 1720), + Example(None, "běžná cena 749 Kč", "Kč", "749", 749), + Example(None, "425,00 €", "€", "425,00", 425), + Example(None, "59.00", None, "59.00", 59.00), + Example(None, "1,120.00", None, "1,120.00", 1120), + Example(None, "a partire da 7,32 € *", "€", "7,32", 7.32), + Example(None, "148.50 Inc GST", None, "148.50", 148.50), # India? + Example(None, "7.49", None, "7.49", 7.49), + Example(None, "80.00", None, "80.00", 80.00), + Example(None, "93 499 Kč", "Kč", "93 499", 93499), + Example(None, "1.599,00 € *", "€", "1.599,00", 1599), + Example(None, "ab 3,63 EUR", "EUR", "3,63", 3.63), + Example(None, "29,90 EUR", "EUR", "29,90", 29.90), + Example(None, "$3.95", "$", "3.95", 3.95), + Example(None, "3430 лв.", "лв.", "3430", 3430), + Example(None, "724,00 €", "€", "724,00", 724), + Example(None, "18,00 €", "€", "18,00", 18), + Example(None, "6,75 €", "€", "6,75", 6.75), + Example(None, "29,90 € *", "€", "29,90", 29.90), + Example(None, "135.99", None, "135.99", 135.99), + Example(None, "30,000 تومان", "تومان", "30,000", 30000), # Example(None, '191.6 KB', # None, None, None), - Example(None, '1 500 Kč', - 'Kč', '1 500', 1500), - Example(None, '349,00 €', - '€', '349,00', 349), - Example(None, '$250.00', - '$', '250.00', 250.00), - Example(None, '44.95', - None, '44.95', 44.95), - Example(None, '$22.75', - '$', '22.75', 22.75), - Example(None, '250,00 €', - '€', '250,00', 250), - Example(None, '14.96 €', - '€', '14.96', 14.96), - Example(None, '$4,350.00', - '$', '4,350.00', 4350), - Example(None, '379 Kč', - 'Kč', '379', 379), - Example(None, '19,50 EUR', - 'EUR', '19,50', 19.5), - Example(None, '33,68 zł', - 'zł', '33,68', 33.68), - Example(None, '6.70€', - '€', '6.70', 6.70), - Example(None, '$29.99', - '$', '29.99', 29.99), - Example(None, '6.50', - None, '6.50', 6.50), + Example(None, "1 500 Kč", "Kč", "1 500", 1500), + Example(None, "349,00 €", "€", "349,00", 349), + Example(None, "$250.00", "$", "250.00", 250.00), + Example(None, "44.95", None, "44.95", 44.95), + Example(None, "$22.75", "$", "22.75", 22.75), + Example(None, "250,00 €", "€", "250,00", 250), + Example(None, "14.96 €", "€", "14.96", 14.96), + Example(None, "$4,350.00", "$", "4,350.00", 4350), + Example(None, "379 Kč", "Kč", "379", 379), + Example(None, "19,50 EUR", "EUR", "19,50", 19.5), + Example(None, "33,68 zł", "zł", "33,68", 33.68), + Example(None, "6.70€", "€", "6.70", 6.70), + Example(None, "$29.99", "$", "29.99", 29.99), + Example(None, "6.50", None, "6.50", 6.50), ] PRICE_PARSING_EXAMPLES_3 = [ - Example('R$', 'R$ 139,99 R$ 135,99', - 'R$', '139,99', 139.99), - Example('£', '£ 34.99', - '£', '34.99', 34.99), - Example('Price', '$7.65', - '$', '7.65', 7.65), - Example('€', '75,00', - '€', '75,00', 75), - Example(None, '34,90 €', - '€', '34,90', 34.90), - Example(None, '629.95', - None, '629.95', 629.95), - Example('11000 руб.', '47700 руб.', - 'руб.', '47700', 47700), - Example('$29.99 – $74.99', '$29.99', - '$', '29.99', 29.99), - Example(None, '174,00 €', - '€', '174,00', 174), - Example(None, '18,00 €', - '€', '18,00', 18), - Example('Price:', '$19.50', - '$', '19.50', 19.50), - Example('8 390 руб.', '8 390 руб.', - 'руб.', '8 390', 8390), - Example(None, '55,00 €', - '€', '55,00', 55), - Example('€333.00', '€299.71', - '€', '299.71', 299.71), - Example(None, '384,00 €', - '€', '384,00', 384), - Example('From:', 'From: $14.97', - '$', '14.97', 14.97), - Example(None, '0,00 €', - '€', '0,00', 0), - Example(None, '€ 280,00', - '€', '280,00', 280), - Example(None, '11 450 Kč', - 'Kč', '11 450', 11450), - Example('Price $118.15', '$118.15', - '$', '118.15', 118.15), - Example('€', '49.99', - '€', '49.99', 49.99), - Example('1,15 €', '1,15 €', - '€', '1,15', 1.15), - Example('17,99 €', '31,93 €', - '€', '31,93', 31.93), - Example(None, 'र24,401', - 'र', '24,401', 24401), - Example(None, '$60.00', - '$', '60.00', 60), - Example('12,15 €', '12,15 €', - '€', '12,15', 12.15), - Example('£ 163.95', '163.95', - '£', '163.95', 163.95), - Example(None, '30,00 €', - '€', '30,00', 30), - Example('zł', '165,00 zł', - 'zł', '165,00', 165), - Example('469.00zł Bez podatku: 381.30zł', '469.00zł', - 'zł', '469.00', 469), - Example(None, '72.95', - None, '72.95', 72.95), - Example('Costo: $2,222.- Más IVA', 'MX$3,179.00', - 'MX$', '3,179.00', 3179), - Example(None, 'naše cena 4 370 Kč', - 'Kč', '4 370', 4370), - Example('€', '21,33 €', - '€', '21,33', 21.33), - Example(None, '49.95', - None, '49.95', 49.95), - Example(None, 'Před slevou 59 900 Kč', - 'Kč', '59 900', 59900), - Example('ab', '6,78 € *', - '€', '6,78', 6.78), - Example(None, '442', - None, '442', 442), - Example('18.10 €', '16.00 €', - '€', '16.00', 16.00), - Example(None, '0.00', - None, '0.00', 0.00), - Example(None, '379,00 € *', - '€', '379,00', 379.00), - Example(None, '125.00', - None, '125.00', 125.00), - Example(None, '£ 30.84', - '£', '30.84', 30.84), - Example(None, '259,00 €', - '€', '259,00', 259), - Example('à partir de 1540 € / pers', '1540 €', - '€', '1540', 1540), - Example(None, '95 €', - '€', '95', 95), - Example(None, '53.79', - None, '53.79', 53.79), - Example('NT$', 'NT$ 1,160', - 'NT$', '1,160', 1160), - Example('ACTIVE', '$69,900', - '$', '69,900', 69900), - Example(None, '$14.95', - '$', '14.95', 14.95), - Example('₹', '₹ 4649', - '₹', '4649', 4649), - Example('25 грн', '25 грн', - 'грн', '25', 25), - Example('€', '16,40', - '€', '16,40', 16.40), - Example('PLN', '0,46', - 'PLN', '0,46', 0.46), - Example('£', '£ 261.25', - '£', '261.25', 261.25), - Example(None, '$0.00', - '$', '0.00', 0), - Example(None, '24.95', - None, '24.95', 24.95), - Example('грн.', '27.00', - 'грн.', '27.00', 27.00), - Example('New', '$189,900', - '$', '189,900', 189900), - Example('NA', '$269', - '$', '269', 269), - Example('$279', '$189', - '$', '189', 189), - Example(None, '160,00 zł', - 'zł', '160,00', 160), - Example('2 069 рублей', '2 400', - 'руб', '2 400', 2400), - Example('Sale Price: $4.59', '$4.59', - '$', '4.59', 4.59), - Example('Купить', '542 руб.', - 'руб.', '542', 542), - Example(None, '$19.99', - '$', '19.99', 19.99), - Example('Price', '$6.45', - '$', '6.45', 6.45), - Example(None, '32.99', - None, '32.99', 32.99), - Example(None, '$86.44', - '$', '86.44', 86.44), - Example(None, '25.00€', - '€', '25.00', 25.00), - Example(None, '99,00 €', - '€', '99,00', 99.00), - Example(None, '103.90', - None, '103.90', 103.90), - Example('14,00 € *', '25,00 € *', - '€', '25,00', 25.00), - Example(None, '$6.49', - '$', '6.49', 6.49), - Example('€ 59,95', '€ 59,95', - '€', '59,95', 59.95), - Example(None, 'Běžná cena 75 990,00 Kč', - 'Kč', '75 990,00', 75990), - Example('Price', 'Rp 1.550.000', - 'Rp', '1.550.000', 1550000), - Example('грн.', '1 430', - 'грн.', '1 430', 1430), - Example('руб. (шт)', '1 690,54 руб. (шт)', - 'руб.', '1 690,54', 1690.54), - Example('69 TL 41.90 TL', '69 TL 41.90 TL', - 'TL', '69', 69), - Example('ALIDAD', '960,00 €', - '€', '960,00', 960), - Example(None, '184,35 lei', - 'lei', '184,35', 184.35), - Example(None, '1 505 Kč', - 'Kč', '1 505', 1505), - Example(None, '23,00 € *', - '€', '23,00', 23), - Example(None, '25.97', - None, '25.97', 25.97), - Example(None, '58,19 €', - '€', '58,19', 58.19), - Example(None, '27.00 лв.', - 'лв.', '27.00', 27.00), - Example('48,00 €', '3,85 €', - '€', '3,85', 3.85), - Example(None, '10,90 €', - '€', '10,90', 10.90), - Example('$ 879.0', '$ 879.0', - '$', '879.0', 879.0), - Example('EUR', '25.88', - 'EUR', '25.88', 25.88), - Example(None, 'R$215,10', - 'R$', '215,10', 215.10), - Example('£', '£ 12.50', - '£', '12.50', 12.50), - Example(None, '3 173,00 €', - '€', '3 173,00', 3173), - Example(None, '34,94 € *', - '€', '34,94', 34.94), - Example(None, 'Ops!', - None, None, None), - Example(None, '392. 00', - None, '392. 00', 392), - Example('€', '213,62', - '€', '213,62', 213.62), - Example('3,00 €', '3,00 €', - '€', '3,00', 3), - Example('£0.00', '£0.00', - '£', '0.00', 0.00), - Example('€', '10 990,00', - '€', '10 990,00', 10990), - Example(None, '€ 24,95', - '€', '24,95', 24.95), - Example(None, 'Not Available', - None, None, None), - Example(None, '$19.99', - '$', '19.99', 19.99), - Example('Р', '15 130 Р', - 'Р', '15 130', 15130), - Example('$5.95', '$5.95', - '$', '5.95', 5.95), - Example(None, '199,99 €', - '€', '199,99', 199.99), - Example('Code', '£23.40', - '£', '23.40', 23.40), - Example('$29.99', '$29.99', - '$', '29.99', 29.99), - Example(None, '795', - None, '795', 795), - Example('Sorry, this item is currently out of stock but you can still order, we will send as soon a product arrives', '34.99', - None, '34.99', 34.99), - Example('Our Price: $149.95', 'Our Price: $149.95', - '$', '149.95', 149.95), - Example('$119.95', '$119.95', - '$', '119.95', 119.95), - Example(None, '339 грн', - 'грн', '339', 339), - Example('$0.00', '$0.00', - '$', '0.00', 0.00), - Example('€', '79,00', - '€', '79,00', 79.00), - Example(None, '378.00', - None, '378.00', 378.00), - Example(None, 'Pure & IP BP Ph. Eur. USP ACS AR LR', - None, None, None), - Example(None, '$356.03', - '$', '356.03', 356.03), - Example('naše cena', 'běžná cena 890 Kč', - 'Kč', '890', 890), - Example(None, '$49.99', - '$', '49.99', 49.99), - Example(None, '5 550 Kč', - 'Kč', '5 550', 5550), - Example(None, '5 770 Kč', - 'Kč', '5 770', 5770), - Example(None, 'Free!', - None, '0', 0), - Example('194 ₹', '199 ₹', - '₹', '199', 199), - Example('5€', '16,50 € *', - '€', '16,50', 16.50), - Example(None, '$42.95', - '$', '42.95', 42.95), - Example(None, '1.837, 32 €', - '€', '1.837, 32', 1837.32), - Example('$', '$ 791.00 $ 479.00', - '$', '791.00', 791.00), - Example(None, '$69.30', - '$', '69.30', 69.30), - Example(None, '$163,900', - '$', '163,900', 163900), - Example(None, '36.95', - None, '36.95', 36.95), - Example('Rp 235.000', 'Rp 235.000', - 'Rp', '235.000', 235000), - Example('£', '11,13 €', - '€', '11,13', 11.13), - Example(None, '160,00 lei', - 'lei', '160,00', 160), - Example('3 300 руб', '3 300 руб', - 'руб', '3 300', 3300), - Example('Р', '4 690 Р', - 'Р', '4 690', 4690), - Example('189,00 € *', '189,00 € *', - '€', '189,00', 189), - Example('€', None, - '€', None, None), - Example('$ 30.00', '$ 30.00', - '$', '30.00', 30.00), - Example('$', '$ 5.95', - '$', '5.95', 5.95), - Example('£62.90', '£74.00', - '£', '74.00', 74.00), - Example(None, '158,24 €', - '€', '158,24', 158.24), - Example(None, '550,00 лв', - 'лв', '550,00', 550), - Example('7,25 € *', '7,25 € *', - '€', '7,25', 7.25), - Example(None, '94,000 تومان', - 'تومان', '94,000', 94000), - Example(None, '$8.27', - '$', '8.27', 8.27), - Example('Đã có VAT', '12.500 ₫', - '₫', '12.500', 12500), - Example(None, '27.50', - None, '27.50', 27.50), - Example('23.90', '23.90', - None, '23.90', 23.90), - Example('Р', '18 000 Р', - 'Р', '18 000', 18000), - Example(None, '48,96 €', - '€', '48,96', 48.96), - Example('DKK', '199 DKK', - 'DKK', '199', 199), - Example('Price: £6.95 - £9.95', '£6.95 - £9.95', - '£', '6.95', 6.95), - Example(None, '599.97', - None, '599.97', 599.97), - Example(None, '$40.00', - '$', '40.00', 40.00), - Example('Cena 300,00 Kč', '100,00 Kč', - 'Kč', '100,00', 100), - Example('18,25 €', '18,25 €', - '€', '18,25', 18.25), - Example(None, '29,00 €', - '€', '29,00', 29), - Example('€', '€ 39,95', - '€', '39,95', 39.95), - Example(None, '32.00', - None, '32.00', 32.00), - Example(None, '32.99', - None, '32.99', 32.99), - Example('HUF', '39000', - 'HUF', '39000', 39000), - Example(None, '850,000 ریال', - 'ریال', '850,000', 850000), - Example(None, '24,00 €', - '€', '24,00', 24.00), - Example('Versand', 'CHF 19.90', - 'CHF', '19.90', 19.90), - Example('', '530,42 Zł', - 'Zł', '530,42', 530.42), - Example(None, 'Was: $124.95 Now: $0.00', - '$', '124.95', 124.95), - Example(None, 'Our Price 344.99 - 444.99', - None, '344.99', 344.99), - Example(None, '3089.9 *', - None, '3089.9', 3089.9), - Example(None, '40.00/each', - None, '40.00', 40.00), - Example(None, '105. –', - None, '105.', 105.0), - Example(None, '1.899,-', - None, '1.899', 1899.0), - Example(None, 'Sheet Set', - None, None, None), - Example(None, '36. 24', - None, '36. 24', 36.24), - Example(None, '32جن', # جن is not a currency - None, '32', 32.0), - Example(None, 'Price 29', - None, '29', 29.0), - Example(None, '559. 99 undefined 559.99 inkl. MwSt. zzgl. Versand', - None, '559. 99', 559.99), - Example(None, '$36 /', - '$', '36', 36.0), - Example(None, '1.800.000₫', # Vietnamese dong (VND) - '₫', '1.800.000', 1800000.0), - Example(None, '0,40 LEI', # Romanian Leu (RON) - 'LEI', '0,40', 0.4), - Example(None, 'R$ 1.500,00', - 'R$', '1.500,00', 1500.0), - Example(None, '$ 8. 94', - '$', '8. 94', 8.94), - Example(None, '$30.56/Month', - '$', '30.56', 30.56), - Example(None, 'from $742.50', - '$', '742.50', 742.5), - Example(None, '25,00 € *', - '€', '25,00', 25.0), - Example(None, '$3,690.00 (ea)', - '$', '3,690.00', 3690.0), - Example(None, 'AED 26.30', - 'AED', '26.30', 26.3), - Example(None, '15,000 руб.', - 'руб.', '15,000', 15000.0), - Example(None, '$5,246.58', - '$', '5,246.58', 5246.58), - Example(None, '118, 99 TL', - 'TL', '118, 99', 118.99), - Example(None, '$575.00*', - '$', '575.00', 575.0), - Example(None, '150 kr', - 'kr', '150', 150.0), - Example(None, 'Estimate Price: $45,000 - $70,000', - '$', '45,000', 45000.0), - Example(None, 'Your Price: $7.99', - '$', '7.99', 7.99), - Example(None, '$80.00 U.S.', - '$', '80.00', 80.0), - Example(None, '253,89 lei', - 'lei', '253,89', 253.89), - Example(None, '$1,190.00 AUD', - 'AUD', '1,190.00', 1190.0), - Example(None, '€6.56 + VAT', - '€', '6.56', 6.56), - Example(None, '4,35 € TTC', - '€', '4,35', 4.35), - Example(None, '1.890,00 DKK', - 'DKK', '1.890,00', 1890.0), - Example(None, '₹397.00', - '₹', '397.00', 397.0), - Example(None, '- $44.99', - '$', '44.99', 44.99), - Example(None, 'AU$ 1,175', - 'AU$', '1,175', 1175.0), - Example(None, '130, 38 zł', - 'zł', '130, 38', 130.38), - Example(None, 'C$1.23', - 'C$', '1.23', 1.23), - Example(None, 'CA$1.23', - 'CA$', '1.23', 1.23), - Example(None, '1 ؋', - '؋', '1', 1.0), - Example(None, '1 Lek', - 'Lek', '1', 1.0), - Example(None, '1 ֏', - '֏', '1', 1.0), - Example(None, '1 ƒ', - 'ƒ', '1', 1.0), - Example(None, '1 ₼', - '₼', '1', 1.0), - Example(None, '1 ৳', - '৳', '1', 1.0), - Example(None, '1 Br', - 'Br', '1', 1.0), - Example(None, '1 BZ$', - 'BZ$', '1', 1.0), - Example(None, '1 Nu.', - 'Nu.', '1', 1.0), - Example(None, '1 KM', - 'KM', '1', 1.0), - Example(None, '1 R$', - 'R$', '1', 1.0), - Example(None, '1 лв', - 'лв', '1', 1.0), - Example(None, '1 FBu', - 'FBu', '1', 1.0), - Example(None, '1 BD', # Bahraini Dinar - 'BD', '1', 1.0), - Example(None, '1 ៛', - '៛', '1', 1.0), - Example(None, '1 CFA', - 'CFA', '1', 1.0), - Example(None, '1 FCFA', - 'FCFA', '1', 1.0), - Example(None, '1 KMF', - 'KMF', '1', 1.0), - Example(None, '1 ₣', - '₣', '1', 1.0), - Example(None, '1 ₡', - '₡', '1', 1.0), - Example(None, '1 kn', - 'kn', '1', 1.0), - Example(None, '1 CUC$', - 'CUC$', '1', 1.0), - Example(None, '1 ₱', - '₱', '1', 1.0), - Example(None, '1 Kč', - 'Kč', '1', 1.0), - Example(None, '1 Fdj', - 'Fdj', '1', 1.0), - Example(None, '1 RD$', - 'RD$', '1', 1.0), - Example(None, '1 Nfk', - 'Nfk', '1', 1.0), - Example(None, '1 GH₵', # Ghanaian cedi - 'GH₵', '1', 1.0), - Example(None, '1 Ft', - 'Ft', '1', 1.0), - Example(None, '1 Rp', - 'Rp', '1', 1.0), - Example(None, '1 ﷼', # Saudi riyal - '﷼', '1', 1.0), - Example(None, '1 ₪', - '₪', '1', 1.0), - Example(None, '1 J$', - 'J$', '1', 1.0), - Example(None, '1 KD', # Kuwaiti dinar - 'KD', '1', 1.0), - Example(None, '1 ₭', # Lao kip - '₭', '1', 1.0), - Example(None, '1 LD', - 'LD', '1', 1.0), - Example(None, '1 MOP$', - 'MOP$', '1', 1.0), - Example(None, '1 MK', - 'MK', '1', 1.0), - Example(None, '1 RM', - 'RM', '1', 1.0), - Example(None, '1 Rf', - 'Rf', '1', 1.0), - Example(None, '1 UM', - 'UM', '1', 1.0), - Example(None, '1 ₨', - '₨', '1', 1.0), - Example(None, '1 ₮', - '₮', '1', 1.0), - Example(None, '1 ƒ', - 'ƒ', '1', 1.0), - Example(None, '1 C$', - 'C$', '1', 1.0), - Example(None, '1 ₦', - '₦', '1', 1.0), - Example(None, '1 B/.', - 'B/.', '1', 1.0), - Example(None, '1 S/.', - 'S/.', '1', 1.0), - Example(None, '1 ₽', - '₽', '1', 1.0), - Example(None, '1 Db', - 'Db', '1', 1.0), - Example(None, '1 NT$', - 'NT$', '1', 1.0), - Example(None, '1 ЅM', # It's not a currency - None, '1', 1.0), - Example(None, '1 TSh', - 'TSh', '1', 1.0), - Example(None, '1 T$', - 'T$', '1', 1.0), - Example(None, '1 TT$', - 'TT$', '1', 1.0), - Example(None, '1 DT', - 'DT', '1', 1.0), - Example(None, '1 ₺', - '₺', '1', 1.0), - Example(None, '1 USh', - 'USh', '1', 1.0), - Example(None, '1 ₴', - '₴', '1', 1.0), - Example(None, '1 $U', - '$U', '1', 1.0), - Example(None, '1 VT', - 'VT', '1', 1.0), - Example(None, '1 Bs', - 'Bs', '1', 1.0), - Example(None, '1 ZK', - 'ZK', '1', 1.0), - Example(None, '1 Z$', - 'Z$', '1', 1.0), - Example(None, '1 ₿', - '₿', '1', 1.0), - Example(None, '1 Br', # Ethiopian birr, Belarusian ruble - 'Br', '1', 1.0), - Example(None, '1 美股', # not a currency - None, '1', 1.0), - Example(None, '1 GEL', # Georgian lari - 'GEL', '1', 1.0), - Example(None, '1 FG', # Guinean franc - 'FG', '1', 1.0), - Example(None, '14.00 SGD / Each', # Singapore Dollar - 'SGD', '14.00', 14.0), + Example("R$", "R$ 139,99 R$ 135,99", "R$", "139,99", 139.99), + Example("£", "£ 34.99", "£", "34.99", 34.99), + Example("Price", "$7.65", "$", "7.65", 7.65), + Example("€", "75,00", "€", "75,00", 75), + Example(None, "34,90 €", "€", "34,90", 34.90), + Example(None, "629.95", None, "629.95", 629.95), + Example("11000 руб.", "47700 руб.", "руб.", "47700", 47700), + Example("$29.99 – $74.99", "$29.99", "$", "29.99", 29.99), + Example(None, "174,00 €", "€", "174,00", 174), + Example(None, "18,00 €", "€", "18,00", 18), + Example("Price:", "$19.50", "$", "19.50", 19.50), + Example("8 390 руб.", "8 390 руб.", "руб.", "8 390", 8390), + Example(None, "55,00 €", "€", "55,00", 55), + Example("€333.00", "€299.71", "€", "299.71", 299.71), + Example(None, "384,00 €", "€", "384,00", 384), + Example("From:", "From: $14.97", "$", "14.97", 14.97), + Example(None, "0,00 €", "€", "0,00", 0), + Example(None, "€ 280,00", "€", "280,00", 280), + Example(None, "11 450 Kč", "Kč", "11 450", 11450), + Example("Price $118.15", "$118.15", "$", "118.15", 118.15), + Example("€", "49.99", "€", "49.99", 49.99), + Example("1,15 €", "1,15 €", "€", "1,15", 1.15), + Example("17,99 €", "31,93 €", "€", "31,93", 31.93), + Example(None, "र24,401", "र", "24,401", 24401), + Example(None, "$60.00", "$", "60.00", 60), + Example("12,15 €", "12,15 €", "€", "12,15", 12.15), + Example("£ 163.95", "163.95", "£", "163.95", 163.95), + Example(None, "30,00 €", "€", "30,00", 30), + Example("zł", "165,00 zł", "zł", "165,00", 165), + Example("469.00zł Bez podatku: 381.30zł", "469.00zł", "zł", "469.00", 469), + Example(None, "72.95", None, "72.95", 72.95), + Example("Costo: $2,222.- Más IVA", "MX$3,179.00", "MX$", "3,179.00", 3179), + Example(None, "naše cena 4 370 Kč", "Kč", "4 370", 4370), + Example("€", "21,33 €", "€", "21,33", 21.33), + Example(None, "49.95", None, "49.95", 49.95), + Example(None, "Před slevou 59 900 Kč", "Kč", "59 900", 59900), + Example("ab", "6,78 € *", "€", "6,78", 6.78), + Example(None, "442", None, "442", 442), + Example("18.10 €", "16.00 €", "€", "16.00", 16.00), + Example(None, "0.00", None, "0.00", 0.00), + Example(None, "379,00 € *", "€", "379,00", 379.00), + Example(None, "125.00", None, "125.00", 125.00), + Example(None, "£ 30.84", "£", "30.84", 30.84), + Example(None, "259,00 €", "€", "259,00", 259), + Example("à partir de 1540 € / pers", "1540 €", "€", "1540", 1540), + Example(None, "95 €", "€", "95", 95), + Example(None, "53.79", None, "53.79", 53.79), + Example("NT$", "NT$ 1,160", "NT$", "1,160", 1160), + Example("ACTIVE", "$69,900", "$", "69,900", 69900), + Example(None, "$14.95", "$", "14.95", 14.95), + Example("₹", "₹ 4649", "₹", "4649", 4649), + Example("25 грн", "25 грн", "грн", "25", 25), + Example("€", "16,40", "€", "16,40", 16.40), + Example("PLN", "0,46", "PLN", "0,46", 0.46), + Example("£", "£ 261.25", "£", "261.25", 261.25), + Example(None, "$0.00", "$", "0.00", 0), + Example(None, "24.95", None, "24.95", 24.95), + Example("грн.", "27.00", "грн.", "27.00", 27.00), + Example("New", "$189,900", "$", "189,900", 189900), + Example("NA", "$269", "$", "269", 269), + Example("$279", "$189", "$", "189", 189), + Example(None, "160,00 zł", "zł", "160,00", 160), + Example("2 069 рублей", "2 400", "руб", "2 400", 2400), + Example("Sale Price: $4.59", "$4.59", "$", "4.59", 4.59), + Example("Купить", "542 руб.", "руб.", "542", 542), + Example(None, "$19.99", "$", "19.99", 19.99), + Example("Price", "$6.45", "$", "6.45", 6.45), + Example(None, "32.99", None, "32.99", 32.99), + Example(None, "$86.44", "$", "86.44", 86.44), + Example(None, "25.00€", "€", "25.00", 25.00), + Example(None, "99,00 €", "€", "99,00", 99.00), + Example(None, "103.90", None, "103.90", 103.90), + Example("14,00 € *", "25,00 € *", "€", "25,00", 25.00), + Example(None, "$6.49", "$", "6.49", 6.49), + Example("€ 59,95", "€ 59,95", "€", "59,95", 59.95), + Example(None, "Běžná cena 75 990,00 Kč", "Kč", "75 990,00", 75990), + Example("Price", "Rp 1.550.000", "Rp", "1.550.000", 1550000), + Example("грн.", "1 430", "грн.", "1 430", 1430), + Example("руб. (шт)", "1 690,54 руб. (шт)", "руб.", "1 690,54", 1690.54), + Example("69 TL 41.90 TL", "69 TL 41.90 TL", "TL", "69", 69), + Example("ALIDAD", "960,00 €", "€", "960,00", 960), + Example(None, "184,35 lei", "lei", "184,35", 184.35), + Example(None, "1 505 Kč", "Kč", "1 505", 1505), + Example(None, "23,00 € *", "€", "23,00", 23), + Example(None, "25.97", None, "25.97", 25.97), + Example(None, "58,19 €", "€", "58,19", 58.19), + Example(None, "27.00 лв.", "лв.", "27.00", 27.00), + Example("48,00 €", "3,85 €", "€", "3,85", 3.85), + Example(None, "10,90 €", "€", "10,90", 10.90), + Example("$ 879.0", "$ 879.0", "$", "879.0", 879.0), + Example("EUR", "25.88", "EUR", "25.88", 25.88), + Example(None, "R$215,10", "R$", "215,10", 215.10), + Example("£", "£ 12.50", "£", "12.50", 12.50), + Example(None, "3 173,00 €", "€", "3 173,00", 3173), + Example(None, "34,94 € *", "€", "34,94", 34.94), + Example(None, "Ops!", None, None, None), + Example(None, "392. 00", None, "392. 00", 392), + Example("€", "213,62", "€", "213,62", 213.62), + Example("3,00 €", "3,00 €", "€", "3,00", 3), + Example("£0.00", "£0.00", "£", "0.00", 0.00), + Example("€", "10 990,00", "€", "10 990,00", 10990), + Example(None, "€ 24,95", "€", "24,95", 24.95), + Example(None, "Not Available", None, None, None), + Example(None, "$19.99", "$", "19.99", 19.99), + Example("Р", "15 130 Р", "Р", "15 130", 15130), + Example("$5.95", "$5.95", "$", "5.95", 5.95), + Example(None, "199,99 €", "€", "199,99", 199.99), + Example("Code", "£23.40", "£", "23.40", 23.40), + Example("$29.99", "$29.99", "$", "29.99", 29.99), + Example(None, "795", None, "795", 795), + Example( + ( + "Sorry, this item is currently out of stock but you can still" + " order, we will send as soon a product arrives" + ), + "34.99", + None, + "34.99", + 34.99, + ), + Example("Our Price: $149.95", "Our Price: $149.95", "$", "149.95", 149.95), + Example("$119.95", "$119.95", "$", "119.95", 119.95), + Example(None, "339 грн", "грн", "339", 339), + Example("$0.00", "$0.00", "$", "0.00", 0.00), + Example("€", "79,00", "€", "79,00", 79.00), + Example(None, "378.00", None, "378.00", 378.00), + Example(None, "Pure & IP BP Ph. Eur. USP ACS AR LR", None, None, None), + Example(None, "$356.03", "$", "356.03", 356.03), + Example("naše cena", "běžná cena 890 Kč", "Kč", "890", 890), + Example(None, "$49.99", "$", "49.99", 49.99), + Example(None, "5 550 Kč", "Kč", "5 550", 5550), + Example(None, "5 770 Kč", "Kč", "5 770", 5770), + Example(None, "Free!", None, "0", 0), + Example("194 ₹", "199 ₹", "₹", "199", 199), + Example("5€", "16,50 € *", "€", "16,50", 16.50), + Example(None, "$42.95", "$", "42.95", 42.95), + Example(None, "1.837, 32 €", "€", "1.837, 32", 1837.32), + Example("$", "$ 791.00 $ 479.00", "$", "791.00", 791.00), + Example(None, "$69.30", "$", "69.30", 69.30), + Example(None, "$163,900", "$", "163,900", 163900), + Example(None, "36.95", None, "36.95", 36.95), + Example("Rp 235.000", "Rp 235.000", "Rp", "235.000", 235000), + Example("£", "11,13 €", "€", "11,13", 11.13), + Example(None, "160,00 lei", "lei", "160,00", 160), + Example("3 300 руб", "3 300 руб", "руб", "3 300", 3300), + Example("Р", "4 690 Р", "Р", "4 690", 4690), + Example("189,00 € *", "189,00 € *", "€", "189,00", 189), + Example("€", None, "€", None, None), + Example("$ 30.00", "$ 30.00", "$", "30.00", 30.00), + Example("$", "$ 5.95", "$", "5.95", 5.95), + Example("£62.90", "£74.00", "£", "74.00", 74.00), + Example(None, "158,24 €", "€", "158,24", 158.24), + Example(None, "550,00 лв", "лв", "550,00", 550), + Example("7,25 € *", "7,25 € *", "€", "7,25", 7.25), + Example(None, "94,000 تومان", "تومان", "94,000", 94000), + Example(None, "$8.27", "$", "8.27", 8.27), + Example("Đã có VAT", "12.500 ₫", "₫", "12.500", 12500), + Example(None, "27.50", None, "27.50", 27.50), + Example("23.90", "23.90", None, "23.90", 23.90), + Example("Р", "18 000 Р", "Р", "18 000", 18000), + Example(None, "48,96 €", "€", "48,96", 48.96), + Example("DKK", "199 DKK", "DKK", "199", 199), + Example("Price: £6.95 - £9.95", "£6.95 - £9.95", "£", "6.95", 6.95), + Example(None, "599.97", None, "599.97", 599.97), + Example(None, "$40.00", "$", "40.00", 40.00), + Example("Cena 300,00 Kč", "100,00 Kč", "Kč", "100,00", 100), + Example("18,25 €", "18,25 €", "€", "18,25", 18.25), + Example(None, "29,00 €", "€", "29,00", 29), + Example("€", "€ 39,95", "€", "39,95", 39.95), + Example(None, "32.00", None, "32.00", 32.00), + Example(None, "32.99", None, "32.99", 32.99), + Example("HUF", "39000", "HUF", "39000", 39000), + Example(None, "850,000 ریال", "ریال", "850,000", 850000), + Example(None, "24,00 €", "€", "24,00", 24.00), + Example("Versand", "CHF 19.90", "CHF", "19.90", 19.90), + Example("", "530,42 Zł", "Zł", "530,42", 530.42), + Example(None, "Was: $124.95 Now: $0.00", "$", "124.95", 124.95), + Example(None, "Our Price 344.99 - 444.99", None, "344.99", 344.99), + Example(None, "3089.9 *", None, "3089.9", 3089.9), + Example(None, "40.00/each", None, "40.00", 40.00), + Example(None, "105. –", None, "105.", 105.0), + Example(None, "1.899,-", None, "1.899", 1899.0), + Example(None, "Sheet Set", None, None, None), + Example(None, "36. 24", None, "36. 24", 36.24), + Example(None, "32جن", None, "32", 32.0), # جن is not a currency + Example(None, "Price 29", None, "29", 29.0), + Example( + None, + "559. 99 undefined 559.99 inkl. MwSt. zzgl. Versand", + None, + "559. 99", + 559.99, + ), + Example(None, "$36 /", "$", "36", 36.0), + Example(None, "1.800.000₫", "₫", "1.800.000", 1800000.0), # Vietnamese dong (VND) + Example(None, "0,40 LEI", "LEI", "0,40", 0.4), # Romanian Leu (RON) + Example(None, "R$ 1.500,00", "R$", "1.500,00", 1500.0), + Example(None, "$ 8. 94", "$", "8. 94", 8.94), + Example(None, "$30.56/Month", "$", "30.56", 30.56), + Example(None, "from $742.50", "$", "742.50", 742.5), + Example(None, "25,00 € *", "€", "25,00", 25.0), + Example(None, "$3,690.00 (ea)", "$", "3,690.00", 3690.0), + Example(None, "AED 26.30", "AED", "26.30", 26.3), + Example(None, "15,000 руб.", "руб.", "15,000", 15000.0), + Example(None, "$5,246.58", "$", "5,246.58", 5246.58), + Example(None, "118, 99 TL", "TL", "118, 99", 118.99), + Example(None, "$575.00*", "$", "575.00", 575.0), + Example(None, "150 kr", "kr", "150", 150.0), + Example(None, "Estimate Price: $45,000 - $70,000", "$", "45,000", 45000.0), + Example(None, "Your Price: $7.99", "$", "7.99", 7.99), + Example(None, "$80.00 U.S.", "$", "80.00", 80.0), + Example(None, "253,89 lei", "lei", "253,89", 253.89), + Example(None, "$1,190.00 AUD", "AUD", "1,190.00", 1190.0), + Example(None, "€6.56 + VAT", "€", "6.56", 6.56), + Example(None, "4,35 € TTC", "€", "4,35", 4.35), + Example(None, "1.890,00 DKK", "DKK", "1.890,00", 1890.0), + Example(None, "₹397.00", "₹", "397.00", 397.0), + Example(None, "- $44.99", "$", "44.99", 44.99), + Example(None, "AU$ 1,175", "AU$", "1,175", 1175.0), + Example(None, "130, 38 zł", "zł", "130, 38", 130.38), + Example(None, "C$1.23", "C$", "1.23", 1.23), + Example(None, "CA$1.23", "CA$", "1.23", 1.23), + Example(None, "1 ؋", "؋", "1", 1.0), + Example(None, "1 Lek", "Lek", "1", 1.0), + Example(None, "1 ֏", "֏", "1", 1.0), + Example(None, "1 ƒ", "ƒ", "1", 1.0), + Example(None, "1 ₼", "₼", "1", 1.0), + Example(None, "1 ৳", "৳", "1", 1.0), + Example(None, "1 Br", "Br", "1", 1.0), + Example(None, "1 BZ$", "BZ$", "1", 1.0), + Example(None, "1 Nu.", "Nu.", "1", 1.0), + Example(None, "1 KM", "KM", "1", 1.0), + Example(None, "1 R$", "R$", "1", 1.0), + Example(None, "1 лв", "лв", "1", 1.0), + Example(None, "1 FBu", "FBu", "1", 1.0), + Example(None, "1 BD", "BD", "1", 1.0), # Bahraini Dinar + Example(None, "1 ៛", "៛", "1", 1.0), + Example(None, "1 CFA", "CFA", "1", 1.0), + Example(None, "1 FCFA", "FCFA", "1", 1.0), + Example(None, "1 KMF", "KMF", "1", 1.0), + Example(None, "1 ₣", "₣", "1", 1.0), + Example(None, "1 ₡", "₡", "1", 1.0), + Example(None, "1 kn", "kn", "1", 1.0), + Example(None, "1 CUC$", "CUC$", "1", 1.0), + Example(None, "1 ₱", "₱", "1", 1.0), + Example(None, "1 Kč", "Kč", "1", 1.0), + Example(None, "1 Fdj", "Fdj", "1", 1.0), + Example(None, "1 RD$", "RD$", "1", 1.0), + Example(None, "1 Nfk", "Nfk", "1", 1.0), + Example(None, "1 GH₵", "GH₵", "1", 1.0), # Ghanaian cedi + Example(None, "1 Ft", "Ft", "1", 1.0), + Example(None, "1 Rp", "Rp", "1", 1.0), + Example(None, "1 ﷼", "﷼", "1", 1.0), # Saudi riyal + Example(None, "1 ₪", "₪", "1", 1.0), + Example(None, "1 J$", "J$", "1", 1.0), + Example(None, "1 KD", "KD", "1", 1.0), # Kuwaiti dinar + Example(None, "1 ₭", "₭", "1", 1.0), # Lao kip + Example(None, "1 LD", "LD", "1", 1.0), + Example(None, "1 MOP$", "MOP$", "1", 1.0), + Example(None, "1 MK", "MK", "1", 1.0), + Example(None, "1 RM", "RM", "1", 1.0), + Example(None, "1 Rf", "Rf", "1", 1.0), + Example(None, "1 UM", "UM", "1", 1.0), + Example(None, "1 ₨", "₨", "1", 1.0), + Example(None, "1 ₮", "₮", "1", 1.0), + Example(None, "1 ƒ", "ƒ", "1", 1.0), + Example(None, "1 C$", "C$", "1", 1.0), + Example(None, "1 ₦", "₦", "1", 1.0), + Example(None, "1 B/.", "B/.", "1", 1.0), + Example(None, "1 S/.", "S/.", "1", 1.0), + Example(None, "1 ₽", "₽", "1", 1.0), + Example(None, "1 Db", "Db", "1", 1.0), + Example(None, "1 NT$", "NT$", "1", 1.0), + Example(None, "1 ЅM", None, "1", 1.0), # It's not a currency + Example(None, "1 TSh", "TSh", "1", 1.0), + Example(None, "1 T$", "T$", "1", 1.0), + Example(None, "1 TT$", "TT$", "1", 1.0), + Example(None, "1 DT", "DT", "1", 1.0), + Example(None, "1 ₺", "₺", "1", 1.0), + Example(None, "1 USh", "USh", "1", 1.0), + Example(None, "1 ₴", "₴", "1", 1.0), + Example(None, "1 $U", "$U", "1", 1.0), + Example(None, "1 VT", "VT", "1", 1.0), + Example(None, "1 Bs", "Bs", "1", 1.0), + Example(None, "1 ZK", "ZK", "1", 1.0), + Example(None, "1 Z$", "Z$", "1", 1.0), + Example(None, "1 ₿", "₿", "1", 1.0), + Example(None, "1 Br", "Br", "1", 1.0), # Ethiopian birr, Belarusian ruble + Example(None, "1 美股", None, "1", 1.0), # not a currency + Example(None, "1 GEL", "GEL", "1", 1.0), # Georgian lari + Example(None, "1 FG", "FG", "1", 1.0), # Guinean franc + Example(None, "14.00 SGD / Each", "SGD", "14.00", 14.0), # Singapore Dollar ] PRICE_PARSING_EXAMPLES_XFAIL = [ # amount is picked as a price - Example('3 Ausgaben für nur 14,85 EUR', '3 Ausgaben für nur 14,85 EUR', - 'EUR', '14,85', 14.85), - Example(None, 'Buy Now - 2 Litre Was $120.00 Now $60.00', - '$', '60.00', 60), - Example('Цена: уточняйте (мин. заказ: 1 )', 'Цена: уточняйте (мин. заказ: 1 )', - None, None, None), - Example(None, '50 - $2.00 100 - $2.75 400 - $4.50 1,000 - $9.00 2,000 - $17.00 3,000 - $24.00 10,000 - $75.00', - '$', '2.00', 2), - + Example( + "3 Ausgaben für nur 14,85 EUR", + "3 Ausgaben für nur 14,85 EUR", + "EUR", + "14,85", + 14.85, + ), + Example(None, "Buy Now - 2 Litre Was $120.00 Now $60.00", "$", "60.00", 60), + Example( + "Цена: уточняйте (мин. заказ: 1 )", + "Цена: уточняйте (мин. заказ: 1 )", + None, + None, + None, + ), + Example( + None, + "50 - $2.00 100 - $2.75 400 - $4.50 1,000 - $9.00 " + "2,000 - $17.00 3,000 - $24.00 10,000 - $75.00", + "$", + "2.00", + 2, + ), # no detection of such single-letter currencies - Example('R273.00', 'R273.00', - 'R', '273.00', 273), - Example('R8,499', 'R8,499', - 'R', '8,499', 8499), - Example('Cuneo', '61.858 L', # Romanian New Leu - 'L', '61.858', 61858), - + Example("R273.00", "R273.00", "R", "273.00", 273), + Example("R8,499", "R8,499", "R", "8,499", 8499), + Example("Cuneo", "61.858 L", "L", "61.858", 61858), # Romanian New Leu # "р" / "руб" is detected as currency - Example('>', 'См. цену в прайсе', - None, None, None), - Example('Купить', 'Печная труба', - None, None, None), - Example(None, 'Код товара: 884', - None, '884', 884.0), - + Example(">", "См. цену в прайсе", None, None, None), + Example("Купить", "Печная труба", None, None, None), + Example(None, "Код товара: 884", None, "884", 884.0), # dates - Example(None, 'July, 2004', - None, None, None), - - Example(None, '15.08.2017', - None, None, None), - + Example(None, "July, 2004", None, None, None), + Example(None, "15.08.2017", None, None, None), # other incorrectly extracted prices - Example('8.5', '25-09', - None, None, None), - + Example("8.5", "25-09", None, None, None), # misc - Example('of', '16.00 ft', - None, None, None), + Example("of", "16.00 ft", None, None, None), # Example('7 724 134.40 114.32', '7 724 134.40 114.32', # '', ''), # Example('中古価格(税込): ¥20,800', '132', # '¥', '132', 132), - Example('Free Shipping on Orders $49+.', 'Free Shipping on Orders $49+.', - '$', None, None), + Example( + "Free Shipping on Orders $49+.", + "Free Shipping on Orders $49+.", + "$", + None, + None, + ), ] # Valid currencies not detected by price-parser # Move to regular tests when added PRICE_PARSING_EXAMPLES_XFAIL_CURRENCIES_TO_BE_ADDED = [ - Example(None, '22000.00元/台', # 元 is yuan - '元', '22000.00', 22000.00), - Example(None, '2963yen', - 'yen', '2963', 2963), - Example(None, '1 บาท', # Thai baht - 'บาท', '1', 1.0), - Example(None, '1 ر.س', # Saudi riyal - 'ر.س', '1', 1.0), - Example(None, '1.198,- Kr', - 'Kr', '1.198', 1198.0), - Example(None, '45 جنيه', # Egyptian Pound (EGP) - 'جنيه', '45', 45.0), - Example(None, '45 ج.م', # Egyptian Pound (EGP) - 'ج.م', '45', 45.0), - Example(None, '45 E£', # Egyptian Pound (EGP) - 'E£', '45', 45.0), - Example(None, '2000 zl', # Polish zloty (PLN) - 'zl', '2000', 2000.0), - Example(None, 'CAN$1.23', - 'CAN$', '1.23', 1.23), - Example(None, '200q', # Guatemalan Quetzal - 'q', '200', 200.0), - Example(None, '200Q', # Guatemalan Quetzal - 'Q', '200', 200.0), - Example(None, '1 دج', # Algerian Dinar - 'دج', '1', 1.0), - Example(None, '1 .د.ب', # Bahraini Dinar - '.د.ب', '1', 1.0), - Example(None, '1 $b', # Barbadian dollar - '$b', '1', 1.0), - Example(None, '1 P', # Pound sterling, Botswana pula - 'P', '1', 1.0), - Example(None, '1 franc', - 'franc', '1', 1.0), - Example(None, '2 francs', - 'francs', '2', 2.0), - Example(None, '1 ናቕፋ', # Eritrean Nakfa - 'ናቕፋ', '1', 1.0), - Example(None, '1 نافكا', # Arabic "نافكا" stands for "Navka", which can refer to Eritrean Nakfa - 'نافكا', '1', 1.0), - Example(None, '1 E', # Can refer to Egyptian pound - 'E', '1', 1.0), - Example(None, '1 ብር', # Ethiopian birr - 'ብር', '1', 1.0), - Example(None, '1 D', # Gambian dalasi - 'D', '1', 1.0), - Example(None, '1 ლ', # Georgian lari - 'ლ', '1', 1.0), - Example(None, '1 ¢', # Ghanaian cedi, cents - '¢', '1', 1.0), - Example(None, '1 ₵', # Ghanaian cedi - '₵', '1', 1.0), - Example(None, '1 GFr', # Guinean franc - 'GFr', '1', 1.0), - Example(None, '1 L', - 'L', '1', 1.0), - Example(None, '1 ع.د', # Iraqi dinar - 'ع.د', '1', 1.0), - Example(None, '1 د.', # Arabic "د." stands for dr. which can refer to "dinar" and "dirham": United Arab Emirates dirham (AED), Bahraini dinar (BHD), Algerian dinar (DZD), etc. - 'د.', '1', 1.0), - Example(None, '1 KSh', # Kenyan shilling - 'KSh', '1', 1.0), - Example(None, '1 د.ك', # Kuwaiti dinar - 'د.ك', '1', 1.0), - Example(None, '1 ل.د', # Libyan dinar - 'ل.د', '1', 1.0), - Example(None, '1 ден', # Macedonian denar - 'ден', '1', 1.0), - Example(None, '1 ДЕН', # Macedonian denar - 'ДЕН', '1', 1.0), - Example(None, '1 Ar', # Malagasy ariary - 'Ar', '1', 1.0), - Example(None, '1 د.إ', # United Arab Emirates dirham - 'د.إ', '1', 1.0), - Example(None, '1 MT', # Mozambican metical - 'MT', '1', 1.0), - Example(None, '1 K', # Papua New Guinean kina - 'K', '1', 1.0), - Example(None, '1 FRw', # Rwandan Franc - 'FRw', '1', 1.0), - Example(None, '1 RF', # Rwandan Franc - 'RF', '1', 1.0), - Example(None, '1 R₣', # Rwandan Franc - 'R₣', '1', 1.0), - Example(None, '1 Дин', - 'Дин', '1', 1.0), - Example(None, '1 SPL', # Seborgan Luigino (SPL) - 'SPL', '1', 1.0), - Example(None, '1 ج.س.', # Sudanese pound - 'ج.س.', '1', 1.0), - Example(None, '1 د.ت', # Tunisian dinar - 'د.ت', '1', 1.0), - Example(None, 'AU $59.95', - 'AU $', '59.95', 59.95), - Example(None, 'US $1.23', - 'US $', '1.23', 1.23), - Example(None, 'CAD$1.23', - 'CAD$', '1.23', 1.23), - Example(None, '1 G$', # Guyanese dollar - 'G$', '1', 1.0), - Example(None, '1 GY$', # Guyanese dollar - 'GY$', '1', 1.0), - Example(None, '1 BTC', # Bitcoin - 'BTC', '1', 1.0), - Example(None, '1 CHf', # Swiss franc - 'CHf', '1', 1.0), - Example(None, '1 Dh', # United Arab Emirates dirham - 'Dh', '1', 1.0), - Example(None, '1 Dhs', # United Arab Emirates dirham - 'Dhs', '1', 1.0), - Example(None, '1 Esc', # Cape Verdean escudo - 'Esc', '1', 1.0), - Example(None, '1 Fbu', # Burundian franc - 'Fbu', '1', 1.0), - Example(None, '1 ID', # Iraqi dinar - 'ID', '1', 1.0), - Example(None, '1 Ks', # Burmese kyat - 'Ks', '1', 1.0), - Example(None, '1 NT', # New Taiwan dollar - 'NT', '1', 1.0), - Example(None, '1 Nu', # Bhutanese ngultrum - 'Nu', '1', 1.0), - Example(None, '1 Rbl', # Belarusian ruble, Russian ruble - 'Rbl', '1', 1.0), - Example(None, '1 Re', # Indian rupee, Sri Lankan rupee - 'Re', '1', 1.0), - Example(None, '1 S/', # Peruvian sol - 'S/', '1', 1.0), - Example(None, '1 SFr', # Swiss franc - 'SFr', '1', 1.0), - Example(None, '1 Sl', # Somaliland shilling - 'Sl', '1', 1.0), - Example(None, '1 VNĐ', # Vietnamese đồng - 'VNĐ', '1', 1.0), - Example(None, '1 Vt', # Vanuatu vatu - 'Vt', '1', 1.0), - Example(None, '1 din', # Serbian dinar - 'din', '1', 1.0), - Example(None, '1 hrn', # Ukrainian hryvnia - 'hrn', '1', 1.0), - Example(None, '1 kwz', # Angolan kwanza - 'kwz', '1', 1.0), - Example(None, '1 lari', # Georgian lari - 'lari', '1', 1.0), - Example(None, '1 nis', # Israeli new shekel - 'nis', '1', 1.0), - Example(None, '1 pound', # Pound sterling - 'pound', '1', 1.0), - Example(None, '1 Sʻ', # Uzbekistani soʻm - 'Sʻ', '1', 1.0), - Example(None, "1 S'", # Uzbekistani soʻm - "S'", '1', 1.0), - Example(None, "1 so'm", # Uzbekistani soʻm - "so'm", '1', 1.0), - Example(None, "1 som", # Uzbekistani soʻm - "som", '1', 1.0), - Example(None, '1 stg', # Pound sterling - 'stg', '1', 1.0), - Example(None, '1 yuan', # Renminbi/Chinese yuan - 'yuan', '1', 1.0), - Example(None, '1 Ƀ', # Bitcoin - 'Ƀ', '1', 1.0), - Example(None, '1 дин', # Serbian dinar - 'дин', '1', 1.0), - Example(None, '1 км', # Bosnia and Herzegovina convertible mark - 'км', '1', 1.0), - Example(None, '1 с', # Kyrgyz som, Tajikistani somoni - 'с', '1', 1.0), - Example(None, '1 ש״ח', # Israeli new shekel - 'ש״ח', '1', 1.0), - Example(None, '1 ج.س', # Sudanese pound - 'ج.س', '1', 1.0), - Example(None, '1 د.أ', # Jordanian dinar - 'د.أ', '1', 1.0), - Example(None, '1 د.ا', # Jordanian dinar - 'د.ا', '1', 1.0), - Example(None, '1 د.ج', # Algerian dinar - 'د.ج', '1', 1.0), - Example(None, '1 د.م', # Moroccan dirham - 'د.م', '1', 1.0), - Example(None, '1 دينار', # Bahraini dinar, Algerian dinar, Iraqi dinar, Jordanian dinar, Kuwaiti dinar, Libyan dinar, Tunisian dinar - 'دينار', '1', 1.0), - Example(None, '1 دينار أردني', # Jordanian dinar - 'دينار أردني', '1', 1.0), - Example(None, '1 دينار كويتي', # Kuwaiti dinar - 'دينار كويتي', '1', 1.0), - Example(None, '1 ر.ع', # Omani rial - 'ر.ع', '1', 1.0), - Example(None, '1 ر.ق', # Qatari riyal - 'ر.ق', '1', 1.0), - Example(None, '1 ريال', # Saudi riyal - 'ريال', '1', 1.0), - Example(None, '1 ش.ج', # Israeli new shekel - 'ش.ج', '1', 1.0), - Example(None, '1 ل.س', # Syrian pound - 'ل.س', '1', 1.0), - Example(None, '1 ل.ل', # Lebanese pound - 'ل.ل', '1', 1.0), - Example(None, '1 ரூ', # Sri Lankan rupee - 'ரூ', '1', 1.0), - Example(None, '1 රු', # Sri Lankan rupee - 'රු', '1', 1.0), - Example(None, '1 ლარი', # Georgian lari - 'ლარი', '1', 1.0), - Example(None, '1 人民币', # Renminbi/Chinese yuan - '人民币', '1', 1.0), - Example(None, '1 圆', # Renminbi/Chinese yuan - '圆', '1', 1.0), - Example(None, '1 圓', # Renminbi/Chinese yuan - '圓', '1', 1.0), - Example(None, '1 GBp', # British Pound - 'GBp', '1', 1.0), - Example(None, '1 £', # British Pound - '£', '1', 1.0), - Example(None, '1 nzd', # New Zealand dollar - 'nzd', '1', 1.0), - Example(None, '1 mkd', # Macedonian denar - 'mkd', '1', 1.0), - Example(None, 'CND', # Canadian dollar - 'CND', '1', 1.0), - Example(None, 'KShs', # Kenyan shilling - 'KShs', '1', 1.0), - Example(None, 'chf', # Swiss franc - 'chf', '1', 1.0), - Example(None, "so'm", # Uzbekistani soʻm - "so'm", '1', 1.0), - Example(None, 'тг', # Kazakhstani tenge - 'тг', '1', 1.0), - Example(None, 'ש"ח', # Israeli new shekel - 'ש"ח', '1', 1.0), - Example(None, "ש'ח", # Israeli new shekel - "ש'ח", '1', 1.0), - Example(None, 'د.ع', # Iraqi dinar - 'د.ع', '1', 1.0), - Example(None, 'د.ل', # Libyan dinar - 'د.ل', '1', 1.0), - Example(None, 'درهم', # United Arab Emirates dirham, Moroccan dirham - 'درهم', '1', 1.0), - Example(None, 'ر.ي', # Yemeni rial - 'ر.ي', '1', 1.0), - Example(None, 'ش.ص', # Somali shilling - 'ش.ص', '1', 1.0), - Example(None, '1 G', # "G" may mean Guyanese dollar, but it is too ambiguous - 'G', '1', 1.0), + Example(None, "22000.00元/台", "元", "22000.00", 22000.00), # 元 is yuan + Example(None, "2963yen", "yen", "2963", 2963), + Example(None, "1 บาท", "บาท", "1", 1.0), # Thai baht + Example(None, "1 ر.س", "ر.س", "1", 1.0), # Saudi riyal + Example(None, "1.198,- Kr", "Kr", "1.198", 1198.0), + Example(None, "45 جنيه", "جنيه", "45", 45.0), # Egyptian Pound (EGP) + Example(None, "45 ج.م", "ج.م", "45", 45.0), # Egyptian Pound (EGP) + Example(None, "45 E£", "E£", "45", 45.0), # Egyptian Pound (EGP) + Example(None, "2000 zl", "zl", "2000", 2000.0), # Polish zloty (PLN) + Example(None, "CAN$1.23", "CAN$", "1.23", 1.23), + Example(None, "200q", "q", "200", 200.0), # Guatemalan Quetzal + Example(None, "200Q", "Q", "200", 200.0), # Guatemalan Quetzal + Example(None, "1 دج", "دج", "1", 1.0), # Algerian Dinar + Example(None, "1 .د.ب", ".د.ب", "1", 1.0), # Bahraini Dinar + Example(None, "1 $b", "$b", "1", 1.0), # Barbadian dollar + Example(None, "1 P", "P", "1", 1.0), # Pound sterling, Botswana pula + Example(None, "1 franc", "franc", "1", 1.0), + Example(None, "2 francs", "francs", "2", 2.0), + Example(None, "1 ናቕፋ", "ናቕፋ", "1", 1.0), # Eritrean Nakfa + Example( + None, + "1 نافكا", # Arabic "نافكا" stands for "Navka", + # which can refer to Eritrean Nakfa + "نافكا", + "1", + 1.0, + ), + Example(None, "1 E", "E", "1", 1.0), # Can refer to Egyptian pound + Example(None, "1 ብር", "ብር", "1", 1.0), # Ethiopian birr + Example(None, "1 D", "D", "1", 1.0), # Gambian dalasi + Example(None, "1 ლ", "ლ", "1", 1.0), # Georgian lari + Example(None, "1 ¢", "¢", "1", 1.0), # Ghanaian cedi, cents + Example(None, "1 ₵", "₵", "1", 1.0), # Ghanaian cedi + Example(None, "1 GFr", "GFr", "1", 1.0), # Guinean franc + Example(None, "1 L", "L", "1", 1.0), + Example(None, "1 ع.د", "ع.د", "1", 1.0), # Iraqi dinar + Example( + None, + "1 د.", # Arabic "د." stands for dr. refers to "dinar" and "dirham": + # United Arab Emirates dirham (AED), Bahraini dinar (BHD), + # Algerian dinar (DZD), etc. + "د.", + "1", + 1.0, + ), + Example(None, "1 KSh", "KSh", "1", 1.0), # Kenyan shilling + Example(None, "1 د.ك", "د.ك", "1", 1.0), # Kuwaiti dinar + Example(None, "1 ل.د", "ل.د", "1", 1.0), # Libyan dinar + Example(None, "1 ден", "ден", "1", 1.0), # Macedonian denar + Example(None, "1 ДЕН", "ДЕН", "1", 1.0), # Macedonian denar + Example(None, "1 Ar", "Ar", "1", 1.0), # Malagasy ariary + Example(None, "1 د.إ", "د.إ", "1", 1.0), # United Arab Emirates dirham + Example(None, "1 MT", "MT", "1", 1.0), # Mozambican metical + Example(None, "1 K", "K", "1", 1.0), # Papua New Guinean kina + Example(None, "1 FRw", "FRw", "1", 1.0), # Rwandan Franc + Example(None, "1 RF", "RF", "1", 1.0), # Rwandan Franc + Example(None, "1 R₣", "R₣", "1", 1.0), # Rwandan Franc + Example(None, "1 Дин", "Дин", "1", 1.0), + Example(None, "1 SPL", "SPL", "1", 1.0), # Seborgan Luigino (SPL) + Example(None, "1 ج.س.", "ج.س.", "1", 1.0), # Sudanese pound + Example(None, "1 د.ت", "د.ت", "1", 1.0), # Tunisian dinar + Example(None, "AU $59.95", "AU $", "59.95", 59.95), + Example(None, "US $1.23", "US $", "1.23", 1.23), + Example(None, "CAD$1.23", "CAD$", "1.23", 1.23), + Example(None, "1 G$", "G$", "1", 1.0), # Guyanese dollar + Example(None, "1 GY$", "GY$", "1", 1.0), # Guyanese dollar + Example(None, "1 BTC", "BTC", "1", 1.0), # Bitcoin + Example(None, "1 CHf", "CHf", "1", 1.0), # Swiss franc + Example(None, "1 Dh", "Dh", "1", 1.0), # United Arab Emirates dirham + Example(None, "1 Dhs", "Dhs", "1", 1.0), # United Arab Emirates dirham + Example(None, "1 Esc", "Esc", "1", 1.0), # Cape Verdean escudo + Example(None, "1 Fbu", "Fbu", "1", 1.0), # Burundian franc + Example(None, "1 ID", "ID", "1", 1.0), # Iraqi dinar + Example(None, "1 Ks", "Ks", "1", 1.0), # Burmese kyat + Example(None, "1 NT", "NT", "1", 1.0), # New Taiwan dollar + Example(None, "1 Nu", "Nu", "1", 1.0), # Bhutanese ngultrum + Example(None, "1 Rbl", "Rbl", "1", 1.0), # Belarusian ruble, Russian ruble + Example(None, "1 Re", "Re", "1", 1.0), # Indian rupee, Sri Lankan rupee + Example(None, "1 S/", "S/", "1", 1.0), # Peruvian sol + Example(None, "1 SFr", "SFr", "1", 1.0), # Swiss franc + Example(None, "1 Sl", "Sl", "1", 1.0), # Somaliland shilling + Example(None, "1 VNĐ", "VNĐ", "1", 1.0), # Vietnamese đồng + Example(None, "1 Vt", "Vt", "1", 1.0), # Vanuatu vatu + Example(None, "1 din", "din", "1", 1.0), # Serbian dinar + Example(None, "1 hrn", "hrn", "1", 1.0), # Ukrainian hryvnia + Example(None, "1 kwz", "kwz", "1", 1.0), # Angolan kwanza + Example(None, "1 lari", "lari", "1", 1.0), # Georgian lari + Example(None, "1 nis", "nis", "1", 1.0), # Israeli new shekel + Example(None, "1 pound", "pound", "1", 1.0), # Pound sterling + Example(None, "1 Sʻ", "Sʻ", "1", 1.0), # Uzbekistani soʻm + Example(None, "1 S'", "S'", "1", 1.0), # Uzbekistani soʻm + Example(None, "1 so'm", "so'm", "1", 1.0), # Uzbekistani soʻm + Example(None, "1 som", "som", "1", 1.0), # Uzbekistani soʻm + Example(None, "1 stg", "stg", "1", 1.0), # Pound sterling + Example(None, "1 yuan", "yuan", "1", 1.0), # Renminbi/Chinese yuan + Example(None, "1 Ƀ", "Ƀ", "1", 1.0), # Bitcoin + Example(None, "1 дин", "дин", "1", 1.0), # Serbian dinar + Example(None, "1 км", "км", "1", 1.0), # Bosnia and Herzegovina convertible mark + Example(None, "1 с", "с", "1", 1.0), # Kyrgyz som, Tajikistani somoni + Example(None, "1 ש״ח", "ש״ח", "1", 1.0), # Israeli new shekel + Example(None, "1 ج.س", "ج.س", "1", 1.0), # Sudanese pound + Example(None, "1 د.أ", "د.أ", "1", 1.0), # Jordanian dinar + Example(None, "1 د.ا", "د.ا", "1", 1.0), # Jordanian dinar + Example(None, "1 د.ج", "د.ج", "1", 1.0), # Algerian dinar + Example(None, "1 د.م", "د.م", "1", 1.0), # Moroccan dirham + Example( + None, + "1 دينار", # Bahraini dinar, Algerian dinar, Iraqi dinar, + # Jordanian dinar, Kuwaiti dinar, Libyan dinar, + # Tunisian dinar + "دينار", + "1", + 1.0, + ), + Example(None, "1 دينار أردني", "دينار أردني", "1", 1.0), # Jordanian dinar + Example(None, "1 دينار كويتي", "دينار كويتي", "1", 1.0), # Kuwaiti dinar + Example(None, "1 ر.ع", "ر.ع", "1", 1.0), # Omani rial + Example(None, "1 ر.ق", "ر.ق", "1", 1.0), # Qatari riyal + Example(None, "1 ريال", "ريال", "1", 1.0), # Saudi riyal + Example(None, "1 ش.ج", "ش.ج", "1", 1.0), # Israeli new shekel + Example(None, "1 ل.س", "ل.س", "1", 1.0), # Syrian pound + Example(None, "1 ل.ل", "ل.ل", "1", 1.0), # Lebanese pound + Example(None, "1 ரூ", "ரூ", "1", 1.0), # Sri Lankan rupee + Example(None, "1 රු", "රු", "1", 1.0), # Sri Lankan rupee + Example(None, "1 ლარი", "ლარი", "1", 1.0), # Georgian lari + Example(None, "1 人民币", "人民币", "1", 1.0), # Renminbi/Chinese yuan + Example(None, "1 圆", "圆", "1", 1.0), # Renminbi/Chinese yuan + Example(None, "1 圓", "圓", "1", 1.0), # Renminbi/Chinese yuan + Example(None, "1 GBp", "GBp", "1", 1.0), # British Pound + Example(None, "1 £", "£", "1", 1.0), # British Pound + Example(None, "1 nzd", "nzd", "1", 1.0), # New Zealand dollar + Example(None, "1 mkd", "mkd", "1", 1.0), # Macedonian denar + Example(None, "CND", "CND", "1", 1.0), # Canadian dollar + Example(None, "KShs", "KShs", "1", 1.0), # Kenyan shilling + Example(None, "chf", "chf", "1", 1.0), # Swiss franc + Example(None, "so'm", "so'm", "1", 1.0), # Uzbekistani soʻm + Example(None, "тг", "тг", "1", 1.0), # Kazakhstani tenge + Example(None, 'ש"ח', 'ש"ח', "1", 1.0), # Israeli new shekel + Example(None, "ש'ח", "ש'ח", "1", 1.0), # Israeli new shekel + Example(None, "د.ع", "د.ع", "1", 1.0), # Iraqi dinar + Example(None, "د.ل", "د.ل", "1", 1.0), # Libyan dinar + Example( + None, "درهم", "درهم", "1", 1.0 # United Arab Emirates dirham, Moroccan dirham + ), + Example(None, "ر.ي", "ر.ي", "1", 1.0), # Yemeni rial + Example(None, "ش.ص", "ش.ص", "1", 1.0), # Somali shilling + Example( + None, + "1 G", # "G" may mean Guyanese dollar, but it is too ambiguous + "G", + "1", + 1.0, + ), ] PRICE_PARSING_DECIMAL_SEPARATOR_EXAMPLES = [ - Example(None, '1250€ 600', - '€', '1250', 1250, "€"), - Example(None, '1250€ 60', - '€', '1250€60', 1250.60, "€"), - Example(None, '1250€600', - '€', '1250€600', 1250.600, "€"), - Example(None, '.75 €', - '€', '.75', 0.75, '.'), - Example('$.75', '$.75', - '$', '.75', 0.75, '.'), - Example('$..75', '$..75', - '$', '.75', 0.75, '.'), - Example('$..75,333', '$..75,333', - '$', '.75,333', 0.75333, '.'), - Example('$..75,333', '$..75,333', - '$', '.75,333', 75.333, ','), - Example('$.750.30', '$.750.30', - '$', '750.30', 750.30, '.') + Example(None, "1250€ 600", "€", "1250", 1250, "€"), + Example(None, "1250€ 60", "€", "1250€60", 1250.60, "€"), + Example(None, "1250€600", "€", "1250€600", 1250.600, "€"), + Example(None, ".75 €", "€", ".75", 0.75, "."), + Example("$.75", "$.75", "$", ".75", 0.75, "."), + Example("$..75", "$..75", "$", ".75", 0.75, "."), + Example("$..75,333", "$..75,333", "$", ".75,333", 0.75333, "."), + Example("$..75,333", "$..75,333", "$", ".75,333", 75.333, ","), + Example("$.750.30", "$.750.30", "$", "750.30", 750.30, "."), ] @pytest.mark.parametrize( ["example"], - [[e] for e in PRICE_PARSING_EXAMPLES_BUGS_CAUGHT] + - [[e] for e in PRICE_PARSING_EXAMPLES_NEW] + - [[e] for e in PRICE_PARSING_EXAMPLES] + - [[e] for e in PRICE_PARSING_EXAMPLES_2] + - [[e] for e in PRICE_PARSING_EXAMPLES_3] + - [[e] for e in PRICE_PARSING_EXAMPLES_NO_PRICE] + - [[e] for e in PRICE_PARSING_EXAMPLES_NO_CURRENCY] + - [[e] for e in PRICE_PARSING_DECIMAL_SEPARATOR_EXAMPLES] + - [pytest.param(e, marks=pytest.mark.xfail(strict=True)) - for e in PRICE_PARSING_EXAMPLES_XFAIL + - PRICE_PARSING_EXAMPLES_XFAIL_CURRENCIES_TO_BE_ADDED + [[e] for e in PRICE_PARSING_EXAMPLES_BUGS_CAUGHT] + + [[e] for e in PRICE_PARSING_EXAMPLES_NEW] + + [[e] for e in PRICE_PARSING_EXAMPLES] + + [[e] for e in PRICE_PARSING_EXAMPLES_2] + + [[e] for e in PRICE_PARSING_EXAMPLES_3] + + [[e] for e in PRICE_PARSING_EXAMPLES_NO_PRICE] + + [[e] for e in PRICE_PARSING_EXAMPLES_NO_CURRENCY] + + [[e] for e in PRICE_PARSING_DECIMAL_SEPARATOR_EXAMPLES] + + [ + pytest.param(e, marks=pytest.mark.xfail(strict=True)) + for e in PRICE_PARSING_EXAMPLES_XFAIL + + PRICE_PARSING_EXAMPLES_XFAIL_CURRENCIES_TO_BE_ADDED ], - ids=idfn + ids=idfn, ) def test_parsing(example: Example): - parsed = Price.fromstring(example.price_raw, example.currency_raw, example.decimal_separator) - assert parsed == example, f"Failed scenario: price={example.price_raw}, currency_hint={example.currency_raw}" + parsed = Price.fromstring( + example.price_raw, example.currency_raw, example.decimal_separator + ) + assert parsed == example, ( + f"Failed scenario: price={example.price_raw}, " + f"currency_hint={example.currency_raw}" + ) @pytest.mark.parametrize( "amount,amount_float", ( (None, None), - (Decimal('1.23'), 1.23), - ) + (Decimal("1.23"), 1.23), + ), ) def test_price_amount_float(amount, amount_float): assert Price(amount, None, None).amount_float == amount_float @@ -2531,11 +1478,8 @@ def test_price_amount_float(amount, amount_float): ("140€33", "€", Decimal("140.33")), ("140,000€33", "€", Decimal("140000.33")), ("140.000€33", "€", Decimal("140000.33")), - ) + ), ) def test_price_decimal_separator(price_raw, decimal_separator, expected_result): - parsed = Price.fromstring( - price_raw, - decimal_separator=decimal_separator - ) + parsed = Price.fromstring(price_raw, decimal_separator=decimal_separator) assert parsed.amount == expected_result diff --git a/tox.ini b/tox.ini index aec8dc4..f6e7389 100644 --- a/tox.ini +++ b/tox.ini @@ -17,3 +17,8 @@ deps = mypy==0.982 commands = mypy -v --ignore-missing-imports --no-warn-no-return price_parser tests + +[testenv:pre-commit] +deps = pre-commit +commands = pre-commit run --all-files --show-diff-on-failure +skip_install = true \ No newline at end of file