Skip to content

Commit

Permalink
feat: regex improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
edugzlez committed Sep 29, 2024
1 parent 6496d81 commit 30e7f7a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Python 🐍 package 📦 to PyPI

on:
release:
types: [published]

jobs:
uv-example:
name: python
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true

- name: Set up Python 3.10
run: uv python install 3.10

- name: Install dependencies
run: uv sync

- name: Build distribution
run: uv build

- name: Publish distribution to PyPI
run: uv publish -t ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mdona-scrapper"
version = "0.1.4"
version = "0.1.5"
description = "A simple scrapper for Mercadona's receipts"
readme = "README.md"
requires-python = ">=3.8,<3.12"
Expand Down
4 changes: 2 additions & 2 deletions src/mdona_scrapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class MercadonaScrapper:
)

SPECIAL_PRODUCT_RE = re.compile(
r"([\w\d \-\&\+%]+)\n- Peso: +([0-9]+,[0-9]+) +([\w]+) +Precio +([\w]+): +([0-9]+,[0-9]+) +€ + ([0-9]+) ([0-9]+,[0-9]+) €"
r"([\w\d \-\&\+%]+)\n-\s*Peso:\s+([0-9]+,[0-9]+)\s+([\w]+)\s+Precio\s+([\w]+):\s+([0-9]+,[0-9]+)\s*€\s*([0-9]+)\s+([0-9]+,[0-9]+)\s*€"
)

NORMAL_PRODUCT_RE = re.compile(r"([\w\d \-\&\+%]+) ([0-9]+) ([0-9]+,[0-9]+) ?€\n?")
NORMAL_PRODUCT_RE = re.compile(r"([\w\d, \-\&\+%]+) ([0-9]+) ([0-9]+,[0-9]+) ?€\n?")

NORMAL_PARTIAL_PRODUCT_RE = re.compile(r"([\w\d \-\&\+%]+) ([0-9]+) de")

Expand Down

0 comments on commit 30e7f7a

Please sign in to comment.