commit 75bceef3c6f3ad14c5b9f56735dc8c3704b07729 Author: Bo Peng Date: Fri Mar 14 14:39:23 2025 -0500 Re-upload under an AGPL license diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..8b2a042 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,35 @@ +[bumpversion] +commit = True +tag = False +current_version = 0.2.0 + +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" + +[bumpversion:file:src/ai_marketplace_monitor/__init__.py] +search = __version__ = "{current_version}" +replace = __version__ = "{new_version}" + +[bumpversion:file(title):CHANGELOG.md] +search = {#}{#} [Unreleased] +replace = {#}{#} [Unreleased] + + {#}{#} [{new_version}] - {now:%Y-%m-%d} + +[bumpversion:file(links):CHANGELOG.md] +search = [Unreleased]: https://github.com/BoPeng/ai-marketplace-monitor/compare/v{current_version}...HEAD +replace = [Unreleased]: https://github.com/BoPeng/ai-marketplace-monitor/compare/v{new_version}...HEAD + [{new_version}]: https://github.com/BoPeng/ai-marketplace-monitor/compare/v{current_version}...v{new_version} + +[bumpversion:file(version):CITATION.cff] +search = version: {current_version} +replace = version: {new_version} + +[bumpversion:file(tag):CITATION.cff] +search = https://github.com/BoPeng/ai-marketplace-monitor/releases/tag/v{current_version} +replace = https://github.com/BoPeng/ai-marketplace-monitor/releases/tag/v{new_version} + +[bumpversion:file(description):CITATION.cff] +search = description: The Software Heritage link for version {current_version}. +replace = description: The Software Heritage link for version {new_version}. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..6a79d60 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# This is a comment. +# Each line is a file pattern followed by one or more owners. + +# More details are here: https://help.github.com/articles/about-codeowners/ + +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# @BoPeng will be requested for review when someone opens +# a pull request. +* @BoPeng diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..cec068c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,8 @@ +--- +# This is a comment. +# You can configure the sponsor button in your repository to include +# sponsored developers in GitHub Sponsors, external funding platforms, +# or a custom funding URL. + +# More details are here: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository +github: BoPeng diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..34aba46 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: 🐛 Bug report +about: Create a report to help us improve +title: "[Bug] Your title here" +labels: bug +assignees: "" +--- + +## Expected Behavior + +--- + +## Actual Behavior + +--- + +## Steps to Reproduce the Problem + +1. +1. +1. + +--- + +## Specifications + +- Version: +- Platform: +- Subsystem: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..8005e32 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,2 @@ +blank_issues_enabled: false +contact_links: [] diff --git a/.github/ISSUE_TEMPLATE/discussion.md b/.github/ISSUE_TEMPLATE/discussion.md new file mode 100644 index 0000000..af37a97 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/discussion.md @@ -0,0 +1,31 @@ +--- +name: 💬 General discussion +about: Start a conversation or share thoughts on miscellaneous topics related to the project. +title: "[Discussion] Your topic here" +labels: discussion +assignees: "" +--- + +**Topic or Idea** +Briefly describe the topic or idea you'd like to discuss. Be clear and concise to help others understand the focus of the conversation. + +--- + +**Details** +Provide more context or details about your topic. For example: + +- Why is this topic relevant or important? +- Are there specific aspects you'd like feedback on? + +--- + +**Goals or Outcomes** +What do you hope to achieve with this discussion? (e.g., gather opinions, brainstorm ideas, find solutions). + +--- + +**Additional Context** +Include any relevant information, such as: + +- Links to related issues, pull requests, or documentation. +- Examples, screenshots, or references to support your points. diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000..497bcc1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,33 @@ +--- +name: 📝 Documentation Improvement +about: Suggest updates or improvements to project documentation. +title: "[Docs] Your suggestion here" +labels: documentation +assignees: "" +--- + +**Current Issue** +Briefly describe the problem or limitation in the current documentation. Be specific about what is unclear, outdated, or missing. + +--- + +**Proposed Improvement** +Explain how the documentation can be improved. Provide details about the changes you'd like to see, such as: + +- Sections that need clarification. +- New topics that should be added. +- Updates to keep documentation accurate. + +--- + +**Affected Pages or Sections** +List the specific pages, files, or sections in the documentation that are impacted. Example: + +--- + +**Additional Context** +Provide any relevant details, such as: + +- Links to related issues or pull requests. +- Screenshots or examples of the current documentation. +- External resources or references that could support the improvement. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..d9b0a21 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: 🚀 Feature request +about: Suggest an idea for this project +title: "[Feature Request] Your title here" +labels: enhancement +assignees: "" +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +--- + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +--- + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +--- + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..3588b67 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,38 @@ +--- +name: 🤔 General question +about: Suggest an idea for this project +title: "[Question] Your title here" +labels: question +assignees: "" +--- + +**Description** +Provide a detailed explanation of your question or issue. Be as specific as possible. + +--- + +**Steps to Reproduce (if applicable)** +If your question involves reproducing an issue, please list the steps to replicate it. + +1. Step one +2. Step two +3. Step three + +--- + +**Expected Outcome (if applicable)** +What did you expect to happen? + +--- + +**Actual Outcome (if applicable)** +What actually happened? + +--- + +**Additional Information** + +Add any relevant details here, including: + +- Versions of tools, dependencies, or environments. +- Screenshots (if they help explain the question). diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..4030f6f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Fixes # + +## Proposed Changes + + - + - + - diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..801cc12 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + - package-ecosystem: pip + directory: "/docs" + schedule: + interval: daily + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/close-stale-issue.yml b/.github/workflows/close-stale-issue.yml new file mode 100644 index 0000000..e561aea --- /dev/null +++ b/.github/workflows/close-stale-issue.yml @@ -0,0 +1,23 @@ +name: Close Stale Issues + +on: + schedule: + - cron: "0 0 * * *" # Runs daily at midnight UTC + +permissions: + issues: write + +jobs: + close-stale-issues: + runs-on: ubuntu-latest + steps: + - name: Close inactive issues + uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: "This issue has been inactive for a while. If there’s no response, it will be closed automatically." + close-issue-message: "Closing this issue due to inactivity. Feel free to reopen if needed!" + days-before-stale: 7 # Days before marking the issue as stale + days-before-close: 3 # Days after being marked stale before closing + only-labels: "resolved" # Only apply to issues with this label + exempt-issue-creator: true # Do not auto-close issues created by the repo owner diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..9369117 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + push: + branches: + pull_request: + branches: + schedule: + - cron: '0 6 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml new file mode 100644 index 0000000..2b179d2 --- /dev/null +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -0,0 +1,44 @@ +name: "Pre-commit autoupdate" + +on: + schedule: + - cron: "0 6 * * 1" + workflow_dispatch: + +jobs: + autoupdate: + name: autoupdate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5.4.0 + with: + python-version: 3.12 + + - name: Install system deps + shell: bash + run: | + pip install poetry + poetry config virtualenvs.in-project true + poetry install --no-root --only dev --only linters --sync + + - name: Run autoupdate + run: poetry run pre-commit autoupdate + continue-on-error: true + + - name: Run pre-commit + run: poetry run pre-commit run --all-files + + - uses: peter-evans/create-pull-request@v7.0.8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: chore-update-pre-commit-hooks + title: Update pre-commit hooks + commit-message: "Update pre-commit hooks" + body: | + # Update pre-commit hooks + + - Update pre-commit hooks to the latest version. + delete-branch: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a854933 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,78 @@ +name: release + +on: + push: + tags: + - "v*" + +permissions: + id-token: write + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5.4.0 + with: + python-version: 3.12 + + - name: Install system deps + shell: bash + run: | + pip install poetry + poetry config virtualenvs.in-project true + + - name: Build package + run: | + poetry build --ansi + + - name: Publish package on PyPI + uses: pypa/gh-action-pypi-publish@v1.12.4 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + attestations: false + + - name: Publish package on TestPyPI + uses: pypa/gh-action-pypi-publish@v1.12.4 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + attestations: false + + github_release: + needs: release + name: Create Github Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + + - name: Get version from tag + id: tag_name + shell: bash + run: | + echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v} + + - name: Get Changelog Entry + id: changelog_reader + uses: mindsers/changelog-reader-action@v2.2.3 + with: + version: ${{ steps.tag_name.outputs.current_version }} + path: ./CHANGELOG.md + + - name: Create Release + id: create_release + uses: actions/create-release@v1.1.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: ${{ steps.changelog_reader.outputs.changes }} + draft: false + prerelease: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..fb60b06 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,114 @@ +name: tests + +on: + push: + branches: + pull_request: + branches: + +jobs: + linting: + name: Linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5.4.0 + with: + python-version: 3.12 + + - name: Install system deps + shell: bash + run: | + pip install poetry + poetry config virtualenvs.in-project true + poetry install --no-root --only dev --only linters --sync + + - name: Linting + shell: bash + run: poetry run pre-commit run --all-files + + tests: + needs: linting + name: ${{ matrix.os }} / ${{ matrix.python-version }} + runs-on: ${{ matrix.os }}-latest + strategy: + matrix: + os: [Ubuntu, MacOS] + python-version: ["3.10", "3.11", "3.12"] + fail-fast: true + steps: + - uses: actions/checkout@v4.2.2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5.4.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Install system deps + shell: bash + run: | + pip install nox-poetry==1.1.0 + pip install poetry==1.8.5 + poetry config virtualenvs.in-project true + + - name: Run mypy with nox + shell: bash + run: nox --force-color -s mypy-${{ matrix.python-version }} + + - name: Install Playwright Browsers + run: | + pip install playwright + playwright install --with-deps # Ensures browsers and dependencies are installed + + - name: Run tests with nox + shell: bash + run: nox --force-color -s tests-${{ matrix.python-version }} + + - name: Run securtity check + if: matrix.python-version == '3.12' && matrix.os == 'Ubuntu' + shell: bash + run: nox --force-color -s security + + - name: Upload coverage data + uses: actions/upload-artifact@v4.6.1 + with: + name: ${{ matrix.os }}-${{ matrix.python-version }}.coverage-data + path: ".coverage.*" + include-hidden-files: true + retention-days: 2 + + # coverage: + # needs: tests + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4.2.2 + + # - name: Set up Python 3.12 + # uses: actions/setup-python@v5.4.0 + # with: + # python-version: 3.12 + + # - name: Install system deps + # shell: bash + # run: | + # pip install nox-poetry==1.1.0 + # pip install poetry==1.8.5 + # poetry config virtualenvs.in-project true + + # - name: Download coverage data + # uses: actions/download-artifact@v4.1.8 + # with: + # pattern: "*.coverage-data" + # merge-multiple: true + + # - name: Create coverage report + # shell: bash + # run: | + # nox --force-color --session=coverage -- --fmt xml + + # - name: Upload coverage report + # uses: codecov/codecov-action@v5.1.2 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8eb5b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,135 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# pytype +.pytype/ + +# Pyre type checker +.pyre/ + +# Code editors +.vscode diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..664e3f9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,42 @@ +--- +default_install_hook_types: + - pre-commit + - post-checkout + - post-merge +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-toml + - id: check-json + - id: check-yaml + - id: debug-statements + - id: check-merge-conflict + - id: pretty-format-json + args: [--autofix, "--no-sort-keys"] + exclude: .ipynb + - id: end-of-file-fixer + - id: trailing-whitespace + exclude: .bumpversion.cfg + # - repo: https://github.com/timothycrosley/isort + # rev: 5.13.2 + # hooks: + # - id: isort + - repo: https://github.com/psf/black + rev: 24.10.0 + hooks: + - id: black + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.4 + hooks: + - id: ruff + args: [--fix] + - repo: https://github.com/citation-file-format/cffconvert + rev: 5295f87c0e261da61a7b919fc754e3a77edd98a7 + hooks: + - id: validate-cff + - repo: https://github.com/python-poetry/poetry + rev: 1.8.3 + hooks: + - id: poetry-check + - id: poetry-install diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..2849bae --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +formats: all + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/.safety-policy.yml b/.safety-policy.yml new file mode 100644 index 0000000..b02b6e3 --- /dev/null +++ b/.safety-policy.yml @@ -0,0 +1,12 @@ +version: '2.0' + +# Safety Security and License Configuration file +security: # configuration for the `safety check` command + ignore-cvss-severity-below: 0 # A severity number between 0 and 10. Some helpful reference points: 9=ignore all vulnerabilities except CRITICAL severity. 7=ignore all vulnerabilities except CRITICAL + ignore-cvss-unknown-severity: False # True or False. We recommend you set this to False. + ignore-vulnerabilities: # Here you can list multiple specific vulnerabilities you want to ignore (optionally for a time period) + # We recommend making use of the optional `reason` and `expires` keys for each vulnerability that you ignore. + # 70612: + # reason: we do not use the vulnerable function + # expires: '2025-10-10' + continue-on-vulnerability-error: False # Suppress non-zero exit codes when vulnerabilities are found. Enable this in pipelines and CI/CD processes if you want to pass builds that have vulnerabilities diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9cec94b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,143 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.8.8] - 2025-03-13 + +- Re-release AI Marketplace Monitor under a AGLP license + +## [0.8.8] - 2025-03-12 + +- Allow option date_listed to accept numeric value #96 +- Fix importing pushover #91 + +## [0.8.6] - 2025-03-03 + +- Allow support for multiple languages. + +## [0.8.5] - 2025-03-03 + +- Allow [pushover](https://pushover.net/) notification + +## [0.8.2] - 2025-03-02 + +- Reorganize notification settings +- Support the use of environment variables for passwords +- Support browser proxy + +**BREAKING CHANGES** + +- Rename `smtp` sections to `notification` +- Rename parameter `smtp` to `notify_with` + +## [0.7.11] - 2025-03-01 + +- Fix a bug on the handling of logical expressions for `keywords` and `antikeywords`. +- Add support for another auto layout page + +## [0.8.9] - 2025-02-21 + +- Add options `prompt`, `extra_prompt` and `rating_prompt` + +## [0.7.7] - 2025-02-17 + +- Expand the use of `enabled=False` to all sections +- Allow complex `AND` `OR` and `NOT` operations for `keywords` and `antikeywords`. + +## [0.7.4] - 2025-02-10 + +- Rename `keywords` to `search_phrases`, `include_keywords` to `keywords` and `exclude_keywords` to `antikeywords` [#45] +- Separate statistics by item name [#46] + +## [0.7.3] - 2025-02-07 + +- Allow email notification + +## [0.7.0] - 2025-02-06 + +- Re-retrieve details of listings if there are title or price change +- Allow sending reminders for available items after specified time. (#41) +- Display counters + +## [0.6.5] - 2025-02-05 + +- Allow checking URLs during monitoring (#34) +- Add option `ai` that allows the specification of AI models to use for certain marketplaces or items. +- Support locally hosted Ollama models +- Support DeepSeek-r1 model with `` tags. +- Add option `timeout` to AI request. +- Expand command line option `--clear-cache` + +## [0.6.2] - 2025-02-03 + +- Support extracting details from automobile listings. + +## [0.6.1] - 2025-02-02 + +- Allow multiple `start_at` + +## [0.6.0] - 2025-02-01 + +- Allow some parameters to different from initial and subsequent searches. +- Allow the AI to return a rating and some comments, and use the rating to determine if the user should be notified. + +## [0.5.3] - 2025-01-31 + +- Add command line option `--diable-javascript` which can be helpful in some cases. +- Add option `include_keywords` to fine-tune the behavior of `keywords`. +- Add option `provider` to allow the specfication of more AI service providers. +- Allow `market_type` to marketplaces and allow multiple marketplaces. + +## [0.5.1] - 2025-01-30 + +- Change the unit of `search-interval` to seconds to allow for more frequent search, although that is not recommended. +- Rename option `acceptable_locations` to `seller_locations` + +## [0.5.0] - 2025-01-29 + +- Allow each time to add its own `search_interval` +- Add options such as `delivery_method`, `radius`, and `condition` +- Add options to define and use regions for searching large regions + +## [0.4.5] - 2025-01-27 + +- Add option `--check` and `--for` to check particular listings + +## [0.4.3] - 2025-01-26 + +- Add support for DeepSeek + +## [0.4.0] - 2025-01-25 + +- Allow section `[ai.openai]` +- Use openAI to confirm if the item matches what user requests +- Slightly better logging + +## [0.3.3] - 2025-01-21 + +- Allow option `enabled` for items +- Notify all users if no `notify` is specified for item or marketplace +- Compare string after normalization (#8) +- Stop sleeping if config files are changed. Allowing more interactive modification of search terms. +- Give more time after logging in, allow option `login_wait_time`. +- Allow entering username and password manually + +## [0.2.0] - 2025-01-21 + +- Allow the definition of a reusable config file from `~/.ai-marketplace-monitor/config.toml` +- Allow options `exclude_sellers` and `exclude_by_description` +- Fix a bug that prevents the sending of phone notification + +## [0.1.0] - 2025-01-20 + +### Added + +- First release on PyPI. + +[Unreleased]: https://github.com/BoPeng/ai-marketplace-monitor/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/BoPeng/ai-marketplace-monitor/compare/releases/tag/v0.1.0 diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..9dc3995 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,24 @@ +# This CITATION.cff file was generated with cffinit. +# Visit https://bit.ly/cffinit to generate yours today! + +cff-version: 1.2.0 +title: AI Marketplace Monitor +message: >- + If you use this software, please cite it using the + metadata from this file. +type: software +authors: + - given-names: Bo + family-names: Peng + alias: fedejaure +identifiers: + - type: url + value: >- + https://github.com/BoPeng/ai-marketplace-monitor/releases/tag/v0.1.0 + description: The Software Heritage link for version 0.1.0. +repository-code: 'https://github.com/BoPeng/ai-marketplace-monitor' +abstract: An AI-based tool for monitoring facebook marketplace +keywords: + - ai-marketplace-monitor +license: MIT +version: 0.1.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..104d7a0 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +email. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d51f376 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,103 @@ +# Contributing to AI Marketplace Monitor + +👏🎉 First off all, Thanks for your interest in contributing to our project! 🎉👏 + +The following is a set of guidelines for contributing to AI Marketplace Monitor. These are +mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +## Code of Conduct + +We take our open source community seriously and hold ourselves and other contributors to high standards of communication. By participating and contributing to this project, you agree to uphold our [Code of Conduct](CODE_OF_CONDUCT.md). + +## Getting Started + +### Requirements + +We use `poetry` to manage and install dependencies. [Poetry](https://python-poetry.org/) provides a custom installer that will install `poetry` isolated from the rest of your system. + +``` +curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - +``` + +We'll also need `nox` for automated testing in multiple Python environments so [install that too](https://nox.thea.codes/en/stable/). + +To install the local development requirements inside a virtual environment run: + +``` +$ poetry install +$ poetry run inv install-hooks +``` + +> For more information about `poetry` check the [docs](https://python-poetry.org/docs/). + +We use [invoke](http://www.pyinvoke.org/) to wrap up some useful tasks like formatting, linting, testing and more. + +Execute `inv[oke] --list` to see the list of available commands. + +## Running _AI Marketplace Monitor_ from source code + +If you would like to run the latest version of _AI Marketplace Monitor_ or test a branch, please checkout the repository + +```sh +git clone https://github.com/BoPeng/ai-marketplace-monitor +cd ai-marketplace-monitor +``` + +or updating a local copy with commands + +```sh +cd ai-marketplace-monitor +git pull +``` + +switch to a branch, e.g. `dev`, if needed, + +```sh +git checkout dev +``` + +Then install the tool from source code with command + +```sh +poetry install +``` + +## Contributing + +### Issues + +We use GitHub issues to track public bugs/enhancements. Report a new one by [opening a new issue](https://github.com/BoPeng/ai-marketplace-monitor/issues). + +In this repository, we provide a couple of templates for you to fill in for: + +- Bugs +- Feature Requests/Enhancements + +Please read each section in the templates and provide as much information as you can. Please do not put any sensitive information, +such as personally identifiable information, connection strings or cloud credentials. The more information you can provide, the better we can help you. + +### Pull Requests + +Please follow these steps to have your contribution considered by the maintainers: + +1. Fork the repo and create your branch locally with a succinct but descriptive name. +2. Add tests for the new changes +3. Edit documentation if you have changed something significant +4. Make sure to follow the [styleguides](#styleguides) +5. Open a PR in our repository and follow the PR template so that we can efficiently review the changes +6. After you submit your pull request, verify that all status checks are passing + +While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design +work, tests, or other changes before your pull request can be ultimately accepted. + +## Styleguides + +### Python Code Style + +All Python code is linted with [Ruff](https://github.com/astral-sh/ruff) and formated with +[Isort](https://github.com/PyCQA/isort) and [Black](https://github.com/psf/black). You can +execute `inv[oke] lint` and `inv[oke] format`. + +## Additional Notes + +If you have any question feel free to contact us at email. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0ad25db --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5da6604 --- /dev/null +++ b/README.md @@ -0,0 +1,675 @@ +![AI Marketplace Monitor](docs/AIMM_neutral.png) + +
+ +[![PyPI - Version](https://img.shields.io/pypi/v/ai-marketplace-monitor.svg)](https://pypi.python.org/pypi/ai-marketplace-monitor) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ai-marketplace-monitor.svg)](https://pypi.python.org/pypi/ai-marketplace-monitor) +[![Tests](https://github.com/BoPeng/ai-marketplace-monitor/workflows/tests/badge.svg)](https://github.com/BoPeng/ai-marketplace-monitor/actions?workflow=tests) +[![Codecov](https://codecov.io/gh/BoPeng/ai-marketplace-monitor/branch/main/graph/badge.svg)](https://codecov.io/gh/BoPeng/ai-marketplace-monitor) +[![Read the Docs](https://readthedocs.org/projects/ai-marketplace-monitor/badge/)](https://ai-marketplace-monitor.readthedocs.io/) +[![PyPI - License](https://img.shields.io/pypi/l/ai-marketplace-monitor.svg)](https://pypi.python.org/pypi/ai-marketplace-monitor) + +[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) + +
+ +An intelligent tool that monitors Facebook Marketplace listings using AI to help you find the best deals. Get instant notifications when items matching your criteria are posted, with AI-powered analysis of each listing. + +![Search In Action](docs/search_in_action.png) + +Example notification from PushBullet: + +``` +Found 1 new gopro from facebook +[Great deal (5)] Go Pro hero 12 +$180, Houston, TX +https://facebook.com/marketplace/item/1234567890 +AI: Great deal; A well-priced, well-maintained camera meets all search criteria, with extra battery and charger. +``` + +**Table of content:** + +- [✨ Key Features](#-key-features) +- [Usage](#usage) + - [Before the prerequisites](#before-the-prerequisites) + - [Prerequisites](#prerequisites) + - [Installation](#installation) + - [Set up a notification method (optional)](#set-up-a-notification-method-optional) + - [Sign up with an AI service or build your own (optional)](#sign-up-with-an-ai-service-or-build-your-own-optional) + - [Configuration](#configuration) + - [Run the program](#run-the-program) + - [Updating search](#updating-search) + - [Cost of operations](#cost-of-operations) +- [Advanced features](#advanced-features) + - [Setting up email notification](#setting-up-email-notification) + - [Adjust prompt and notification level](#adjust-prompt-and-notification-level) + - [Advanced Keyword-based filters](#advanced-keyword-based-filters) + - [Searching multiple cities and regions](#searching-multiple-cities-and-regions) + - [Support for non-English languages](#support-for-non-english-languages) + - [Check individual listing](#check-individual-listing) + - [Multiple marketplaces](#multiple-marketplaces) + - [First and subsequent searches](#first-and-subsequent-searches) + - [Showing statistics](#showing-statistics) + - [Self-hosted Ollama Model](#self-hosted-ollama-model) + - [Cache Management](#cache-management) + - [Support for different layouts of facebook listings](#support-for-different-layouts-of-facebook-listings) + - [Searching Anonymously with a Proxy Server](#searching-anonymously-with-a-proxy-server) +- [Contributing](#contributing) +- [License](#license) +- [Support](#support) +- [Credits](#credits) + +## ✨ Key Features + +🔍 **Smart Search** + +- Search multiple products using keywords +- Filter by price and location +- Exclude irrelevant results and spammers +- Support for different Facebook Marketplace layouts + +🤖 **AI-Powered** + +- Intelligent listing evaluation +- Smart recommendations +- Multiple AI service providers supported +- Self-hosted model option (Ollama) + +📱 **Notifications** + +- PushBullet, PushOver, or Ntfy notifications +- HTML email notifications with images +- Customizable notification levels +- Repeated notification options + +🌎 **Location Support** + +- Multi-city search +- Pre-defined regions (USA, Canada, etc.) +- Customizable search radius +- Flexible seller location filtering + +## Usage + +### Before the prerequisites + +_AI Marketplace Monitor_ is a tool designed to assist users in monitoring online marketplaces, with a focus on leveraging AI technologies to filter out spam and irrelevant listings. **This project was developed for personal, hobbyist use only**. + +However, it is crucial to understand that **Facebook's [EULA](https://www.facebook.com/terms/)** explicitly prohibits the use of automated tools to collect or access data without prior authorization: + +> You may not access or collect data from our Products using automated means (without our prior permission) or attempt to access data you do not have permission to access, regardless of whether such automated access or collection is undertaken while logged-in to a Facebook account. + +By using _AI Marketplace Monitor_, you acknowledge and agree that **you are solely responsible for ensuring compliance with Facebook’s (Meta’s) terms of service, as well as any applicable laws and regulations**. If you intend to use this tool — particularly for commercial or for-profit purposes — you **must** obtain explicit permission from Meta (and any other marketplaces that this tool may support in the future) before proceeding. + +Unauthorized use of this tool may result in account suspension, legal consequences, or other penalties. **The developers and contributors of _AI Marketplace Monitor_ disclaim any liability for misuse, violations of platform policies, or any resulting consequences**. Use this tool at your own risk and ensure compliance with relevant terms and regulations before deployment. + +### Prerequisites + +- Python 3.x installed. +- Internet connection + +### Installation + +Install the program by + +```sh +pip install ai-marketplace-monitor +``` + +Install a browser for Playwright using the command: + +```sh +playwright install +``` + +### Set up a notification method (optional) + +If you would like to receive notification from your phone via PushBullet + +- Sign up for [PushBullet](https://www.pushbullet.com/), [PushOver](https://pushover.net/) or [Ntfy](https://ntfy.sh/) +- Install the app on your phone +- Go to the respective website and obtain necessary token(s) + +If you would like to receive email notification, obtain relevant SMTP settings from your email provider. See [Setting up email notification](#setting-up-email-notification) for details. + +### Sign up with an AI service or build your own (optional) + +You can sign up for an AI service (e.g. [OpenAI](https://openai.com/) and [DeepSeek](https://www.deepseek.com/)) by + +- Sign up for an account +- Go to the API keys section of your profile, generate a new API key, and copy it + +You can also connect to any other AI service that provides an OpenAI compatible API, or host your own large language model using Ollama (see [Self-hosted Ollama Model](#self-hosted-ollama-model) for details.) + +### Configuration + +One or more configuration file in [TOML format](https://toml.io/en/) is needed. The following example ([`minimal_config.toml`](docs/minimal_config.toml)) shows the absolute minimal number of options, namely which city you are searching in, what item you are searching for, and how you get notified with matching listings. + +```toml +[marketplace.facebook] +search_city = 'houston' + +[item.name] +search_phrases = 'Go Pro Hero 11' + +[user.user1] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +``` + +The configuration file needs to be put as `$HOME/.ai-marketplace-monitor/config.toml`, or be specified via option `--config`. + +A more realistic example using openAI would be + +```toml +[ai.openai] +api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + +[marketplace.facebook] +search_city = 'houston' +username = 'your@email.com' +seller_locations = [ + "sugar land", + "stafford", + "missouri city", + "pearland" +] + +[item.name] +search_phrases = 'Go Pro Hero 11' +description = '''A new or used Go Pro version 11, 12 or 13 in + good condition. No other brand of camera is acceptable. + Please exclude sellers who offer shipping or asks to + purchase the item from his website.''' +keywords = "('Go Pro' OR gopro) AND (11 OR 12 OR 13)" +min_price = 100 +max_price = 200 + +[item.name2] +search_phrases = 'something rare' +description = '''A rare item that has to be searched nationwide and be shipped. + listings from any location are acceptable.''' +search_region = 'usa' +delivery_method = 'shipping' +seller_locations = [] + +[user.user1] +email = 'you@gmail.com' +smtp_password = 'xxxxxxxxxxxxxxxx' +``` + +For a complete list of options, please see the [configuration documentation](docs/README.md). + +### Run the program + +```sh +ai-marketplace-monitor +``` + +or use option `--config` for a non-standard configuration file. + +Use `Ctrl-C` to terminate the program. + +**NOTE** + +1. You need to keep the terminal running to allow the program to run indefinitely. +2. You will see a browser firing up. **You may need to manually enter username and/or password (if unspecified in config file), and answer any prompt (e.g. CAPTCHA) to login**. You may want to click "OK" to save the password, etc. +3. If you fail to login to facebook, _AI Marketplace Monitor_ will continue to operate. However, Facebook will not be able to provide results related to your user profile and will display a login screen over all search pages. + +### Updating search + +It is recommended that you **check the log messages and make sure that it includes and excludes listings as expected**. Modify the configuration file to update search criteria if needed. The program will detect changes and restart the search automatically. + +### Cost of operations + +1. **Licensing Costs**: None. +2. **External Service Costs**: Usage-dependent costs for notification services (e.g., PushBullet, SMTP) and AI platforms (e.g., OpenAI, DeepSeek). +3. **Infrastructure Costs**: Requires a PC, server, or cloud hosting (e.g., AWS t3.micro at ~$10/month) for 24/7 operation. +4. **Maintenance and Support**: Open-source support via GitHub; Active subscribers to our Pro or Business Plans get priority email support. + +## Advanced features + +### Setting up email notification + +To send email notifications, you need to specify recipient email addresses in the `email` of a `user` or a notification setting. You can configure multiple users with individual or multiple email addresses like this: + +```toml +[user.user1] +email = 'user1@gmail.com' + +[user.user2] +email = ['user2@gmail.com', 'user2@outlook.com'] +``` + +An SMTP server is required for sending emails, for which you will need to know `smtp_server`, `smtp_port`, `smtp_username` and `smtp_password`. Generally speaking, you will need to create a notification section with the information obtained from your email service provider. + +```toml +[notification.myprovider] +smtp_username = 'username@EMAIL.COM' # default to email +smtp_server = 'smtp.EMAIL.COM' # default to smtp.EMAIL.COM +smtp_port = 587 # default for most providers +smtp_password = 'mypassword' +``` + +`ai-marketplace-monitor` will try to use `email` if `smtp_username` is unspecified, and determine `smtp_username` and `smtp_server` automatically from the sender email address. For example, your Gmail setup could be as simple as: + +```toml +[notification.gmail] +smtp_password = 'abcdefghijklmnop' +``` + +You can specify `smtp_password` directly in the `user` section if you are not sharing the `notification` setting with other users. + +```toml +[user.me] +email = 'myemail@gmail.com' +smtp_password = 'abcdefghijklmnop' +``` + +**Note:** + +- **Gmail Users**; Your will need to create a separate app password for your Google account as `smtp_password`. +- **Commercial Users**: If you are a subscriber to our Pro or Business Plans, detailed instructions on configuring the SMTP service we provide will be sent to you via email. + +### Adjust prompt and notification level + +_ai-marketplace-monitor_ asks AI services to evaluate listings against the criteria that you specify with prompts in four parts: + +Part 1: buyer intent + +``` +A user wants to buy a ... with search phrase ... description ..., price range ..., +with keywords .... and exclude ... +``` + +Part 2: listing details + +``` +The user found a listing titled ... priced at ..., located ... posted at ... +with description ... +``` + +Part 3: instruction to AI + +``` +Evaluate how well this listing matches the user's criteria. Assess the description, +MSRP, model year, condition, and seller's credibility. +``` + +Part 4: rating instructions + +``` +Rate from 1 to 5 based on the following: + +1 - No match: Missing key details, wrong category/brand, or suspicious activity (e.g., external links). +2 - Potential match: Lacks essential info (e.g., condition, brand, or model); needs clarification. +3 - Poor match: Some mismatches or missing details; acceptable but not ideal. +4 - Good match: Mostly meets criteria with clear, relevant details. +5 - Great deal: Fully matches criteria, with excellent condition or price. + +Conclude with: +"Rating [1-5]: [summary]" +where [1-5] is the rating and [summary] is a brief recommendation (max 30 words)." +``` + +Depending on your specific needs, you can replace part 3 and part 4 of the prompt with options `prompt` and `rating_prompt`, and add an extra prompt before rating prompt with option `extra_prompt`. These options can be specified at the `marketplace` and `item` levels, with the latter overriding the former. + +For example, you can add + +```toml +[marketplace.facebook] +extra_prompt = """Exclude any listing that recommend visiting an external website \ + for purchase.""" +``` + +to describe suspicious listings in a marketplace, and + +```toml +[item.ipadpro] +prompt = """Find market value for listing on market places like Ebay \ + or Facebook marketplace and compare the price of the listing, considering \ + the description, selling price, model year, condition, and seller's \ + credibility. Evaluate how well this listing matches the user's criteria. + """ +``` + +With these settings, the part 3 of the prompt for item `ipadpro` will be replaced +with `prompt` for `item.ipadpro` and the `extra_prompt` from `marketplace.facebook`. + +When AI services are used, the program by default notifies you of all listing with a rating of 3 or higher. You can change this behavior by setting for example + +```toml +rating = 4 +``` + +to see only listings that match your criteria well. Note that all listings after non-AI-based filtering will be returned if no AI service is specified or non-functional. + +### Advanced Keyword-based filters + +Options `keywords` and `antikeywords` are used to filter listings according to specified keywords. In the simplest form, these options support a single string. For example, + +```toml +keywords = 'drone' +antikeywords = 'Parrot' +``` + +will select all listings with `drone` in title or description, and `Parrot` not in title or description. You can use multiple keywords and operators `AND`, `OR`, and `NOT` in the parameter. For example + +```toml +keywords = 'DJI AND drone' +``` + +looks for listings with both `DJI` and `drone` in title or description. + +If you have multiple keywords specified in a list, they are by default joint by `OR`. That is to say, + +```toml +keywords = ['drone', 'DJI', 'Orqa'] +antikeywords = ['Parrot', 'Autel'] +``` + +is equivalent to + +```toml +keywords = 'drone OR DJI OR Orqa' +antikeywords = 'Parrot OR Autel' +``` + +which means selecting listings that contains `drone` or `DJI` or `Orga` in title or description, but exclude those listings with `Parrot` or `Autel` in title or description. + +These criteria will however, not exclude listings for a `DJI Camera`. If you would like to make sure that `drone` is selected, you can use + +```toml +keywords = 'drone AND (DJI OR Orqa)' +antikeywords = 'Parrot OR Autel' +``` + +If you have special characters and spaces in your keywords, you will need to quote them, such as + +```toml +keywords = '("Go Pro" OR gopro) AND HERO' +``` + +**NOTE**: + +1. A list of logical operations are allowed, and they are assumed to be joint by `OR`. For example, `['gopro AND (11 or 12)', 'DJI AND OSMO']` searches for either a gopro version 11 or 12, or a DJI COMO camera. +2. You can construct very complex logical operations using `AND`, `OR` and `NOT`, but it is usually recommended to use simple keyword-based filtering and let AI handle more subtle selection criteria. + +### Searching multiple cities and regions + +`search_city` is the name, sometimes numbers, used by Facebook marketplace to represent a city. To get the value of `search_city` for your region, visit facebook marketplace, perform a search, and the city should be the name after `marketplace` (e.g. `XXXXX` in a URL like `https://www.facebook.com/marketplace/XXXXX/search?query=YYYY`). + +Multiple searches will be performed if multiple cities are provided to option `search_city`. You can also specify `seller_locations` to limit the location of sellers. These locations are names of cities as displayed on the listing pages. + +```toml +[item.name] +search_city = ['city1', 'city2'] +seller_locations = ['city1', 'city2', 'city3', 'city4'] +``` + +You can also increase the radius of search using + +```toml +[item.name] +search_city = ['city1', 'city2'] +radius = 50 +``` + +However, if you would like to search for a larger region (e.g. the USA), it is much easier to define `region`s with a list of `search_city` and large `radius`. + +_ai-marketplace-monitor_ defines the following regions in its system +[config.toml](https://github.com/BoPeng/ai-marketplace-monitor/blob/main/src/ai_marketplace_monitor/config.toml): + +- `usa` for USA (without AK or HI) +- `usa_full` for USA +- `can` for Canada +- `mex` for Mexico +- `bra` for Brazil +- `arg` for Argentina +- `aus` for Australia +- `aus_miles` for Australia using 500 miles radius +- `nzl` for New Zealand +- `ind` for India +- `gbr` for United Kingdom +- `fra` for France +- `spa` for Spain + +Now, if you would like to search an item across the US, you can + +```toml +[item.name] +search_region = 'usa' +seller_locations = [] +delivery_method = 'shipping' +``` + +Under the hood, _ai-marketplace-monitor_ will simply replace `search_region` with corresponding pre-defined `search_city` and `radius`. Note that `seller_locations` does not make sense and need to be set to empty for region-based search, and it makes sense to limit the search to listings that offer shipping. + +### Support for non-English languages + +_AI Marketplace Monitor_ relies on specific keywords from webpages to extract relevant information. For example, it looks for words following `Condition` to determine the condition of an item. If your account is set to another language, _AI Marketplace Monitor_ will be unable to extract the relevant information. That is to say, if you see rampant error messages like + +``` +Failed to get details of listing https://www.facebook.com/marketplace/item/12121212121212121212 +The listing might be missing key information (e.g. seller) or not in English. +Please add option language to your marketplace configuration is the latter is the case. +See https://github.com/BoPeng/ai-marketplace-monitor?tab=readme-ov-file#support-for-non-english-languages for details. +``` + +you will need to check `Setting -> Language` settings of your facebook account, +and let _AI Marketplace Monitor_ use the same language. + +Currently, _AI Marketplace Monitor_ supports the following languages + +- `es`: Spanish +- `zh`: Chinese + +If your language is not defined, you will need to define your own [`translation` section](docs/README.md#translators) in your configuration file, following a format used by existing translators defined in [config.toml](https://github.com/BoPeng/ai-marketplace-monitor/blob/main/src/ai_marketplace_monitor/config.toml). This can be done by + +1. Add a section to your configuration file, by copying one example from the system translators, for example, + +```toml +[translator.LAN] +locale = "Your REGION" +"About this vehicle" = "Descripción del vendedor" +"Seller's description" = "Información sobre este vehículo" +"Collection of Marketplace items" = "Colección de artículos de Marketplace" +"Condition" = "Estado" +"Details" = "Detalles" +"Location is approximate" = "La ubicación es aproximada" +"Description" = "Descripción" +``` + +2. Find example listings (from for example [here](https://github.com/BoPeng/ai-marketplace-monitor/issues/29#issuecomment-2632057196)), locate the relevant words, and update the section. You can switch between different langauges (Facebook -> Settings -> Language) and see the location of the English version. + +3. After you have completed the translation, add `language="LAN"` to the `marketplace` section as follows: + +```toml +[translation.LAN] +"Condition" = "Condition in your LAN" +"Details" = "Details in your LAN" +... +``` + +in your configuration file, then add `language="LAN"` to the `marketplace` section as follows: + +```toml +[marketplace.facebook] +language = "LAN" +``` + +It would be very helpful for other users of _AI Marketplace Monitor_ if you could contribute your dictionary to this project by creating a pull request or simply creating a ticket with your translations. + +### Check individual listing + +If you ever wonder why a listing was excluded, or just want to check a listing against your configuration, you can get the URL (or the item ID) of the listing, and run + +```sh +ai-marketplace-monitor --check your-url +``` + +If you have multiple items specified in your config file, _ai-marketplace-monitor_ will check the product against the configuration of all of them. If you know the _name_ of the item in your config file, you can let the program only check the configuration of this particular item. + +```sh +ai-marketplace-monitor --check your-url --for item_name +``` + +Option `--check` will load the details of the item from the cache if it was previously examined. Otherwise a browser will be started to retrieve the page. + +Another way to check individual IDs is to enter interactive mode when the _ai-marketplace-monitor_ is running. If you press `Esc`, then confirm with `c` when prompted, you can enter the `URL` and `item_name` interactively and check the URL. Enter `exit` to exit the interactive session after you are done. However, using this method requires OS to allow the program to monitor your keyboard. It would not work on a terminal accessed through SSH, and you have to allow the terminal that you use to run _ai-marketplace-monitor_ to monitor keyboard from the _Privacy and Security_ settings on MacOS. + +### Multiple marketplaces + +Although facebook is currently the only supported marketplace, you can create multiple marketplaces such as`marketplace.city1` and `marketplace.city2` with different options such as `search_city`, `search_region`, `seller_locations`, and `notify`. You will need to add options like `marketplace='city1'` in the items section to link these items to the right marketplace. + +For example + +```toml +[marketplace.facebook] +search_city = 'houston' +seller_locations = ['houston', 'sugarland'] + +[marketplace.nationwide] +search_region = 'usa' +seller_location = [] +delivery_method = 'shipping' + +[item.default_item] +search_phrases = 'local item for default market "facebook"' + +[item.rare_item1] +marketplace = 'nationwide' +search_phrases = 'rare item1' + +[item.rare_item2] +marketplace = 'nationwide' +search_phrases = 'rare item2' +``` + +If no `marketplace` is defined for an item, it will use the first defined marketplace, which is `houston` in this example. + +### First and subsequent searches + +A list of two values can be specified for options `rating`, `availability`, `date_listed`, and `delivery_method`, with the first one used for the first search, and second one used for the rest of searches. This allows the use of different search strategies for first and subsequent searches. For example, an initial more lenient search for all listings followed by searches for only new listings can be specified as + +``` +rating = [2, 4] +availability = ["all", "in"] +date_listed = ["all", "last 24 hours"] +``` + +### Showing statistics + +_ai-marketplace-monitor_ shows statistics such as the number of pages searched, number of listings examined and excluded, number of matching lists found and number of users notified when you exit the program. If you would like to see the statistics during monitoring, press `Esc` and wait till the current search to end. + +Counters are persistent across program runs. If you would like to reset the counters, use + +``` +ai-marketplace-monitor --clear-cache counters +``` + +### Self-hosted Ollama Model + +If you have access to a decent machine and prefer not to pay for AI services from OpenAI or other vendors. You can opt to install Ollama locally and access it using the `provider = "ollama"`. If you have ollama on your local host, you can use + +``` +[ai.ollama] +base_url = "http://localhost:11434/v1" +model = "deepseek-r1:14b" +timeout = 120 +``` + +Note that + +1. Depending on your hardware configuration, you can choose any of the models listed [here](https://ollama.com/search). The default model is `deepseek-r1:14b` becaue it appears to work better than `llama-3.1:8b`. +2. You need to `pull` the model before you can use it. + +### Cache Management + +_ai-marketplace-monitor_ caches listing details, ai inquiries, and user notifications to avoid repeated queries to marketplaces, AI services, and repeated notification. If for any reason you would like to clear the cache, you can use commands such as + +``` +ai-marketplace-monitor --clear-cache listing-details +``` + +to clear the cache. The following cache types are supported + +- `listing-details` +- `ai-inquiries` +- `user-notification` +- `counters` + +`--clear-cache all` is also possible but not recommended. + +### Support for different layouts of facebook listings + +Facebook marketplace supports a wide variety of products and use different layouts for them. _ai_marketplace_monitor_ can extract description from common listings such as household items and automobiles, but you may encounter items that this program cannot handle. + +Although I certainly do not have the bandwidth to support all possible layouts, I have listed detailed steps on how to debug and resolve the issue on [issue 29](https://github.com/BoPeng/ai-marketplace-monitor/issues/29). + +### Searching Anonymously with a Proxy Server + +You can search Facebook Marketplace anonymously by disabling login, + +- Do not provide a `username` or `password` in the `facebook` section +- (optional) Set `login_wait_time = 0` to stop waiting for login +- (optional) Use the `--headless` command line option to run `ai-marketplace-monitor` without a browser window. + +If you would like to use a proxy server, you can + +- Sign up for a VPN or proxy service. +- Configure the proxy settings in the `monitor` section of your configuration file as follows + +```toml +[monitor] +proxy_server = '${PROXY_SERVER}' +proxy_username = '${PROXY_USERNAME}' +proxy_password = '${PROXY_PASSWORD}' +``` + +Replace `${PROXY_SERVER}`, `${PROXY_USERNAME}`, and `${PROXY_PASSWORD}` with your proxy service details, or setting the corresponding environment variables. + +## Contributing + +Contributions are welcome! Here are some ways you can contribute: + +- 🐛 Report bugs and issues +- 💡 Suggest new features +- 🔧 Submit pull requests +- 📚 Improve documentation +- 🏪 Add support for new marketplaces +- 🌍 Add support for new regions and languages +- 🤖 Add support for new AI providers +- 📱 Add new notification methods + +Please read our [Contributing Guidelines](CONTRIBUTING.md) before submitting a Pull Request. + +## License + +This project is licensed under the **Affero General Public License (AGPL)**. For the full terms and conditions, please refer to the official [GNU AGPL v3](https://www.gnu.org/licenses/agpl-3.0.en.html). + +## Support + +We provide multiple ways to access support and contribute to AI Marketplace Monitor: + +- 📖 [Documentation](https://github.com/BoPeng/ai-marketplace-monitor/blob/main/docs/README.md) Explore comprehensive guides and instructions. +- 🤝 [Discussions](https://github.com/BoPeng/ai-marketplace-monitor/discussions): Connect with the community, ask questions, and exchange ideas. +- 🐛 [Issues](https://github.com/BoPeng/ai-marketplace-monitor/issues): Report bugs or suggest new features to help improve the project. +- 💖 [Become a sponsor](https://github.com/sponsors/BoPeng): Support the development and maintenance of this tool. Any contribution, no matter how small, is deeply appreciated. +- 💰 [Donate via PayPal](https://www.paypal.com/donate/?hosted_button_id=3WT5JPQ2793BN): Prefer private support? Consider donating via PayPal. + +**Important Note:** + +Due to time constraints, answering individual inquiries about _AI Marketplace Monitor_ on a one-on-one basis is not scalable. While I enjoy engaging on platforms like Reddit, GitHub, and email, I am generally unable to respond to personal emails or direct messages unless: + +- You are a sponsor or donor. +- Your inquiry is related to business opportunities. + +I greatly appreciate your understanding. To help expedite responses, please remember to mention your **sponsor or donation status** when contacting me. + +## Credits + +- Some of the code was copied from [facebook-marketplace-scraper](https://github.com/passivebot/facebook-marketplace-scraper). +- Region definitions were copied from [facebook-marketplace-nationwide](https://github.com/gmoz22/facebook-marketplace-nationwide/), which is released under an MIT license as of Jan 2025. +- This package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [cookiecutter-modern-pypackage](https://github.com/fedejaure/cookiecutter-modern-pypackage) project template. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..874a1d5 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,29 @@ +# Security Policy + +We takes the security of our software products seriously. + +If you believe you have found a security vulnerability, please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Report security vulnerabilities by emailing the lead maintainer at email. + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Preferred Languages + +We prefer all communications to be in English. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..57c07c4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +coverage: + status: + project: + default: + target: "100" + patch: + default: + target: "100" +comment: + require_changes: true diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..56298b2 --- /dev/null +++ b/conftest.py @@ -0,0 +1,150 @@ +import shutil +import tempfile +from typing import Callable, Generator + +import pytest +from diskcache import Cache +from pytest import TempPathFactory + +import ai_marketplace_monitor +from ai_marketplace_monitor.ai import ( + AIResponse, # type: ignore + OllamaBackend, + OllamaConfig, +) +from ai_marketplace_monitor.facebook import FacebookItemConfig, FacebookMarketplaceConfig +from ai_marketplace_monitor.listing import Listing +from ai_marketplace_monitor.user import User, UserConfig + + +@pytest.fixture +def version() -> Generator[str, None, None]: + """Sample pytest fixture.""" + yield ai_marketplace_monitor.__version__ + + +@pytest.fixture +def listing() -> Listing: + return Listing( + marketplace="facebook", + name="test", + id="111", + title="dddd", + image="", + price="$10", + post_url="https://www.facebook.com/marketplace/item/1234567890", + location="houston, tx", + seller="some guy", + condition="New", + description="something good", + ) + + +@pytest.fixture +def marketplace_config() -> FacebookMarketplaceConfig: + return FacebookMarketplaceConfig( + name="facebook", + username="XXXXXXXX", + password="XXXXXXXX", + login_wait_time=10, + seller_locations=["city"], + search_city=["houston"], + availability=["all"], + condition=["new", "used_good"], + date_listed=[7], + delivery_method=["local_pick_up"], + exclude_sellers=["seller"], + max_search_interval=1000, + search_interval=12, + notify=["user1"], + radius=[100], + search_region=["usa"], + ) + + +@pytest.fixture +def item_config() -> FacebookItemConfig: + return FacebookItemConfig( + name="test", + description="long description", + enabled=True, + antikeywords=["exclude1", "exclude2"], + keywords=["include1", "include2"], + search_phrases=["search word one"], + marketplace="facebook", + search_city=["houston"], + # the following are common options + seller_locations=["city"], + condition=["new", "used_good"], + date_listed=[7], + ai=["openai"], + availability=["out", "all"], + delivery_method=["local_pick_up"], + exclude_sellers=["seller"], + max_price=300, + rating=[4], + max_search_interval=1000, + search_interval=12, + min_price=200, + notify=["user1"], + radius=[100], + search_region=["usa"], + ) + + +@pytest.fixture +def ollama_config() -> OllamaConfig: + return OllamaConfig( + name="ollama", + api_key="ollama", + provider="ollama", + base_url="http://localhost:11434/v1", + model="llama3.1:8b", + max_retries=10, + ) + + +@pytest.fixture(scope="session") +def config_file(tmp_path_factory: TempPathFactory) -> Callable: + def generate_config_file(content: str) -> str: + fn = tmp_path_factory.mktemp("config") / "test.toml" + with open(fn, "w") as f: + f.write(content) + return str(fn) + + return generate_config_file + + +@pytest.fixture +def temp_cache() -> Generator[Cache, None, None]: + temp_dir = tempfile.mkdtemp() + cache = Cache(temp_dir) + yield cache + cache.close() + shutil.rmtree(temp_dir) + + +@pytest.fixture +def user_config() -> UserConfig: + return UserConfig( + name="test", + pushbullet_token="whatever", + max_retries=1, + retry_delay=1, + remind=True, + ) + + +@pytest.fixture +def user(user_config: UserConfig) -> User: + return User(user_config) + + +@pytest.fixture +def ollama(ollama_config: OllamaConfig) -> User: + return OllamaBackend(ollama_config) + + +@pytest.fixture +def ai_response() -> AIResponse: + return AIResponse(score=4, comment="good") diff --git a/docs/AIMM_dark.png b/docs/AIMM_dark.png new file mode 100644 index 0000000..af4ae0a Binary files /dev/null and b/docs/AIMM_dark.png differ diff --git a/docs/AIMM_light.png b/docs/AIMM_light.png new file mode 100644 index 0000000..62c3d6f Binary files /dev/null and b/docs/AIMM_light.png differ diff --git a/docs/AIMM_neutral.png b/docs/AIMM_neutral.png new file mode 100644 index 0000000..d2b2449 Binary files /dev/null and b/docs/AIMM_neutral.png differ diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..7039f52 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,325 @@ +# Configuration Guide + +**Table of content:** + +- [AI Services](#ai-services) +- [Marketplaces](#marketplaces) +- [Users](#users) +- [Notification](#notification) +- [Email notification](#email-notification) +- [Items to search](#items-to-search) +- [Common item and marketplace options](#common-item-and-marketplace-options) +- [Regions](#regions) +- [Translators](#translators) +- [Monitor Configuration](#monitor-configuration) +- [Additional options](#additional-options) + +The AI Marketplace Monitor uses [TOML](https://toml.io/en/) configuration files to control its behavior. The system will always check for a configuration file at `~/.ai-marketplace-monitor/config.toml`. You can specify additional configuration files using the `--config` option. + +To avoid including sensitive information directly in the configuration file, all options that accept a string or a list of string can be specified using the `${ENV_VAR}` format. For example + +```toml +[marketplace.facebook] +password = '${FACEBOOK_PASSWORD}' + +[user.me] +email = ['${EMAIL_1}', '${EMAIL_2}'] +pushbullet_token = '${PUSBULLET_TOKEN}' +``` + +_AI Marketplace Monitor_ will retrieve the value from the corresponding environment variable and raise an error if the environment variable does not exist. + +Here is a complete list of options that are acceptable by the program. [`example_config.toml`](example_config.toml) provides an example with many of the options. + +### AI Services + +One of more sections to list the AI agent that can be used to judge if listings match your selection criteria. The options should have header such as `[ai.openai]` or `[ai.deepseek]`, and have the following keys: + +| Option | Requirement | DataType | Description | +| ------------- | ----------- | -------- | ---------------------------------------------------------- | +| `provider` | Optional | String | Name of the AI service provider. | +| `api-key` | Optional | String | A program token to access the RESTful API. | +| `base_url` | Optional | String | URL for the RESTful API | +| `model` | Optional | String | Language model to be used. | +| `max_retries` | Optional | Integer | Max retry attempts if connection fails. Default to 10. | +| `timeout` | Optional | Integer | Timeout (in seconds) waiting for response from AI service. | + +Note that: + +1. `provider` can be [OpenAI](https://openai.com/), + [DeepSeek](https://www.deepseek.com/), or [Ollama](https://ollama.com/). The name of the ai service will be used if this option is not specified so `OpenAI` will be used for section `ai.openai`. +2. [OpenAI](https://openai.com/) and [DeepSeek](https://www.deepseek.com/) models sets default `base_url` and `model` for these providers. +3. Ollama models require `base_url`. A default model is set to `deepseek-r1:14b`, which seems to be good enough for this application. You can of course try [other models](https://ollama.com/library) by setting the `model` option. +4. Although only three providers are supported, you can use any other service provider with `OpenAI`-compatible API using customized `base_url`, `model`, and `api-key`. +5. You can use option `ai` to list the AI services for particular marketplaces or items. + +A typical section for OpenAI looks like + +```toml +[ai.openai] +api_key = 'sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +``` + +### Marketplaces + +One or more sections `marketplace.name` show the options for interacting with various marketplaces. + +| Option | Requirement | DataType | Description | +| ------------------ | ----------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| `market_type` | Optional | String | The supported marketplace. Currently, only `facebook` is supported. | +| `username` | Optional | String | Username can be entered manually or kept in the config file. | +| `password` | Optional | String | Password can be entered manually or kept in the config file. | +| `login_wait_time` | Optional | Integer | Time (in seconds) to wait before searching to allow enough time to enter CAPTCHA. Defaults to 60. | +| `language` | Optional | String | Language for webpages | +| **Common options** | | | Options listed in the [Common options](#common-options) section below that provide default values for all items. | + +1. Multiple marketplaces with different `name`s can be specified for different `item`s (see [Multiple marketplaces](../README.md#multiple-marketplaces)). However, because the default `marketplace` for all items are `facebook`, it is easiest to define a default marketplace called `marketplace.facebook`. +2. If `language="LAN"` is specified, it must match to one of `translation` sections, defined by yourself or in the system configuration file. The system will try exact match (e.g. `es` to `es` or `zh_CN` to `zh_CN`), then partial match (e.g. `es` to `es_CO` or `es_CO` to `es`). +3. Please see [Support for non-English languages](../README.md#support-for-non-english-languages) on how to set this option and define your own translations. + +### Users + +One or more `user.username` sections can be defined in the configuration. The `username` one of the usernames listed in the `notify` option of `marketplace` or `item`. Each `user` section accepts the following options + +| Option | Requirement | DataType | Description | +| ------------- | ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `notify_with` | Optional | String/List | Specifies one or more notification methods to be used for this user. If left unspecified, all available notification methods will be used. | +| `remind` | Optional | String | Enables repeated notifications for the user after a specified duration (e.g., 3 days) if a listing remains active. By default, users are notified only once. | + +Note that + +1. **Default Notification Behavior**: If the `notify_with` option is not specified, the system will use all available notification methods for the user. +2. **Inline Notification Settings**: Notification settings can be defined directly under the user section. Any settings described in the [Notification](#notification) section can be applied to a user's configuration. +3. **Repeated Notifications**: The `remind` option allows users to receive repeated notifications after a specified time interval. If not set, users will only be notified once about a listing. + +### Notification + +_AI Marketplace Monitor_ supports various notification methods, allowing you to configure notifications in a flexible way. You can define notification settings directly within the `user` sections or create dedicated `notification.NAME` sections and reference them using the `notify_with` option. This provides flexibility for single-user setups or shared configurations across multiple users. + +#### Direct Notification Settings in User Sections + +Define notification details directly within the user section. This approach is ideal for single-user configurations. + +```toml +[user.me] +pushbullet_token = "xxxxxxxxxxxxxxxx" +email = 'myemail@gmail.com' +smtp_password = 'abcdefghijklmnop' +``` + +#### Shared Notification Settings in Dedicated Sections + +Define notification methods in their own `notification.NAME` sections and reference them using the notify_with option. This approach is better for sharing settings across multiple users. + +```toml +[user.me] +email = 'myemail@gmail.com' +notify_with = ['gmail', 'pushbullet'] + +[user.other] +email = 'other.email@gmail.com' +notify_with = ['gmail'] + +[notification.gmail] +smtp_password = 'abcdefghijklmnop' + +[notification.pushbullet] +pushbullet_token = "xxxxxxxxxxxxxxxx" +``` + +Note that: + +1. Under the hood, _AI Marketplace Monitor_ merges all notification options into the user section. This allows you to share partial settings across users (e.g. `smtp_password`) while customizing specific details (e.g. `email`). +2. If `notify_with` is not specified, the system will automatically include all notification settings for the user, so the `notify_with` option for `user.me` could be ignored. +3. AI Marketplace Monitor does not support multiple notifications of the same type for a single user. For example, the following configuration is not supported: + +```toml +[user.me] +notify_with = ['pushbullet1', 'pushbullet2'] +``` + +If you need to send notifications through multiple instances of the same type (e.g., multiple Pushbullet tokens), you must create separate users for each instance. For example: + +```toml +[user.me] +notify_with = 'pushbullet1' + +[user.other] +notify_with = 'pushbullet2' + +[notification.pushbullet1] +pushbullet_token = "xxxxxxxxxxxxxxxx" + +[notification.pushbullet2] +pushbullet_token = "yyyyyyyyyyyyyyyy" +``` + +#### Common Notification settings + +| Option | Requirement | DataType | Description | +| ------------- | ----------- | -------- | ----------------------------------------------------------------- | +| `max_retries` | Optional | Integer | Number of attempts to retry a notification. Defaults to `5`. | +| `retry_delay` | Optional | Integer | Time in seconds to wait between retry attempts. Defaults to `60`. | + +These settings are shared across all notification methods. For example, if you are notifying with `notify_with=['gmail', 'pushbullet']`, the same `max_retries` and `retry_delay` will apply to both methods. + +#### Pushbullet notification + +| Option | Requirement | DataType | Description | +| ------------------------- | ----------- | -------- | ----------------------------- | +| `pushbullet_token` | Optional | String | Token for user. | +| `pushbullet_proxy_type` | Optional | String | HTTP proxy type, e.g. `https` | +| `pushbullet_proxy_server` | Optional | String | HTTP proxy server URL | + +Please refer to [PushBullet documentation](https://github.com/richard-better/pushbullet.py/blob/master/readme-old.md) for details on the use of a proxy server for pushbullet. + +#### Pushover notification + +| Option | Requirement | DataType | Description | +| -------------------- | ----------- | -------- | ------------------- | +| `pushover_user_id` | Optional | String | Pushover user key. | +| `pushover_api_token` | Optional | String | Pushover API Token. | + +#### Pushover notification + +| Option | Requirement | DataType | Description | +| ---------------- | ----------- | -------- | ------------------------------------------------- | +| `ntfy_server` | Optional | String | ntfy server, default to `https://ntfy.sh` | +| `ntfy_topic` | Optional | String | A unique topic to receive your notification. | +| `message_format` | Optional | String | Format notification as `plain_text` or `markdown` | + +- According to [ntfy documentation](https://docs.ntfy.sh/publish/#markdown-formatting), markdown format is supported only by web app. Therefore, `message_format` is by default set to `plain_text`. + +### Email notification + +| Option | Requirement | DataType | Description | +| --------------- | ----------- | ----------- | ------------------------------------------------------- | +| `email` | Optional | String/List | One or more email addresses for email notifications | +| `smtp_username` | Optional | String | SMTP username. | +| `smtp_password` | Required | String | A password or passcode for the SMTP server. | +| `smtp_server` | Optional | String | SMTP server, usually guessed from sender email address. | +| `smtp_port` | Optional | Integer | SMTP port, default to `587` | + +Note that + +1. We provide default `smtp_server` and `smtp_port` values for popular SMTP service providers. +2. `smtp_username` is assumed to be the first `email`. + +See [Setting up email notification](../README.md#setting-up-email-notification) for details on how to set up email notification. + +### Items to search + +One or more `item.item_name` where `item_name` is the name of the item. + +| Option | Requirement | DataType | Description | +| ------------------ | ----------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `search_phrases` | Required | String/List | One or more strings for searching the item. | +| `description` | Optional | String | A longer description of the item that better describes your requirements (e.g., manufacture, condition, location, seller reputation, shipping options). Only used if AI assistance is enabled. | +| `keywords` | Optional | String/List | Excludes listings whose titles and description do not contain any of the keywords. | +| `antikeywords` | Optional | String/List | Excludes listings whose titles or descriptions contain any of the specified keywords. | +| `marketplace` | Optional | String | Name of the marketplace, default to `facebook` that points to a `marketplace.facebook` sectiion. | +| **Common options** | | | Options listed below. These options, if specified in the item section, will override options in the marketplace section. | + +Marketplaces may return listings that are completely unrelated to search search_phrases, but can also +return related items under different names. To select the right items, you can + +1. Use `keywords` to keep only items with certain words in the title. For example, you can set `keywords = ['gopro', 'go pro']` when you search for `search_phrases = 'gopro'`. +2. Use `antikeywords` to narrow down the search. For example, setting `antikeywords=['HERO 4']` will exclude items with `HERO 4` or `hero 4`in the title or description. +3. The `keywords` and `antikeywords` options allows the specification of multiple keywords with a `OR` relationship, but it also allows complex `AND`, `OR` and `NOT` logics. See [Advanced Keyword-based filters](../README.md#advanced-keyword-based-filters) for details. +4. It is usually more effective to write a longer `description` and let the AI know what exactly you want. This will make sure that you will not get a drone when you are looking for a `DJI` camera. It is still a good idea to pre-filter listings using non-AI criteria to reduce the cost of AI services. + +### Common item and marketplace options + +The following options that can specified for both `marketplace` sections and `item` sections. Values in the `item` section will override value in corresponding marketplace if specified in both places. + +| `Parameter` | Required/Optional | Datatype | Description | +| --------------------- | ----------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `availability` | Optional | String/List | Shows output with `in` (in stock), `out` (out of stock), or `all` (both). | +| `condition` | Optional | String/List | One or more of `new`, `used_like_new`, `used_good`, and `used_fair`. | +| `date_listed` | Optional | String/Integer/List | One of `all`, `last 24 hours`, `last 7 days`, `last 30 days`, or `0`, `1`, `7`, and `30`. | +| `delivery_method` | Optional | String/List | One of `all`, `local_pick_up`, and `shipping`. | +| `exclude_sellers` | Optional | String/List | Exclude certain sellers by their names (not username). | +| `max_price` | Optional | Integer | Maximum price. | +| `max_search_interval` | Optional | String | Maximum interval in seconds between searches. If specified, a random time will be chosen between `search_interval` and `max_search_interval`. | +| `min_price` | Optional | Integer | Minimum price. | +| `notify` | Optional | String/List | Users who should be notified. | +| `ai` | Optional | String/List | AI services to use, default to all specified services. `ai=[]` will disable ai. | +| `city_name` | Optional | String/List | Corresponding name of `search_city`. | +| `radius` | Optional | Integer/List | Radius of search, can be a list if multiple `search_city` are specified. | +| `prompt` | Optional | String | Prompt to AI service that will replace the default prompt | +| `extra_prompt` | Optional | String | Additional prompt that will be inserted between regular and rating prompt | +| `ranking_prompt` | Optional | String | Ranking prompt that instruct how AI rates the listings | +| `rating` | Optional | Integer/List | Notify users with listings with rating at or higher than specified rating. | +| `search_city` | Required | String/List | One or more search cities, obtained from the URL of your search query. Required for marketplace or item if `search_region` is unspecified. | +| `search_interval` | Optional | String | Minimal interval between searches, should be specified in formats such as `1d`, `5h`, or `1h 30m`. | +| `search_region` | Optional | String/List | Search over multiple locations to cover an entire region. `regions` should be one or more pre-defined regions or regions defined in the configuration file. | +| `seller_locations` | Optional | String/List | Only allow searched items from these locations. | +| `start_at` | Optional | String/List | Time to start the search. Overrides `search_interval`. | + +Note that + +1. `search_city` can be found from the URL that facebook uses to search your region. For example, if the URL for your facebook search is `https://www.facebook.com/marketplace/sanfrancisco/search?query=go%20pro%2011%20deal%20site`, the `search_city` is `sanfrancisco`. This name is not necessarily the name of your city, especially for non-US cities, and you can search multiple cities or an entire region. See [Searching multiple cities and regions](../README.md#searching-multiple-cities-and-regions) for details. +2. If `notify` is not specified for both `item` and `marketplace`, all listed users will be notified. +3. `prompt`, `extra_prompt`, `rating_prompt`, and `rating` are used to adjust how to interact with an AI service. See [Adjust prompt and notification level](../README.md#adjust-prompt-and-notification-level) for details. +4. `start_at` supports one or more of the following values:
- `HH:MM:SS` or `HH:MM` for every day at `HH:MM:SS` or `HH:MM:00`
- `*:MM:SS` or `*:MM` for every hour at `MM:SS` or `MM:00`
- `*:*:SS` for every minute at `SS`. +5. A list of two values can be specified for options `rating`, `availability`, `delivery_method`, and `date_listed`. See [First and subsequent searches](../README.md#first-and-subsequent-searches) for details. + +### Regions + +One or more sections of `[region.region_name]`, which defines regions to search. Multiple searches will be performed for multiple cities to cover entire regions. + +| Parameter | Required/Optional | Data Type | Description | +| ------------- | ----------------- | ------------ | --------------------------------------------------------------------------- | +| `search_city` | Required | String/List | One or more cities with names used by Facebook. | +| `full_name` | Optional | String | A display name for the region. | +| `radius` | Optional | Integer/List | Recommended `805` for regions using kms, and `500` for regions using miles. | +| `city_name` | Optional | String/List | Corresponding names for `search_city`. | + +Note that + +1. `radius` has a default value of `500` (miles). You can specify different `radius` for different `search_city`. +2. Options `full_name` and `city_name` are for documentation and logging purposes only. + +### Translators + +A translator contains a list of word mappings that translate English words to corresponding words in another language. They are used by _AI Marketplace Monitor_ to extract information from webpages in non-English languages. + +This section currently accept the following values for Facebook Marketplace. + +| Parameter | Required/Optional | Data Type | Description | +| --------------------------------- | ----------------- | --------- | ---------------------------------------------------------- | +| `locale` | Required | String | locale of the translation | +| `Collection of Marketplace items` | Optional | String | The "arial-label" for search results. | +| `Condition` | Optional | String | Subtitle "condition" of an listing item. | +| `Description` | Optional | String | Title "description" for a rental item. | +| `Details` | Optional | String | Subtitle "Details" of an listing item. | +| `Location is approximate` | Optional | String | The word below listing location. | +| `About this vehicle` | Optional | String | The "About this vehicle" section of an automobile listing. | +| `Seller's description` | Optional | String | The "Seller's description" of an automobile listing. | + +Note that not all words needs to be translated (the English version will be used if unspecified), and _AI Marketplace Monitor_ may be able to extract information using language-independent methods. + +Please see [Support for non-English languages](../README.md#support-for-non-english-languages) + +### Monitor Configuration + +The optional `monitor` section allows you to define system configurations for the _AI Marketplace Monitor_. It supports options for sending your queries through one or more proxy servers, which can hide your IP address and reduce the chances of your IP being blocked. + +| Option | Requirement | DataType | Description | +| ---------------- | ----------- | ----------- | ---------------------------------------- | +| `proxy_server` | Optional | String/List | URL for one or more proxy servers. | +| `proxy_bypass` | Optional | String | Comma-separated domains to bypass proxy. | +| `proxy_username` | Optional | String | username for the proxy. | +| `proxy_password` | Optional | String | password for the proxy. | + +- If multiple `proxy_server` URLs are specified as a list, a random one will be chosen each time. However, the proxy will not change while the _AI Marketplace Monitor_ is running. + +### Additional options + +All sections, namely `ai`, `marketplace`, `user`, `smtp`, and `region`, accepts an option `enabled`, which, if set to `false` will disable the corresponding AI service, +marketplace, SMTP server, and stop notifying corresponding user. This option works like a `comment` statement that comments out the entire sections, which allowing the +sections to be referred from elsewhere (e.g. `notify` a disable user is allowed but notification will not be sent.) + +| Parameter | Required/Optional | Data Type | Description | +| --------- | ----------------- | --------- | ------------------------------------------------------ | +| `enabled` | Optional | Boolean | Disable corresponding configuration if set to `false`. | diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..0d98645 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1 @@ +.logo a { overflow-wrap: normal } diff --git a/docs/changelog.md b/docs/changelog.md new file mode 120000 index 0000000..04c99a5 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..80c32bb --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,73 @@ +"""Sphinx configuration.""" + +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + + +# If extensions (or modules to document with autodoc) are in another +# directory, add these directories to sys.path here. If the directory is +# relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. +import ai_marketplace_monitor + +# -- Project information ----------------------------------------------------- + +# General information about the project. +project = "ai-marketplace-monitor" +copyright = "2025, Bo Peng" # noqa: A001 +author = "Bo Peng" +# The version info for the project you're documenting, acts as replacement +# for |version| and |release|, also used in various other places throughout +# the built documents. +# +# The short X.Y version. +version = ai_marketplace_monitor.__version__ +# The full version, including alpha/beta/rc tags. +release = ai_marketplace_monitor.__version__ + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "recommonmark", +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "github_user": "BoPeng", + "github_repo": "ai-marketplace-monitor", + "github_banner": True, + "show_related": False, + "fixed_sidebar": True, +} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] diff --git a/docs/example_config.toml b/docs/example_config.toml new file mode 100644 index 0000000..8a56c09 --- /dev/null +++ b/docs/example_config.toml @@ -0,0 +1,60 @@ +# +# AI +# +[ai.openai] +api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +model = "gpt-4o" + +# +# Marketplace +# +[marketplace.facebook] +search_city = 'city' +username = 'username' +password = 'password' +login_wait_time = 60 +search_interval = '30m' +max_search_interval = '1h' +seller_locations = ['city', 'surrounding city'] +notify = 'user1' +exclude_sellers = [] + +# +# Users and Notifications +# +[user.user1] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +email = 'myself@gmail.com' +notify_with = ['gmail', 'pushover'] + +[user.user2] +email = 'user2@gmail.com' +notify_with = 'gmail' + +[notification.pushover] +pushover_user_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +pushover_api_token = 'someone@gmail.com' + +[notification.gmail] +smtp_username = 'myself@gmail.com' +smtp_password = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + +# +# Items to search +# +[item.name1] +search_phrases = 'search word one' +search_region = 'usa' +search_interval = '1d' +delivery_method = 'shipping' +seller_locations = [] + +[item.name2] +search_phrases = ['search word one', 'search word two'] +description = "it should be from manufacture, the seller should not offer shipping." +keywords = ['search word'] +antikeywords = ['exclude word one', 'exclude word two'] +notify = 'user2' +search_city = 'another city' +seller_locations = ['another city', 'surrounding city'] +exclude_sellers = [] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..d44edc9 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,22 @@ +Welcome to AI Marketplace Monitor's documentation! +=========================================================== + +.. toctree:: + :maxdepth: 2 + + readme + installation + usage + modules + changelog + +Indices and tables +================== +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +.. toctree:: + :hidden: + + License diff --git a/docs/installation.rst b/docs/installation.rst new file mode 100644 index 0000000..18655db --- /dev/null +++ b/docs/installation.rst @@ -0,0 +1,23 @@ +.. highlight:: shell + +============ +Installation +============ + + +Stable release +-------------- + +To install ai-marketplace-monitor, run this command in your terminal: + +.. code-block:: console + + $ pip install ai-marketplace-monitor + +This is the preferred method to install ai-marketplace-monitor, as it will always install the most recent stable release. + +If you don't have `pip`_ installed, this `Python installation guide`_ can guide +you through the process. + +.. _pip: https://pip.pypa.io +.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ diff --git a/docs/license.rst b/docs/license.rst new file mode 120000 index 0000000..19cdae7 --- /dev/null +++ b/docs/license.rst @@ -0,0 +1 @@ +../LICENSE.rst \ No newline at end of file diff --git a/docs/minimal_config.toml b/docs/minimal_config.toml new file mode 100644 index 0000000..7ed19df --- /dev/null +++ b/docs/minimal_config.toml @@ -0,0 +1,9 @@ +[marketplace.facebook] +username = 'username@gmail.com' +search_city = 'houston' + +[item.name1] +search_phrases = 'search word one' + +[user.user1] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..7a968eb --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx==8.2.3 +recommonmark==0.7.1 diff --git a/docs/search_in_action.png b/docs/search_in_action.png new file mode 100644 index 0000000..800ad11 Binary files /dev/null and b/docs/search_in_action.png differ diff --git a/docs/usage.rst b/docs/usage.rst new file mode 100644 index 0000000..8ee2aaa --- /dev/null +++ b/docs/usage.rst @@ -0,0 +1,7 @@ +===== +Usage +===== + +To use ai-marketplace-monitor in a project:: + + import ai_marketplace_monitor diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..1859732 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,52 @@ +"""Nox sessions.""" + +import platform + +import nox +from nox_poetry import Session, session + +nox.options.sessions = ["tests", "mypy"] +python_versions = ["3.10", "3.11", "3.12"] + + +@session(python=python_versions) +def tests(session: Session) -> None: + """Run the test suite.""" + session.install(".") + session.install( + "invoke", "pytest", "xdoctest", "coverage[toml]", "pytest-cov", "pytest-playwright" + ) + try: + session.run( + "inv", + "tests", + env={ + "COVERAGE_FILE": f".coverage.{platform.system()}.{platform.python_version()}", + }, + ) + finally: + if session.interactive: + session.notify("coverage") + + +@session(python=python_versions) +def coverage(session: Session) -> None: + """Produce the coverage report.""" + args = session.posargs if session.posargs and len(session._runner.manifest) == 1 else [] + session.install("invoke", "coverage[toml]") + session.run("inv", "coverage", *args) + + +@session(python=python_versions) +def mypy(session: Session) -> None: + """Type-check using mypy.""" + session.install(".") + session.install("invoke", "mypy") + session.run("inv", "mypy") + + +@session(python="3.12") +def security(session: Session) -> None: + """Scan dependencies for insecure packages.""" + session.install("invoke", "safety") + session.run("inv", "security") diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..d127144 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,2716 @@ +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. + +[[package]] +name = "alabaster" +version = "1.0.0" +description = "A light, configurable Sphinx theme" +optional = false +python-versions = ">=3.10" +files = [ + {file = "alabaster-1.0.0-py3-none-any.whl", hash = "sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b"}, + {file = "alabaster-1.0.0.tar.gz", hash = "sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e"}, +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + +[[package]] +name = "anyio" +version = "4.8.0" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.9" +files = [ + {file = "anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a"}, + {file = "anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} + +[package.extras] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx_rtd_theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "authlib" +version = "1.5.1" +description = "The ultimate Python library in building OAuth and OpenID Connect servers and clients." +optional = false +python-versions = ">=3.9" +files = [ + {file = "authlib-1.5.1-py2.py3-none-any.whl", hash = "sha256:8408861cbd9b4ea2ff759b00b6f02fd7d81ac5a56d0b2b22c08606c6049aae11"}, + {file = "authlib-1.5.1.tar.gz", hash = "sha256:5cbc85ecb0667312c1cdc2f9095680bb735883b123fb509fde1e65b1c5df972e"}, +] + +[package.dependencies] +cryptography = "*" + +[[package]] +name = "babel" +version = "2.17.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.8" +files = [ + {file = "babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2"}, + {file = "babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d"}, +] + +[package.extras] +dev = ["backports.zoneinfo", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata"] + +[[package]] +name = "black" +version = "25.1.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.9" +files = [ + {file = "black-25.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:759e7ec1e050a15f89b770cefbf91ebee8917aac5c20483bc2d80a6c3a04df32"}, + {file = "black-25.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e519ecf93120f34243e6b0054db49c00a35f84f195d5bce7e9f5cfc578fc2da"}, + {file = "black-25.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:055e59b198df7ac0b7efca5ad7ff2516bca343276c466be72eb04a3bcc1f82d7"}, + {file = "black-25.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:db8ea9917d6f8fc62abd90d944920d95e73c83a5ee3383493e35d271aca872e9"}, + {file = "black-25.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a39337598244de4bae26475f77dda852ea00a93bd4c728e09eacd827ec929df0"}, + {file = "black-25.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96c1c7cd856bba8e20094e36e0f948718dc688dba4a9d78c3adde52b9e6c2299"}, + {file = "black-25.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bce2e264d59c91e52d8000d507eb20a9aca4a778731a08cfff7e5ac4a4bb7096"}, + {file = "black-25.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:172b1dbff09f86ce6f4eb8edf9dede08b1fce58ba194c87d7a4f1a5aa2f5b3c2"}, + {file = "black-25.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4b60580e829091e6f9238c848ea6750efed72140b91b048770b64e74fe04908b"}, + {file = "black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e2978f6df243b155ef5fa7e558a43037c3079093ed5d10fd84c43900f2d8ecc"}, + {file = "black-25.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b48735872ec535027d979e8dcb20bf4f70b5ac75a8ea99f127c106a7d7aba9f"}, + {file = "black-25.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:ea0213189960bda9cf99be5b8c8ce66bb054af5e9e861249cd23471bd7b0b3ba"}, + {file = "black-25.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f0b18a02996a836cc9c9c78e5babec10930862827b1b724ddfe98ccf2f2fe4f"}, + {file = "black-25.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:afebb7098bfbc70037a053b91ae8437c3857482d3a690fefc03e9ff7aa9a5fd3"}, + {file = "black-25.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:030b9759066a4ee5e5aca28c3c77f9c64789cdd4de8ac1df642c40b708be6171"}, + {file = "black-25.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:a22f402b410566e2d1c950708c77ebf5ebd5d0d88a6a2e87c86d9fb48afa0d18"}, + {file = "black-25.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a1ee0a0c330f7b5130ce0caed9936a904793576ef4d2b98c40835d6a65afa6a0"}, + {file = "black-25.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3df5f1bf91d36002b0a75389ca8663510cf0531cca8aa5c1ef695b46d98655f"}, + {file = "black-25.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9e6827d563a2c820772b32ce8a42828dc6790f095f441beef18f96aa6f8294e"}, + {file = "black-25.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:bacabb307dca5ebaf9c118d2d2f6903da0d62c9faa82bd21a33eecc319559355"}, + {file = "black-25.1.0-py3-none-any.whl", hash = "sha256:95e8176dae143ba9097f351d174fdaf0ccd29efb414b362ae3fd72bf0f710717"}, + {file = "black-25.1.0.tar.gz", hash = "sha256:33496d5cd1222ad73391352b4ae8da15253c5de89b93a80b3e2c8d9a19ec2666"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.10)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "bump2version" +version = "1.0.1" +description = "Version-bump your software with a single command!" +optional = false +python-versions = ">=3.5" +files = [ + {file = "bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410"}, + {file = "bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6"}, +] + +[[package]] +name = "certifi" +version = "2025.1.31" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, + {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, +] + +[[package]] +name = "cffi" +version = "1.17.1" +description = "Foreign Function Interface for Python calling C code." +optional = false +python-versions = ">=3.8" +files = [ + {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be"}, + {file = "cffi-1.17.1-cp310-cp310-win32.whl", hash = "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c"}, + {file = "cffi-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b"}, + {file = "cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655"}, + {file = "cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8"}, + {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, + {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, + {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, + {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, + {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, + {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, + {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, + {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, + {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, + {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, +] + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "cfgv" +version = "3.4.0" +description = "Validate configuration and produce human readable error messages." +optional = false +python-versions = ">=3.8" +files = [ + {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, + {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.1" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7" +files = [ + {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"}, + {file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"}, + {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, +] + +[[package]] +name = "click" +version = "8.1.8" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, + {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "commonmark" +version = "0.9.1" +description = "Python parser for the CommonMark Markdown spec" +optional = false +python-versions = "*" +files = [ + {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, + {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, +] + +[package.extras] +test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] + +[[package]] +name = "coverage" +version = "7.6.12" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "coverage-7.6.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:704c8c8c6ce6569286ae9622e534b4f5b9759b6f2cd643f1c1a61f666d534fe8"}, + {file = "coverage-7.6.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ad7525bf0241e5502168ae9c643a2f6c219fa0a283001cee4cf23a9b7da75879"}, + {file = "coverage-7.6.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06097c7abfa611c91edb9e6920264e5be1d6ceb374efb4986f38b09eed4cb2fe"}, + {file = "coverage-7.6.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:220fa6c0ad7d9caef57f2c8771918324563ef0d8272c94974717c3909664e674"}, + {file = "coverage-7.6.12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3688b99604a24492bcfe1c106278c45586eb819bf66a654d8a9a1433022fb2eb"}, + {file = "coverage-7.6.12-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d1a987778b9c71da2fc8948e6f2656da6ef68f59298b7e9786849634c35d2c3c"}, + {file = "coverage-7.6.12-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:cec6b9ce3bd2b7853d4a4563801292bfee40b030c05a3d29555fd2a8ee9bd68c"}, + {file = "coverage-7.6.12-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ace9048de91293e467b44bce0f0381345078389814ff6e18dbac8fdbf896360e"}, + {file = "coverage-7.6.12-cp310-cp310-win32.whl", hash = "sha256:ea31689f05043d520113e0552f039603c4dd71fa4c287b64cb3606140c66f425"}, + {file = "coverage-7.6.12-cp310-cp310-win_amd64.whl", hash = "sha256:676f92141e3c5492d2a1596d52287d0d963df21bf5e55c8b03075a60e1ddf8aa"}, + {file = "coverage-7.6.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e18aafdfb3e9ec0d261c942d35bd7c28d031c5855dadb491d2723ba54f4c3015"}, + {file = "coverage-7.6.12-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:66fe626fd7aa5982cdebad23e49e78ef7dbb3e3c2a5960a2b53632f1f703ea45"}, + {file = "coverage-7.6.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ef01d70198431719af0b1f5dcbefc557d44a190e749004042927b2a3fed0702"}, + {file = "coverage-7.6.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07e92ae5a289a4bc4c0aae710c0948d3c7892e20fd3588224ebe242039573bf0"}, + {file = "coverage-7.6.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e695df2c58ce526eeab11a2e915448d3eb76f75dffe338ea613c1201b33bab2f"}, + {file = "coverage-7.6.12-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d74c08e9aaef995f8c4ef6d202dbd219c318450fe2a76da624f2ebb9c8ec5d9f"}, + {file = "coverage-7.6.12-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e995b3b76ccedc27fe4f477b349b7d64597e53a43fc2961db9d3fbace085d69d"}, + {file = "coverage-7.6.12-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b1f097878d74fe51e1ddd1be62d8e3682748875b461232cf4b52ddc6e6db0bba"}, + {file = "coverage-7.6.12-cp311-cp311-win32.whl", hash = "sha256:1f7ffa05da41754e20512202c866d0ebfc440bba3b0ed15133070e20bf5aeb5f"}, + {file = "coverage-7.6.12-cp311-cp311-win_amd64.whl", hash = "sha256:e216c5c45f89ef8971373fd1c5d8d1164b81f7f5f06bbf23c37e7908d19e8558"}, + {file = "coverage-7.6.12-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b172f8e030e8ef247b3104902cc671e20df80163b60a203653150d2fc204d1ad"}, + {file = "coverage-7.6.12-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:641dfe0ab73deb7069fb972d4d9725bf11c239c309ce694dd50b1473c0f641c3"}, + {file = "coverage-7.6.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e549f54ac5f301e8e04c569dfdb907f7be71b06b88b5063ce9d6953d2d58574"}, + {file = "coverage-7.6.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:959244a17184515f8c52dcb65fb662808767c0bd233c1d8a166e7cf74c9ea985"}, + {file = "coverage-7.6.12-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bda1c5f347550c359f841d6614fb8ca42ae5cb0b74d39f8a1e204815ebe25750"}, + {file = "coverage-7.6.12-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1ceeb90c3eda1f2d8c4c578c14167dbd8c674ecd7d38e45647543f19839dd6ea"}, + {file = "coverage-7.6.12-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f16f44025c06792e0fb09571ae454bcc7a3ec75eeb3c36b025eccf501b1a4c3"}, + {file = "coverage-7.6.12-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b076e625396e787448d27a411aefff867db2bffac8ed04e8f7056b07024eed5a"}, + {file = "coverage-7.6.12-cp312-cp312-win32.whl", hash = "sha256:00b2086892cf06c7c2d74983c9595dc511acca00665480b3ddff749ec4fb2a95"}, + {file = "coverage-7.6.12-cp312-cp312-win_amd64.whl", hash = "sha256:7ae6eabf519bc7871ce117fb18bf14e0e343eeb96c377667e3e5dd12095e0288"}, + {file = "coverage-7.6.12-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:488c27b3db0ebee97a830e6b5a3ea930c4a6e2c07f27a5e67e1b3532e76b9ef1"}, + {file = "coverage-7.6.12-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d1095bbee1851269f79fd8e0c9b5544e4c00c0c24965e66d8cba2eb5bb535fd"}, + {file = "coverage-7.6.12-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0533adc29adf6a69c1baa88c3d7dbcaadcffa21afbed3ca7a225a440e4744bf9"}, + {file = "coverage-7.6.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53c56358d470fa507a2b6e67a68fd002364d23c83741dbc4c2e0680d80ca227e"}, + {file = "coverage-7.6.12-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64cbb1a3027c79ca6310bf101014614f6e6e18c226474606cf725238cf5bc2d4"}, + {file = "coverage-7.6.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:79cac3390bfa9836bb795be377395f28410811c9066bc4eefd8015258a7578c6"}, + {file = "coverage-7.6.12-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9b148068e881faa26d878ff63e79650e208e95cf1c22bd3f77c3ca7b1d9821a3"}, + {file = "coverage-7.6.12-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8bec2ac5da793c2685ce5319ca9bcf4eee683b8a1679051f8e6ec04c4f2fd7dc"}, + {file = "coverage-7.6.12-cp313-cp313-win32.whl", hash = "sha256:200e10beb6ddd7c3ded322a4186313d5ca9e63e33d8fab4faa67ef46d3460af3"}, + {file = "coverage-7.6.12-cp313-cp313-win_amd64.whl", hash = "sha256:2b996819ced9f7dbb812c701485d58f261bef08f9b85304d41219b1496b591ef"}, + {file = "coverage-7.6.12-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:299cf973a7abff87a30609879c10df0b3bfc33d021e1adabc29138a48888841e"}, + {file = "coverage-7.6.12-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4b467a8c56974bf06e543e69ad803c6865249d7a5ccf6980457ed2bc50312703"}, + {file = "coverage-7.6.12-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2458f275944db8129f95d91aee32c828a408481ecde3b30af31d552c2ce284a0"}, + {file = "coverage-7.6.12-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a9d8be07fb0832636a0f72b80d2a652fe665e80e720301fb22b191c3434d924"}, + {file = "coverage-7.6.12-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14d47376a4f445e9743f6c83291e60adb1b127607a3618e3185bbc8091f0467b"}, + {file = "coverage-7.6.12-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b95574d06aa9d2bd6e5cc35a5bbe35696342c96760b69dc4287dbd5abd4ad51d"}, + {file = "coverage-7.6.12-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:ecea0c38c9079570163d663c0433a9af4094a60aafdca491c6a3d248c7432827"}, + {file = "coverage-7.6.12-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:2251fabcfee0a55a8578a9d29cecfee5f2de02f11530e7d5c5a05859aa85aee9"}, + {file = "coverage-7.6.12-cp313-cp313t-win32.whl", hash = "sha256:eb5507795caabd9b2ae3f1adc95f67b1104971c22c624bb354232d65c4fc90b3"}, + {file = "coverage-7.6.12-cp313-cp313t-win_amd64.whl", hash = "sha256:f60a297c3987c6c02ffb29effc70eadcbb412fe76947d394a1091a3615948e2f"}, + {file = "coverage-7.6.12-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e7575ab65ca8399c8c4f9a7d61bbd2d204c8b8e447aab9d355682205c9dd948d"}, + {file = "coverage-7.6.12-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8161d9fbc7e9fe2326de89cd0abb9f3599bccc1287db0aba285cb68d204ce929"}, + {file = "coverage-7.6.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a1e465f398c713f1b212400b4e79a09829cd42aebd360362cd89c5bdc44eb87"}, + {file = "coverage-7.6.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f25d8b92a4e31ff1bd873654ec367ae811b3a943583e05432ea29264782dc32c"}, + {file = "coverage-7.6.12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a936309a65cc5ca80fa9f20a442ff9e2d06927ec9a4f54bcba9c14c066323f2"}, + {file = "coverage-7.6.12-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:aa6f302a3a0b5f240ee201297fff0bbfe2fa0d415a94aeb257d8b461032389bd"}, + {file = "coverage-7.6.12-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f973643ef532d4f9be71dd88cf7588936685fdb576d93a79fe9f65bc337d9d73"}, + {file = "coverage-7.6.12-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:78f5243bb6b1060aed6213d5107744c19f9571ec76d54c99cc15938eb69e0e86"}, + {file = "coverage-7.6.12-cp39-cp39-win32.whl", hash = "sha256:69e62c5034291c845fc4df7f8155e8544178b6c774f97a99e2734b05eb5bed31"}, + {file = "coverage-7.6.12-cp39-cp39-win_amd64.whl", hash = "sha256:b01a840ecc25dce235ae4c1b6a0daefb2a203dba0e6e980637ee9c2f6ee0df57"}, + {file = "coverage-7.6.12-pp39.pp310-none-any.whl", hash = "sha256:7e39e845c4d764208e7b8f6a21c541ade741e2c41afabdfa1caa28687a3c98cf"}, + {file = "coverage-7.6.12-py3-none-any.whl", hash = "sha256:eb8668cfbc279a536c633137deeb9435d2962caec279c3f8cf8b91fff6ff8953"}, + {file = "coverage-7.6.12.tar.gz", hash = "sha256:48cfc4641d95d34766ad41d9573cc0f22a48aa88d22657a1fe01dca0dbae4de2"}, +] + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} + +[package.extras] +toml = ["tomli"] + +[[package]] +name = "cryptography" +version = "44.0.2" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +optional = false +python-versions = "!=3.9.0,!=3.9.1,>=3.7" +files = [ + {file = "cryptography-44.0.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:efcfe97d1b3c79e486554efddeb8f6f53a4cdd4cf6086642784fa31fc384e1d7"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29ecec49f3ba3f3849362854b7253a9f59799e3763b0c9d0826259a88efa02f1"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc821e161ae88bfe8088d11bb39caf2916562e0a2dc7b6d56714a48b784ef0bb"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3c00b6b757b32ce0f62c574b78b939afab9eecaf597c4d624caca4f9e71e7843"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7bdcd82189759aba3816d1f729ce42ffded1ac304c151d0a8e89b9996ab863d5"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:4973da6ca3db4405c54cd0b26d328be54c7747e89e284fcff166132eb7bccc9c"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:4e389622b6927d8133f314949a9812972711a111d577a5d1f4bee5e58736b80a"}, + {file = "cryptography-44.0.2-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:f514ef4cd14bb6fb484b4a60203e912cfcb64f2ab139e88c2274511514bf7308"}, + {file = "cryptography-44.0.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1bc312dfb7a6e5d66082c87c34c8a62176e684b6fe3d90fcfe1568de675e6688"}, + {file = "cryptography-44.0.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3b721b8b4d948b218c88cb8c45a01793483821e709afe5f622861fc6182b20a7"}, + {file = "cryptography-44.0.2-cp37-abi3-win32.whl", hash = "sha256:51e4de3af4ec3899d6d178a8c005226491c27c4ba84101bfb59c901e10ca9f79"}, + {file = "cryptography-44.0.2-cp37-abi3-win_amd64.whl", hash = "sha256:c505d61b6176aaf982c5717ce04e87da5abc9a36a5b39ac03905c4aafe8de7aa"}, + {file = "cryptography-44.0.2-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:8e0ddd63e6bf1161800592c71ac794d3fb8001f2caebe0966e77c5234fa9efc3"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81276f0ea79a208d961c433a947029e1a15948966658cf6710bbabb60fcc2639"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a1e657c0f4ea2a23304ee3f964db058c9e9e635cc7019c4aa21c330755ef6fd"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:6210c05941994290f3f7f175a4a57dbbb2afd9273657614c506d5976db061181"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d1c3572526997b36f245a96a2b1713bf79ce99b271bbcf084beb6b9b075f29ea"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:b042d2a275c8cee83a4b7ae30c45a15e6a4baa65a179a0ec2d78ebb90e4f6699"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:d03806036b4f89e3b13b6218fefea8d5312e450935b1a2d55f0524e2ed7c59d9"}, + {file = "cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:c7362add18b416b69d58c910caa217f980c5ef39b23a38a0880dfd87bdf8cd23"}, + {file = "cryptography-44.0.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:8cadc6e3b5a1f144a039ea08a0bdb03a2a92e19c46be3285123d32029f40a922"}, + {file = "cryptography-44.0.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6f101b1f780f7fc613d040ca4bdf835c6ef3b00e9bd7125a4255ec574c7916e4"}, + {file = "cryptography-44.0.2-cp39-abi3-win32.whl", hash = "sha256:3dc62975e31617badc19a906481deacdeb80b4bb454394b4098e3f2525a488c5"}, + {file = "cryptography-44.0.2-cp39-abi3-win_amd64.whl", hash = "sha256:5f6f90b72d8ccadb9c6e311c775c8305381db88374c65fa1a68250aa8a9cb3a6"}, + {file = "cryptography-44.0.2-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:af4ff3e388f2fa7bff9f7f2b31b87d5651c45731d3e8cfa0944be43dff5cfbdb"}, + {file = "cryptography-44.0.2-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:0529b1d5a0105dd3731fa65680b45ce49da4d8115ea76e9da77a875396727b41"}, + {file = "cryptography-44.0.2-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:7ca25849404be2f8e4b3c59483d9d3c51298a22c1c61a0e84415104dacaf5562"}, + {file = "cryptography-44.0.2-pp310-pypy310_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:268e4e9b177c76d569e8a145a6939eca9a5fec658c932348598818acf31ae9a5"}, + {file = "cryptography-44.0.2-pp310-pypy310_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:9eb9d22b0a5d8fd9925a7764a054dca914000607dff201a24c791ff5c799e1fa"}, + {file = "cryptography-44.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:2bf7bf75f7df9715f810d1b038870309342bff3069c5bd8c6b96128cb158668d"}, + {file = "cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:909c97ab43a9c0c0b0ada7a1281430e4e5ec0458e6d9244c0e821bbf152f061d"}, + {file = "cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:96e7a5e9d6e71f9f4fca8eebfd603f8e86c5225bb18eb621b2c1e50b290a9471"}, + {file = "cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:d1b3031093a366ac767b3feb8bcddb596671b3aaff82d4050f984da0c248b615"}, + {file = "cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:04abd71114848aa25edb28e225ab5f268096f44cf0127f3d36975bdf1bdf3390"}, + {file = "cryptography-44.0.2.tar.gz", hash = "sha256:c63454aa261a0cf0c5b4718349629793e9e634993538db841165b3df74f37ec0"}, +] + +[package.dependencies] +cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} + +[package.extras] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=3.0.0)"] +docstest = ["pyenchant (>=3)", "readme-renderer (>=30.0)", "sphinxcontrib-spelling (>=7.3.1)"] +nox = ["nox (>=2024.4.15)", "nox[uv] (>=2024.3.2)"] +pep8test = ["check-sdist", "click (>=8.0.1)", "mypy (>=1.4)", "ruff (>=0.3.6)"] +sdist = ["build (>=1.0.0)"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["certifi (>=2024)", "cryptography-vectors (==44.0.2)", "pretend (>=0.7)", "pytest (>=7.4.0)", "pytest-benchmark (>=4.0)", "pytest-cov (>=2.10.1)", "pytest-xdist (>=3.5.0)"] +test-randomorder = ["pytest-randomly"] + +[[package]] +name = "diskcache" +version = "5.6.3" +description = "Disk Cache -- Disk and file backed persistent cache." +optional = false +python-versions = ">=3" +files = [ + {file = "diskcache-5.6.3-py3-none-any.whl", hash = "sha256:5e31b2d5fbad117cc363ebaf6b689474db18a1f6438bc82358b024abd4c2ca19"}, + {file = "diskcache-5.6.3.tar.gz", hash = "sha256:2c3a3fa2743d8535d832ec61c2054a1641f41775aa7c556758a109941e33e4fc"}, +] + +[[package]] +name = "distlib" +version = "0.3.9" +description = "Distribution utilities" +optional = false +python-versions = "*" +files = [ + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, +] + +[[package]] +name = "distro" +version = "1.9.0" +description = "Distro - an OS platform information API" +optional = false +python-versions = ">=3.6" +files = [ + {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, + {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, +] + +[[package]] +name = "docutils" +version = "0.21.2" +description = "Docutils -- Python Documentation Utilities" +optional = false +python-versions = ">=3.9" +files = [ + {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, + {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, +] + +[[package]] +name = "dparse" +version = "0.6.4" +description = "A parser for Python dependency files" +optional = false +python-versions = ">=3.7" +files = [ + {file = "dparse-0.6.4-py3-none-any.whl", hash = "sha256:fbab4d50d54d0e739fbb4dedfc3d92771003a5b9aa8545ca7a7045e3b174af57"}, + {file = "dparse-0.6.4.tar.gz", hash = "sha256:90b29c39e3edc36c6284c82c4132648eaf28a01863eb3c231c2512196132201a"}, +] + +[package.dependencies] +packaging = "*" +tomli = {version = "*", markers = "python_version < \"3.11\""} + +[package.extras] +all = ["pipenv", "poetry", "pyyaml"] +conda = ["pyyaml"] +pipenv = ["pipenv"] +poetry = ["poetry"] + +[[package]] +name = "evdev" +version = "1.9.1" +description = "Bindings to the Linux input handling subsystem" +optional = false +python-versions = ">=3.8" +files = [ + {file = "evdev-1.9.1.tar.gz", hash = "sha256:dc640a064cb1c9fe1f8b970dc2039945a2a275d7b7ee62284bf427238abe45ee"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "filelock" +version = "3.16.1" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.8" +files = [ + {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, + {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] +typing = ["typing-extensions (>=4.12.2)"] + +[[package]] +name = "greenlet" +version = "3.1.1" +description = "Lightweight in-process concurrent programming" +optional = false +python-versions = ">=3.7" +files = [ + {file = "greenlet-3.1.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:36b89d13c49216cadb828db8dfa6ce86bbbc476a82d3a6c397f0efae0525bdd0"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b6150a85e1b33b40b1464a3f9988dcc5251d6ed06842abff82e42632fac120"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93147c513fac16385d1036b7e5b102c7fbbdb163d556b791f0f11eada7ba65dc"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da7a9bff22ce038e19bf62c4dd1ec8391062878710ded0a845bcf47cc0200617"}, + {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b2795058c23988728eec1f36a4e5e4ebad22f8320c85f3587b539b9ac84128d7"}, + {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ed10eac5830befbdd0c32f83e8aa6288361597550ba669b04c48f0f9a2c843c6"}, + {file = "greenlet-3.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:77c386de38a60d1dfb8e55b8c1101d68c79dfdd25c7095d51fec2dd800892b80"}, + {file = "greenlet-3.1.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e4d333e558953648ca09d64f13e6d8f0523fa705f51cae3f03b5983489958c70"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5e975ca70269d66d17dd995dafc06f1b06e8cb1ec1e9ed54c1d1e4a7c4cf26e"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b2813dc3de8c1ee3f924e4d4227999285fd335d1bcc0d2be6dc3f1f6a318ec1"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e347b3bfcf985a05e8c0b7d462ba6f15b1ee1c909e2dcad795e49e91b152c383"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e8f8c9cb53cdac7ba9793c276acd90168f416b9ce36799b9b885790f8ad6c0a"}, + {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62ee94988d6b4722ce0028644418d93a52429e977d742ca2ccbe1c4f4a792511"}, + {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1776fd7f989fc6b8d8c8cb8da1f6b82c5814957264d1f6cf818d475ec2bf6395"}, + {file = "greenlet-3.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:48ca08c771c268a768087b408658e216133aecd835c0ded47ce955381105ba39"}, + {file = "greenlet-3.1.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9"}, + {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0"}, + {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942"}, + {file = "greenlet-3.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01"}, + {file = "greenlet-3.1.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e"}, + {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1"}, + {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c"}, + {file = "greenlet-3.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822"}, + {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01"}, + {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47da355d8687fd65240c364c90a31569a133b7b60de111c255ef5b606f2ae291"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98884ecf2ffb7d7fe6bd517e8eb99d31ff7855a840fa6d0d63cd07c037f6a981"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1d4aeb8891338e60d1ab6127af1fe45def5259def8094b9c7e34690c8858803"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db32b5348615a04b82240cc67983cb315309e88d444a288934ee6ceaebcad6cc"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dcc62f31eae24de7f8dce72134c8651c58000d3b1868e01392baea7c32c247de"}, + {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1d3755bcb2e02de341c55b4fca7a745a24a9e7212ac953f6b3a48d117d7257aa"}, + {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b8da394b34370874b4572676f36acabac172602abf054cbc4ac910219f3340af"}, + {file = "greenlet-3.1.1-cp37-cp37m-win32.whl", hash = "sha256:a0dfc6c143b519113354e780a50381508139b07d2177cb6ad6a08278ec655798"}, + {file = "greenlet-3.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:54558ea205654b50c438029505def3834e80f0869a70fb15b871c29b4575ddef"}, + {file = "greenlet-3.1.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:346bed03fe47414091be4ad44786d1bd8bef0c3fcad6ed3dee074a032ab408a9"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfc59d69fc48664bc693842bd57acfdd490acafda1ab52c7836e3fc75c90a111"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21e10da6ec19b457b82636209cbe2331ff4306b54d06fa04b7c138ba18c8a81"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37b9de5a96111fc15418819ab4c4432e4f3c2ede61e660b1e33971eba26ef9ba"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ef9ea3f137e5711f0dbe5f9263e8c009b7069d8a1acea822bd5e9dae0ae49c8"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85f3ff71e2e60bd4b4932a043fbbe0f499e263c628390b285cb599154a3b03b1"}, + {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:95ffcf719966dd7c453f908e208e14cde192e09fde6c7186c8f1896ef778d8cd"}, + {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:03a088b9de532cbfe2ba2034b2b85e82df37874681e8c470d6fb2f8c04d7e4b7"}, + {file = "greenlet-3.1.1-cp38-cp38-win32.whl", hash = "sha256:8b8b36671f10ba80e159378df9c4f15c14098c4fd73a36b9ad715f057272fbef"}, + {file = "greenlet-3.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:7017b2be767b9d43cc31416aba48aab0d2309ee31b4dbf10a1d38fb7972bdf9d"}, + {file = "greenlet-3.1.1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:396979749bd95f018296af156201d6211240e7a23090f50a8d5d18c370084dc3"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9d0ff5ad43e785350894d97e13633a66e2b50000e8a183a50a88d834752d42"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f6ff3b14f2df4c41660a7dec01045a045653998784bf8cfcb5a525bdffffbc8f"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94ebba31df2aa506d7b14866fed00ac141a867e63143fe5bca82a8e503b36437"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73aaad12ac0ff500f62cebed98d8789198ea0e6f233421059fa68a5aa7220145"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63e4844797b975b9af3a3fb8f7866ff08775f5426925e1e0bbcfe7932059a12c"}, + {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7939aa3ca7d2a1593596e7ac6d59391ff30281ef280d8632fa03d81f7c5f955e"}, + {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d0028e725ee18175c6e422797c407874da24381ce0690d6b9396c204c7f7276e"}, + {file = "greenlet-3.1.1-cp39-cp39-win32.whl", hash = "sha256:5e06afd14cbaf9e00899fae69b24a32f2196c19de08fcb9f4779dd4f004e5e7c"}, + {file = "greenlet-3.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:3319aa75e0e0639bc15ff54ca327e8dc7a6fe404003496e3c6925cd3142e0e22"}, + {file = "greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467"}, +] + +[package.extras] +docs = ["Sphinx", "furo"] +test = ["objgraph", "psutil"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "1.0.7" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, + {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.28.1" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "humanize" +version = "4.12.1" +description = "Python humanize utilities" +optional = false +python-versions = ">=3.9" +files = [ + {file = "humanize-4.12.1-py3-none-any.whl", hash = "sha256:86014ca5c52675dffa1d404491952f1f5bf03b07c175a51891a343daebf01fea"}, + {file = "humanize-4.12.1.tar.gz", hash = "sha256:1338ba97415c96556758a6e2f65977ed406dddf4620d4c6db9bbdfd07f0f1232"}, +] + +[package.extras] +tests = ["freezegun", "pytest", "pytest-cov"] + +[[package]] +name = "identify" +version = "2.6.9" +description = "File identification library for Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "identify-2.6.9-py2.py3-none-any.whl", hash = "sha256:c98b4322da415a8e5a70ff6e51fbc2d2932c015532d77e9f8537b4ba7813b150"}, + {file = "identify-2.6.9.tar.gz", hash = "sha256:d40dfe3142a1421d8518e3d3985ef5ac42890683e32306ad614a29490abeb6bf"}, +] + +[package.extras] +license = ["ukkonen"] + +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, + {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, +] + +[[package]] +name = "inflect" +version = "7.5.0" +description = "Correctly generate plurals, singular nouns, ordinals, indefinite articles" +optional = false +python-versions = ">=3.9" +files = [ + {file = "inflect-7.5.0-py3-none-any.whl", hash = "sha256:2aea70e5e70c35d8350b8097396ec155ffd68def678c7ff97f51aa69c1d92344"}, + {file = "inflect-7.5.0.tar.gz", hash = "sha256:faf19801c3742ed5a05a8ce388e0d8fe1a07f8d095c82201eb904f5d27ad571f"}, +] + +[package.dependencies] +more_itertools = ">=8.5.0" +typeguard = ">=4.0.1" + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["pygments", "pytest (>=6,!=8.1.*)"] +type = ["pytest-mypy"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "invoke" +version = "2.2.0" +description = "Pythonic task execution" +optional = false +python-versions = ">=3.6" +files = [ + {file = "invoke-2.2.0-py3-none-any.whl", hash = "sha256:6ea924cc53d4f78e3d98bc436b08069a03077e6f85ad1ddaa8a116d7dad15820"}, + {file = "invoke-2.2.0.tar.gz", hash = "sha256:ee6cbb101af1a859c7fe84f2a264c059020b0cb7fe3535f9424300ab568f6bd5"}, +] + +[[package]] +name = "isort" +version = "6.0.1" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.9.0" +files = [ + {file = "isort-6.0.1-py3-none-any.whl", hash = "sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615"}, + {file = "isort-6.0.1.tar.gz", hash = "sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450"}, +] + +[package.extras] +colors = ["colorama"] +plugins = ["setuptools"] + +[[package]] +name = "jinja2" +version = "3.1.6" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, + {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "jiter" +version = "0.9.0" +description = "Fast iterable JSON parser." +optional = false +python-versions = ">=3.8" +files = [ + {file = "jiter-0.9.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:816ec9b60fdfd1fec87da1d7ed46c66c44ffec37ab2ef7de5b147b2fce3fd5ad"}, + {file = "jiter-0.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9b1d3086f8a3ee0194ecf2008cf81286a5c3e540d977fa038ff23576c023c0ea"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1339f839b91ae30b37c409bf16ccd3dc453e8b8c3ed4bd1d6a567193651a4a51"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ffba79584b3b670fefae66ceb3a28822365d25b7bf811e030609a3d5b876f538"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cfc7d0a8e899089d11f065e289cb5b2daf3d82fbe028f49b20d7b809193958d"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e00a1a2bbfaaf237e13c3d1592356eab3e9015d7efd59359ac8b51eb56390a12"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1d9870561eb26b11448854dce0ff27a9a27cb616b632468cafc938de25e9e51"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9872aeff3f21e437651df378cb75aeb7043e5297261222b6441a620218b58708"}, + {file = "jiter-0.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1fd19112d1049bdd47f17bfbb44a2c0001061312dcf0e72765bfa8abd4aa30e5"}, + {file = "jiter-0.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6ef5da104664e526836070e4a23b5f68dec1cc673b60bf1edb1bfbe8a55d0678"}, + {file = "jiter-0.9.0-cp310-cp310-win32.whl", hash = "sha256:cb12e6d65ebbefe5518de819f3eda53b73187b7089040b2d17f5b39001ff31c4"}, + {file = "jiter-0.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:c43ca669493626d8672be3b645dbb406ef25af3f4b6384cfd306da7eb2e70322"}, + {file = "jiter-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6c4d99c71508912a7e556d631768dcdef43648a93660670986916b297f1c54af"}, + {file = "jiter-0.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8f60fb8ce7df529812bf6c625635a19d27f30806885139e367af93f6e734ef58"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51c4e1a4f8ea84d98b7b98912aa4290ac3d1eabfde8e3c34541fae30e9d1f08b"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f4c677c424dc76684fea3e7285a7a2a7493424bea89ac441045e6a1fb1d7b3b"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2221176dfec87f3470b21e6abca056e6b04ce9bff72315cb0b243ca9e835a4b5"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3c7adb66f899ffa25e3c92bfcb593391ee1947dbdd6a9a970e0d7e713237d572"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c98d27330fdfb77913c1097a7aab07f38ff2259048949f499c9901700789ac15"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:eda3f8cc74df66892b1d06b5d41a71670c22d95a1ca2cbab73654745ce9d0419"}, + {file = "jiter-0.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:dd5ab5ddc11418dce28343123644a100f487eaccf1de27a459ab36d6cca31043"}, + {file = "jiter-0.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42f8a68a69f047b310319ef8e2f52fdb2e7976fb3313ef27df495cf77bcad965"}, + {file = "jiter-0.9.0-cp311-cp311-win32.whl", hash = "sha256:a25519efb78a42254d59326ee417d6f5161b06f5da827d94cf521fed961b1ff2"}, + {file = "jiter-0.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:923b54afdd697dfd00d368b7ccad008cccfeb1efb4e621f32860c75e9f25edbd"}, + {file = "jiter-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:7b46249cfd6c48da28f89eb0be3f52d6fdb40ab88e2c66804f546674e539ec11"}, + {file = "jiter-0.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:609cf3c78852f1189894383cf0b0b977665f54cb38788e3e6b941fa6d982c00e"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d726a3890a54561e55a9c5faea1f7655eda7f105bd165067575ace6e65f80bb2"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2e89dc075c1fef8fa9be219e249f14040270dbc507df4215c324a1839522ea75"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04e8ffa3c353b1bc4134f96f167a2082494351e42888dfcf06e944f2729cbe1d"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:203f28a72a05ae0e129b3ed1f75f56bc419d5f91dfacd057519a8bd137b00c42"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fca1a02ad60ec30bb230f65bc01f611c8608b02d269f998bc29cca8619a919dc"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:237e5cee4d5d2659aaf91bbf8ec45052cc217d9446070699441a91b386ae27dc"}, + {file = "jiter-0.9.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:528b6b71745e7326eed73c53d4aa57e2a522242320b6f7d65b9c5af83cf49b6e"}, + {file = "jiter-0.9.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9f48e86b57bc711eb5acdfd12b6cb580a59cc9a993f6e7dcb6d8b50522dcd50d"}, + {file = "jiter-0.9.0-cp312-cp312-win32.whl", hash = "sha256:699edfde481e191d81f9cf6d2211debbfe4bd92f06410e7637dffb8dd5dfde06"}, + {file = "jiter-0.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:099500d07b43f61d8bd780466d429c45a7b25411b334c60ca875fa775f68ccb0"}, + {file = "jiter-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:2764891d3f3e8b18dce2cff24949153ee30c9239da7c00f032511091ba688ff7"}, + {file = "jiter-0.9.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:387b22fbfd7a62418d5212b4638026d01723761c75c1c8232a8b8c37c2f1003b"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d8da8629ccae3606c61d9184970423655fb4e33d03330bcdfe52d234d32f69"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1be73d8982bdc278b7b9377426a4b44ceb5c7952073dd7488e4ae96b88e1103"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2228eaaaa111ec54b9e89f7481bffb3972e9059301a878d085b2b449fbbde635"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:11509bfecbc319459647d4ac3fd391d26fdf530dad00c13c4dadabf5b81f01a4"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f22238da568be8bbd8e0650e12feeb2cfea15eda4f9fc271d3b362a4fa0604d"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17f5d55eb856597607562257c8e36c42bc87f16bef52ef7129b7da11afc779f3"}, + {file = "jiter-0.9.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:6a99bed9fbb02f5bed416d137944419a69aa4c423e44189bc49718859ea83bc5"}, + {file = "jiter-0.9.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e057adb0cd1bd39606100be0eafe742de2de88c79df632955b9ab53a086b3c8d"}, + {file = "jiter-0.9.0-cp313-cp313-win32.whl", hash = "sha256:f7e6850991f3940f62d387ccfa54d1a92bd4bb9f89690b53aea36b4364bcab53"}, + {file = "jiter-0.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:c8ae3bf27cd1ac5e6e8b7a27487bf3ab5f82318211ec2e1346a5b058756361f7"}, + {file = "jiter-0.9.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f0b2827fb88dda2cbecbbc3e596ef08d69bda06c6f57930aec8e79505dc17001"}, + {file = "jiter-0.9.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:062b756ceb1d40b0b28f326cba26cfd575a4918415b036464a52f08632731e5a"}, + {file = "jiter-0.9.0-cp313-cp313t-win_amd64.whl", hash = "sha256:6f7838bc467ab7e8ef9f387bd6de195c43bad82a569c1699cb822f6609dd4cdf"}, + {file = "jiter-0.9.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4a2d16360d0642cd68236f931b85fe50288834c383492e4279d9f1792e309571"}, + {file = "jiter-0.9.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e84ed1c9c9ec10bbb8c37f450077cbe3c0d4e8c2b19f0a49a60ac7ace73c7452"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f3c848209ccd1bfa344a1240763975ca917de753c7875c77ec3034f4151d06c"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7825f46e50646bee937e0f849d14ef3a417910966136f59cd1eb848b8b5bb3e4"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d82a811928b26d1a6311a886b2566f68ccf2b23cf3bfed042e18686f1f22c2d7"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c058ecb51763a67f019ae423b1cbe3fa90f7ee6280c31a1baa6ccc0c0e2d06e"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9897115ad716c48f0120c1f0c4efae348ec47037319a6c63b2d7838bb53aaef4"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:351f4c90a24c4fb8c87c6a73af2944c440494ed2bea2094feecacb75c50398ae"}, + {file = "jiter-0.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d45807b0f236c485e1e525e2ce3a854807dfe28ccf0d013dd4a563395e28008a"}, + {file = "jiter-0.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:1537a890724ba00fdba21787010ac6f24dad47f763410e9e1093277913592784"}, + {file = "jiter-0.9.0-cp38-cp38-win32.whl", hash = "sha256:e3630ec20cbeaddd4b65513fa3857e1b7c4190d4481ef07fb63d0fad59033321"}, + {file = "jiter-0.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:2685f44bf80e95f8910553bf2d33b9c87bf25fceae6e9f0c1355f75d2922b0ee"}, + {file = "jiter-0.9.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:9ef340fae98065071ccd5805fe81c99c8f80484e820e40043689cf97fb66b3e2"}, + {file = "jiter-0.9.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:efb767d92c63b2cd9ec9f24feeb48f49574a713870ec87e9ba0c2c6e9329c3e2"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:113f30f87fb1f412510c6d7ed13e91422cfd329436364a690c34c8b8bd880c42"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8793b6df019b988526f5a633fdc7456ea75e4a79bd8396a3373c371fc59f5c9b"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7a9aaa5102dba4e079bb728076fadd5a2dca94c05c04ce68004cfd96f128ea34"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d838650f6ebaf4ccadfb04522463e74a4c378d7e667e0eb1865cfe3990bfac49"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0194f813efdf4b8865ad5f5c5f50f8566df7d770a82c51ef593d09e0b347020"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a7954a401d0a8a0b8bc669199db78af435aae1e3569187c2939c477c53cb6a0a"}, + {file = "jiter-0.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4feafe787eb8a8d98168ab15637ca2577f6ddf77ac6c8c66242c2d028aa5420e"}, + {file = "jiter-0.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:27cd1f2e8bb377f31d3190b34e4328d280325ad7ef55c6ac9abde72f79e84d2e"}, + {file = "jiter-0.9.0-cp39-cp39-win32.whl", hash = "sha256:161d461dcbe658cf0bd0aa375b30a968b087cdddc624fc585f3867c63c6eca95"}, + {file = "jiter-0.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:e8b36d8a16a61993be33e75126ad3d8aa29cf450b09576f3c427d27647fcb4aa"}, + {file = "jiter-0.9.0.tar.gz", hash = "sha256:aadba0964deb424daa24492abc3d229c60c4a31bfee205aedbf1acc7639d7893"}, +] + +[[package]] +name = "joblib" +version = "1.4.2" +description = "Lightweight pipelining with Python functions" +optional = false +python-versions = ">=3.8" +files = [ + {file = "joblib-1.4.2-py3-none-any.whl", hash = "sha256:06d478d5674cbc267e7496a410ee875abd68e4340feff4490bcb7afb88060ae6"}, + {file = "joblib-1.4.2.tar.gz", hash = "sha256:2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e"}, +] + +[[package]] +name = "markdown-it-py" +version = "3.0.0" +description = "Python port of markdown-it. Markdown parsing, done right!" +optional = false +python-versions = ">=3.8" +files = [ + {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, + {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, +] + +[package.dependencies] +mdurl = ">=0.1,<1.0" + +[package.extras] +benchmarking = ["psutil", "pytest", "pytest-benchmark"] +code-style = ["pre-commit (>=3.0,<4.0)"] +compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0,<2.0)", "mistune (>=2.0,<3.0)", "panflute (>=2.3,<3.0)"] +linkify = ["linkify-it-py (>=1,<3)"] +plugins = ["mdit-py-plugins"] +profiling = ["gprof2dot"] +rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] +testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] + +[[package]] +name = "markupsafe" +version = "3.0.2" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.9" +files = [ + {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-win32.whl", hash = "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-win32.whl", hash = "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-win32.whl", hash = "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a"}, + {file = "markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"}, +] + +[[package]] +name = "marshmallow" +version = "3.26.1" +description = "A lightweight library for converting complex datatypes to and from native Python datatypes." +optional = false +python-versions = ">=3.9" +files = [ + {file = "marshmallow-3.26.1-py3-none-any.whl", hash = "sha256:3350409f20a70a7e4e11a27661187b77cdcaeb20abca41c1454fe33636bea09c"}, + {file = "marshmallow-3.26.1.tar.gz", hash = "sha256:e6d8affb6cb61d39d26402096dc0aee12d5a26d490a121f118d2e81dc0719dc6"}, +] + +[package.dependencies] +packaging = ">=17.0" + +[package.extras] +dev = ["marshmallow[tests]", "pre-commit (>=3.5,<5.0)", "tox"] +docs = ["autodocsumm (==0.2.14)", "furo (==2024.8.6)", "sphinx (==8.1.3)", "sphinx-copybutton (==0.5.2)", "sphinx-issues (==5.0.0)", "sphinxext-opengraph (==0.9.1)"] +tests = ["pytest", "simplejson"] + +[[package]] +name = "mdurl" +version = "0.1.2" +description = "Markdown URL utilities" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, + {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, +] + +[[package]] +name = "more-itertools" +version = "10.6.0" +description = "More routines for operating on iterables, beyond itertools" +optional = false +python-versions = ">=3.9" +files = [ + {file = "more-itertools-10.6.0.tar.gz", hash = "sha256:2cd7fad1009c31cc9fb6a035108509e6547547a7a738374f10bd49a09eb3ee3b"}, + {file = "more_itertools-10.6.0-py3-none-any.whl", hash = "sha256:6eb054cb4b6db1473f6e15fcc676a08e4732548acd47c708f0e179c2c7c01e89"}, +] + +[[package]] +name = "mypy" +version = "1.15.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, + {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, + {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, + {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, + {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, + {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, + {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, + {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, + {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, + {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, + {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, + {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, + {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, +] + +[package.dependencies] +mypy_extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing_extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "nltk" +version = "3.9.1" +description = "Natural Language Toolkit" +optional = false +python-versions = ">=3.8" +files = [ + {file = "nltk-3.9.1-py3-none-any.whl", hash = "sha256:4fa26829c5b00715afe3061398a8989dc643b92ce7dd93fb4585a70930d168a1"}, + {file = "nltk-3.9.1.tar.gz", hash = "sha256:87d127bd3de4bd89a4f81265e5fa59cb1b199b27440175370f7417d2bc7ae868"}, +] + +[package.dependencies] +click = "*" +joblib = "*" +regex = ">=2021.8.3" +tqdm = "*" + +[package.extras] +all = ["matplotlib", "numpy", "pyparsing", "python-crfsuite", "requests", "scikit-learn", "scipy", "twython"] +corenlp = ["requests"] +machine-learning = ["numpy", "python-crfsuite", "scikit-learn", "scipy"] +plot = ["matplotlib"] +tgrep = ["pyparsing"] +twitter = ["twython"] + +[[package]] +name = "nodeenv" +version = "1.9.1" +description = "Node.js virtual environment builder" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, +] + +[[package]] +name = "openai" +version = "1.66.3" +description = "The official Python library for the openai API" +optional = false +python-versions = ">=3.8" +files = [ + {file = "openai-1.66.3-py3-none-any.whl", hash = "sha256:a427c920f727711877ab17c11b95f1230b27767ba7a01e5b66102945141ceca9"}, + {file = "openai-1.66.3.tar.gz", hash = "sha256:8dde3aebe2d081258d4159c4cb27bdc13b5bb3f7ea2201d9bd940b9a89faf0c9"}, +] + +[package.dependencies] +anyio = ">=3.5.0,<5" +distro = ">=1.7.0,<2" +httpx = ">=0.23.0,<1" +jiter = ">=0.4.0,<1" +pydantic = ">=1.9.0,<3" +sniffio = "*" +tqdm = ">4" +typing-extensions = ">=4.11,<5" + +[package.extras] +datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] +realtime = ["websockets (>=13,<15)"] + +[[package]] +name = "packaging" +version = "24.2" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, + {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, +] + +[[package]] +name = "parsedatetime" +version = "2.6" +description = "Parse human-readable date/time text." +optional = false +python-versions = "*" +files = [ + {file = "parsedatetime-2.6-py3-none-any.whl", hash = "sha256:cb96edd7016872f58479e35879294258c71437195760746faffedb692aef000b"}, + {file = "parsedatetime-2.6.tar.gz", hash = "sha256:4cb368fbb18a0b7231f4d76119165451c8d2e35951455dfee97c62a87b04d455"}, +] + +[[package]] +name = "pathspec" +version = "0.12.1" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, +] + +[[package]] +name = "pillow" +version = "11.1.0" +description = "Python Imaging Library (Fork)" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pillow-11.1.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:e1abe69aca89514737465752b4bcaf8016de61b3be1397a8fc260ba33321b3a8"}, + {file = "pillow-11.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c640e5a06869c75994624551f45e5506e4256562ead981cce820d5ab39ae2192"}, + {file = "pillow-11.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a07dba04c5e22824816b2615ad7a7484432d7f540e6fa86af60d2de57b0fcee2"}, + {file = "pillow-11.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e267b0ed063341f3e60acd25c05200df4193e15a4a5807075cd71225a2386e26"}, + {file = "pillow-11.1.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:bd165131fd51697e22421d0e467997ad31621b74bfc0b75956608cb2906dda07"}, + {file = "pillow-11.1.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:abc56501c3fd148d60659aae0af6ddc149660469082859fa7b066a298bde9482"}, + {file = "pillow-11.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:54ce1c9a16a9561b6d6d8cb30089ab1e5eb66918cb47d457bd996ef34182922e"}, + {file = "pillow-11.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:73ddde795ee9b06257dac5ad42fcb07f3b9b813f8c1f7f870f402f4dc54b5269"}, + {file = "pillow-11.1.0-cp310-cp310-win32.whl", hash = "sha256:3a5fe20a7b66e8135d7fd617b13272626a28278d0e578c98720d9ba4b2439d49"}, + {file = "pillow-11.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:b6123aa4a59d75f06e9dd3dac5bf8bc9aa383121bb3dd9a7a612e05eabc9961a"}, + {file = "pillow-11.1.0-cp310-cp310-win_arm64.whl", hash = "sha256:a76da0a31da6fcae4210aa94fd779c65c75786bc9af06289cd1c184451ef7a65"}, + {file = "pillow-11.1.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:e06695e0326d05b06833b40b7ef477e475d0b1ba3a6d27da1bb48c23209bf457"}, + {file = "pillow-11.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96f82000e12f23e4f29346e42702b6ed9a2f2fea34a740dd5ffffcc8c539eb35"}, + {file = "pillow-11.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3cd561ded2cf2bbae44d4605837221b987c216cff94f49dfeed63488bb228d2"}, + {file = "pillow-11.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f189805c8be5ca5add39e6f899e6ce2ed824e65fb45f3c28cb2841911da19070"}, + {file = "pillow-11.1.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:dd0052e9db3474df30433f83a71b9b23bd9e4ef1de13d92df21a52c0303b8ab6"}, + {file = "pillow-11.1.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:837060a8599b8f5d402e97197d4924f05a2e0d68756998345c829c33186217b1"}, + {file = "pillow-11.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:aa8dd43daa836b9a8128dbe7d923423e5ad86f50a7a14dc688194b7be5c0dea2"}, + {file = "pillow-11.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0a2f91f8a8b367e7a57c6e91cd25af510168091fb89ec5146003e424e1558a96"}, + {file = "pillow-11.1.0-cp311-cp311-win32.whl", hash = "sha256:c12fc111ef090845de2bb15009372175d76ac99969bdf31e2ce9b42e4b8cd88f"}, + {file = "pillow-11.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:fbd43429d0d7ed6533b25fc993861b8fd512c42d04514a0dd6337fb3ccf22761"}, + {file = "pillow-11.1.0-cp311-cp311-win_arm64.whl", hash = "sha256:f7955ecf5609dee9442cbface754f2c6e541d9e6eda87fad7f7a989b0bdb9d71"}, + {file = "pillow-11.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2062ffb1d36544d42fcaa277b069c88b01bb7298f4efa06731a7fd6cc290b81a"}, + {file = "pillow-11.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a85b653980faad27e88b141348707ceeef8a1186f75ecc600c395dcac19f385b"}, + {file = "pillow-11.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9409c080586d1f683df3f184f20e36fb647f2e0bc3988094d4fd8c9f4eb1b3b3"}, + {file = "pillow-11.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fdadc077553621911f27ce206ffcbec7d3f8d7b50e0da39f10997e8e2bb7f6a"}, + {file = "pillow-11.1.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:93a18841d09bcdd774dcdc308e4537e1f867b3dec059c131fde0327899734aa1"}, + {file = "pillow-11.1.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:9aa9aeddeed452b2f616ff5507459e7bab436916ccb10961c4a382cd3e03f47f"}, + {file = "pillow-11.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3cdcdb0b896e981678eee140d882b70092dac83ac1cdf6b3a60e2216a73f2b91"}, + {file = "pillow-11.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:36ba10b9cb413e7c7dfa3e189aba252deee0602c86c309799da5a74009ac7a1c"}, + {file = "pillow-11.1.0-cp312-cp312-win32.whl", hash = "sha256:cfd5cd998c2e36a862d0e27b2df63237e67273f2fc78f47445b14e73a810e7e6"}, + {file = "pillow-11.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a697cd8ba0383bba3d2d3ada02b34ed268cb548b369943cd349007730c92bddf"}, + {file = "pillow-11.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:4dd43a78897793f60766563969442020e90eb7847463eca901e41ba186a7d4a5"}, + {file = "pillow-11.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ae98e14432d458fc3de11a77ccb3ae65ddce70f730e7c76140653048c71bfcbc"}, + {file = "pillow-11.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cc1331b6d5a6e144aeb5e626f4375f5b7ae9934ba620c0ac6b3e43d5e683a0f0"}, + {file = "pillow-11.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:758e9d4ef15d3560214cddbc97b8ef3ef86ce04d62ddac17ad39ba87e89bd3b1"}, + {file = "pillow-11.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b523466b1a31d0dcef7c5be1f20b942919b62fd6e9a9be199d035509cbefc0ec"}, + {file = "pillow-11.1.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:9044b5e4f7083f209c4e35aa5dd54b1dd5b112b108648f5c902ad586d4f945c5"}, + {file = "pillow-11.1.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:3764d53e09cdedd91bee65c2527815d315c6b90d7b8b79759cc48d7bf5d4f114"}, + {file = "pillow-11.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:31eba6bbdd27dde97b0174ddf0297d7a9c3a507a8a1480e1e60ef914fe23d352"}, + {file = "pillow-11.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b5d658fbd9f0d6eea113aea286b21d3cd4d3fd978157cbf2447a6035916506d3"}, + {file = "pillow-11.1.0-cp313-cp313-win32.whl", hash = "sha256:f86d3a7a9af5d826744fabf4afd15b9dfef44fe69a98541f666f66fbb8d3fef9"}, + {file = "pillow-11.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:593c5fd6be85da83656b93ffcccc2312d2d149d251e98588b14fbc288fd8909c"}, + {file = "pillow-11.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:11633d58b6ee5733bde153a8dafd25e505ea3d32e261accd388827ee987baf65"}, + {file = "pillow-11.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:70ca5ef3b3b1c4a0812b5c63c57c23b63e53bc38e758b37a951e5bc466449861"}, + {file = "pillow-11.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:8000376f139d4d38d6851eb149b321a52bb8893a88dae8ee7d95840431977081"}, + {file = "pillow-11.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ee85f0696a17dd28fbcfceb59f9510aa71934b483d1f5601d1030c3c8304f3c"}, + {file = "pillow-11.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:dd0e081319328928531df7a0e63621caf67652c8464303fd102141b785ef9547"}, + {file = "pillow-11.1.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:e63e4e5081de46517099dc30abe418122f54531a6ae2ebc8680bcd7096860eab"}, + {file = "pillow-11.1.0-cp313-cp313t-win32.whl", hash = "sha256:dda60aa465b861324e65a78c9f5cf0f4bc713e4309f83bc387be158b077963d9"}, + {file = "pillow-11.1.0-cp313-cp313t-win_amd64.whl", hash = "sha256:ad5db5781c774ab9a9b2c4302bbf0c1014960a0a7be63278d13ae6fdf88126fe"}, + {file = "pillow-11.1.0-cp313-cp313t-win_arm64.whl", hash = "sha256:67cd427c68926108778a9005f2a04adbd5e67c442ed21d95389fe1d595458756"}, + {file = "pillow-11.1.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:bf902d7413c82a1bfa08b06a070876132a5ae6b2388e2712aab3a7cbc02205c6"}, + {file = "pillow-11.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c1eec9d950b6fe688edee07138993e54ee4ae634c51443cfb7c1e7613322718e"}, + {file = "pillow-11.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e275ee4cb11c262bd108ab2081f750db2a1c0b8c12c1897f27b160c8bd57bbc"}, + {file = "pillow-11.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4db853948ce4e718f2fc775b75c37ba2efb6aaea41a1a5fc57f0af59eee774b2"}, + {file = "pillow-11.1.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:ab8a209b8485d3db694fa97a896d96dd6533d63c22829043fd9de627060beade"}, + {file = "pillow-11.1.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:54251ef02a2309b5eec99d151ebf5c9904b77976c8abdcbce7891ed22df53884"}, + {file = "pillow-11.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5bb94705aea800051a743aa4874bb1397d4695fb0583ba5e425ee0328757f196"}, + {file = "pillow-11.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:89dbdb3e6e9594d512780a5a1c42801879628b38e3efc7038094430844e271d8"}, + {file = "pillow-11.1.0-cp39-cp39-win32.whl", hash = "sha256:e5449ca63da169a2e6068dd0e2fcc8d91f9558aba89ff6d02121ca8ab11e79e5"}, + {file = "pillow-11.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:3362c6ca227e65c54bf71a5f88b3d4565ff1bcbc63ae72c34b07bbb1cc59a43f"}, + {file = "pillow-11.1.0-cp39-cp39-win_arm64.whl", hash = "sha256:b20be51b37a75cc54c2c55def3fa2c65bb94ba859dde241cd0a4fd302de5ae0a"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:8c730dc3a83e5ac137fbc92dfcfe1511ce3b2b5d7578315b63dbbb76f7f51d90"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:7d33d2fae0e8b170b6a6c57400e077412240f6f5bb2a342cf1ee512a787942bb"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a8d65b38173085f24bc07f8b6c505cbb7418009fa1a1fcb111b1f4961814a442"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:015c6e863faa4779251436db398ae75051469f7c903b043a48f078e437656f83"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d44ff19eea13ae4acdaaab0179fa68c0c6f2f45d66a4d8ec1eda7d6cecbcc15f"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:d3d8da4a631471dfaf94c10c85f5277b1f8e42ac42bade1ac67da4b4a7359b73"}, + {file = "pillow-11.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:4637b88343166249fe8aa94e7c4a62a180c4b3898283bb5d3d2fd5fe10d8e4e0"}, + {file = "pillow-11.1.0.tar.gz", hash = "sha256:368da70808b36d73b4b390a8ffac11069f8a5c85f29eff1f1b01bcf3ef5b2a20"}, +] + +[package.extras] +docs = ["furo", "olefile", "sphinx (>=8.1)", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph"] +fpx = ["olefile"] +mic = ["olefile"] +tests = ["check-manifest", "coverage (>=7.4.2)", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout", "trove-classifiers (>=2024.10.12)"] +typing = ["typing-extensions"] +xmp = ["defusedxml"] + +[[package]] +name = "platformdirs" +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] + +[[package]] +name = "playwright" +version = "1.50.0" +description = "A high-level API to automate web browsers" +optional = false +python-versions = ">=3.9" +files = [ + {file = "playwright-1.50.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:f36d754a6c5bd9bf7f14e8f57a2aea6fd08f39ca4c8476481b9c83e299531148"}, + {file = "playwright-1.50.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:40f274384591dfd27f2b014596250b2250c843ed1f7f4ef5d2960ecb91b4961e"}, + {file = "playwright-1.50.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:9922ef9bcd316995f01e220acffd2d37a463b4ad10fd73e388add03841dfa230"}, + {file = "playwright-1.50.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:8fc628c492d12b13d1f347137b2ac6c04f98197ff0985ef0403a9a9ee0d39131"}, + {file = "playwright-1.50.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcff35f72db2689a79007aee78f1b0621a22e6e3d6c1f58aaa9ac805bf4497c"}, + {file = "playwright-1.50.0-py3-none-win32.whl", hash = "sha256:3b906f4d351260016a8c5cc1e003bb341651ae682f62213b50168ed581c7558a"}, + {file = "playwright-1.50.0-py3-none-win_amd64.whl", hash = "sha256:1859423da82de631704d5e3d88602d755462b0906824c1debe140979397d2e8d"}, +] + +[package.dependencies] +greenlet = ">=3.1.1,<4.0.0" +pyee = ">=12,<13" + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pre-commit" +version = "4.1.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +optional = false +python-versions = ">=3.9" +files = [ + {file = "pre_commit-4.1.0-py2.py3-none-any.whl", hash = "sha256:d29e7cb346295bcc1cc75fc3e92e343495e3ea0196c9ec6ba53f49f10ab6ae7b"}, + {file = "pre_commit-4.1.0.tar.gz", hash = "sha256:ae3f018575a588e30dfddfab9a05448bfbd6b73d78709617b5a2b853549716d4"}, +] + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" + +[[package]] +name = "psutil" +version = "6.1.1" +description = "Cross-platform lib for process and system monitoring in Python." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "psutil-6.1.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:9ccc4316f24409159897799b83004cb1e24f9819b0dcf9c0b68bdcb6cefee6a8"}, + {file = "psutil-6.1.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:ca9609c77ea3b8481ab005da74ed894035936223422dc591d6772b147421f777"}, + {file = "psutil-6.1.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:8df0178ba8a9e5bc84fed9cfa61d54601b371fbec5c8eebad27575f1e105c0d4"}, + {file = "psutil-6.1.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:1924e659d6c19c647e763e78670a05dbb7feaf44a0e9c94bf9e14dfc6ba50468"}, + {file = "psutil-6.1.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:018aeae2af92d943fdf1da6b58665124897cfc94faa2ca92098838f83e1b1bca"}, + {file = "psutil-6.1.1-cp27-none-win32.whl", hash = "sha256:6d4281f5bbca041e2292be3380ec56a9413b790579b8e593b1784499d0005dac"}, + {file = "psutil-6.1.1-cp27-none-win_amd64.whl", hash = "sha256:c777eb75bb33c47377c9af68f30e9f11bc78e0f07fbf907be4a5d70b2fe5f030"}, + {file = "psutil-6.1.1-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:fc0ed7fe2231a444fc219b9c42d0376e0a9a1a72f16c5cfa0f68d19f1a0663e8"}, + {file = "psutil-6.1.1-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:0bdd4eab935276290ad3cb718e9809412895ca6b5b334f5a9111ee6d9aff9377"}, + {file = "psutil-6.1.1-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b6e06c20c05fe95a3d7302d74e7097756d4ba1247975ad6905441ae1b5b66003"}, + {file = "psutil-6.1.1-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97f7cb9921fbec4904f522d972f0c0e1f4fabbdd4e0287813b21215074a0f160"}, + {file = "psutil-6.1.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:33431e84fee02bc84ea36d9e2c4a6d395d479c9dd9bba2376c1f6ee8f3a4e0b3"}, + {file = "psutil-6.1.1-cp36-cp36m-win32.whl", hash = "sha256:384636b1a64b47814437d1173be1427a7c83681b17a450bfc309a1953e329603"}, + {file = "psutil-6.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:8be07491f6ebe1a693f17d4f11e69d0dc1811fa082736500f649f79df7735303"}, + {file = "psutil-6.1.1-cp37-abi3-win32.whl", hash = "sha256:eaa912e0b11848c4d9279a93d7e2783df352b082f40111e078388701fd479e53"}, + {file = "psutil-6.1.1-cp37-abi3-win_amd64.whl", hash = "sha256:f35cfccb065fff93529d2afb4a2e89e363fe63ca1e4a5da22b603a85833c2649"}, + {file = "psutil-6.1.1.tar.gz", hash = "sha256:cf8496728c18f2d0b45198f06895be52f36611711746b7f30c464b422b50e2f5"}, +] + +[package.extras] +dev = ["abi3audit", "black", "check-manifest", "coverage", "packaging", "pylint", "pyperf", "pypinfo", "pytest-cov", "requests", "rstcheck", "ruff", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "virtualenv", "vulture", "wheel"] +test = ["pytest", "pytest-xdist", "setuptools"] + +[[package]] +name = "pushbullet-py" +version = "0.12.0" +description = "A simple python client for pushbullet.com" +optional = false +python-versions = "*" +files = [ + {file = "pushbullet.py-0.12.0-py2.py3-none-any.whl", hash = "sha256:38e3ce79843efaf839c8dc43485c0c7eedbe5825a8751751f13d041dd00c5a37"}, + {file = "pushbullet.py-0.12.0.tar.gz", hash = "sha256:917883e1af4a0c979ce46076b391e0243eb8fe0a81c086544bcfa10f53e5ae64"}, +] + +[package.dependencies] +python-magic = "*" +requests = ">=1.0.0" +websocket-client = ">=0.53.0" + +[[package]] +name = "pycparser" +version = "2.22" +description = "C parser in Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, + {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, +] + +[[package]] +name = "pydantic" +version = "2.9.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, + {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.23.4" +typing-extensions = [ + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, +] + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.23.4" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, + {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, + {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, + {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, + {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, + {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, + {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, + {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, + {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, + {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, + {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, + {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, + {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, + {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pyee" +version = "12.1.1" +description = "A rough port of Node.js's EventEmitter to Python with a few tricks of its own" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyee-12.1.1-py3-none-any.whl", hash = "sha256:18a19c650556bb6b32b406d7f017c8f513aceed1ef7ca618fb65de7bd2d347ef"}, + {file = "pyee-12.1.1.tar.gz", hash = "sha256:bbc33c09e2ff827f74191e3e5bbc6be7da02f627b7ec30d86f5ce1a6fb2424a3"}, +] + +[package.dependencies] +typing-extensions = "*" + +[package.extras] +dev = ["black", "build", "flake8", "flake8-black", "isort", "jupyter-console", "mkdocs", "mkdocs-include-markdown-plugin", "mkdocstrings[python]", "pytest", "pytest-asyncio", "pytest-trio", "sphinx", "toml", "tox", "trio", "trio", "trio-typing", "twine", "twisted", "validate-pyproject[all]"] + +[[package]] +name = "pygments" +version = "2.19.1" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, + {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pynput" +version = "1.8.0" +description = "Monitor and control user input devices" +optional = false +python-versions = "*" +files = [ + {file = "pynput-1.8.0-py2.py3-none-any.whl", hash = "sha256:dc660dc93cb03cf58141e54ed575667032841846801f3dc3c4c719d4209c7e5c"}, +] + +[package.dependencies] +evdev = {version = ">=1.3", markers = "sys_platform in \"linux\""} +pyobjc-framework-ApplicationServices = {version = ">=8.0", markers = "sys_platform == \"darwin\""} +pyobjc-framework-Quartz = {version = ">=8.0", markers = "sys_platform == \"darwin\""} +python-xlib = {version = ">=0.17", markers = "sys_platform in \"linux\""} +six = "*" + +[[package]] +name = "pyobjc-core" +version = "11.0" +description = "Python<->ObjC Interoperability Module" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyobjc_core-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:10866b3a734d47caf48e456eea0d4815c2c9b21856157db5917b61dee06893a1"}, + {file = "pyobjc_core-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:50675c0bb8696fe960a28466f9baf6943df2928a1fd85625d678fa2f428bd0bd"}, + {file = "pyobjc_core-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a03061d4955c62ddd7754224a80cdadfdf17b6b5f60df1d9169a3b1b02923f0b"}, + {file = "pyobjc_core-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c338c1deb7ab2e9436d4175d1127da2eeed4a1b564b3d83b9f3ae4844ba97e86"}, + {file = "pyobjc_core-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b4e9dc4296110f251a4033ff3f40320b35873ea7f876bd29a1c9705bb5e08c59"}, + {file = "pyobjc_core-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:02406ece449d0f41b31e579e47ca77ced3eb57533df955281bfcecc99da74fba"}, + {file = "pyobjc_core-11.0.tar.gz", hash = "sha256:63bced211cb8a8fb5c8ff46473603da30e51112861bd02c438fbbbc8578d9a70"}, +] + +[[package]] +name = "pyobjc-framework-applicationservices" +version = "11.0" +description = "Wrappers for the framework ApplicationServices on macOS" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyobjc_framework_ApplicationServices-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:bc8f34b5b59ffd3c210ae883d794345c1197558ff3da0f5800669cf16435271e"}, + {file = "pyobjc_framework_ApplicationServices-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61a99eef23abb704257310db4f5271137707e184768f6407030c01de4731b67b"}, + {file = "pyobjc_framework_ApplicationServices-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:5fbeb425897d6129471d451ec61a29ddd5b1386eb26b1dd49cb313e34616ee21"}, + {file = "pyobjc_framework_ApplicationServices-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:59becf3cd87a4f4cedf4be02ff6cf46ed736f5c1123ce629f788aaafad91eff0"}, + {file = "pyobjc_framework_ApplicationServices-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:44b466e8745fb49e8ac20f29f2ffd7895b45e97aa63a844b2a80a97c3a34346f"}, + {file = "pyobjc_framework_ApplicationServices-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:74963e15a751d1454c1b8060914f116956e3a68f6a117c2163f491609125283b"}, + {file = "pyobjc_framework_applicationservices-11.0.tar.gz", hash = "sha256:d6ea18dfc7d5626a3ecf4ac72d510405c0d3a648ca38cae8db841acdebecf4d2"}, +] + +[package.dependencies] +pyobjc-core = ">=11.0" +pyobjc-framework-Cocoa = ">=11.0" +pyobjc-framework-CoreText = ">=11.0" +pyobjc-framework-Quartz = ">=11.0" + +[[package]] +name = "pyobjc-framework-cocoa" +version = "11.0" +description = "Wrappers for the Cocoa frameworks on macOS" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyobjc_framework_Cocoa-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fbc65f260d617d5463c7fb9dbaaffc23c9a4fabfe3b1a50b039b61870b8daefd"}, + {file = "pyobjc_framework_Cocoa-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3ea7be6e6dd801b297440de02d312ba3fa7fd3c322db747ae1cb237e975f5d33"}, + {file = "pyobjc_framework_Cocoa-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:280a577b83c68175a28b2b7138d1d2d3111f2b2b66c30e86f81a19c2b02eae71"}, + {file = "pyobjc_framework_Cocoa-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:15b2bd977ed340074f930f1330f03d42912d5882b697d78bd06f8ebe263ef92e"}, + {file = "pyobjc_framework_Cocoa-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:5750001db544e67f2b66f02067d8f0da96bb2ef71732bde104f01b8628f9d7ea"}, + {file = "pyobjc_framework_Cocoa-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:ddff25b0755d59873d186e1e07d6aaddb19d55e3ae890d69ff2d9babf8627657"}, + {file = "pyobjc_framework_cocoa-11.0.tar.gz", hash = "sha256:00346a8cb81ad7b017b32ff7bf596000f9faa905807b1bd234644ebd47f692c5"}, +] + +[package.dependencies] +pyobjc-core = ">=11.0" + +[[package]] +name = "pyobjc-framework-coretext" +version = "11.0" +description = "Wrappers for the framework CoreText on macOS" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyobjc_framework_CoreText-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6939b4ea745b349b5c964823a2071f155f5defdc9b9fc3a13f036d859d7d0439"}, + {file = "pyobjc_framework_CoreText-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:56a4889858308b0d9f147d568b4d91c441cc0ffd332497cb4f709bb1990450c1"}, + {file = "pyobjc_framework_CoreText-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:fb90e7f370b3fd7cb2fb442e3dc63fedf0b4af6908db1c18df694d10dc94669d"}, + {file = "pyobjc_framework_CoreText-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7947f755782456bd663e0b00c7905eeffd10f839f0bf2af031f68ded6a1ea360"}, + {file = "pyobjc_framework_CoreText-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:5356116bae33ec49f1f212c301378a7d08000440a2d6a7281aab351945528ab9"}, + {file = "pyobjc_framework_CoreText-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4a76e1307747f2ee8180d38844cd62b8bb1701b4203d9234cc41f6603d4ae654"}, + {file = "pyobjc_framework_coretext-11.0.tar.gz", hash = "sha256:a68437153e627847e3898754dd3f13ae0cb852246b016a91f9c9cbccb9f91a43"}, +] + +[package.dependencies] +pyobjc-core = ">=11.0" +pyobjc-framework-Cocoa = ">=11.0" +pyobjc-framework-Quartz = ">=11.0" + +[[package]] +name = "pyobjc-framework-quartz" +version = "11.0" +description = "Wrappers for the Quartz frameworks on macOS" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyobjc_framework_Quartz-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:da3ab13c9f92361959b41b0ad4cdd41ae872f90a6d8c58a9ed699bc08ab1c45c"}, + {file = "pyobjc_framework_Quartz-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d251696bfd8e8ef72fbc90eb29fec95cb9d1cc409008a183d5cc3246130ae8c2"}, + {file = "pyobjc_framework_Quartz-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:cb4a9f2d9d580ea15e25e6b270f47681afb5689cafc9e25712445ce715bcd18e"}, + {file = "pyobjc_framework_Quartz-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:973b4f9b8ab844574461a038bd5269f425a7368d6e677e3cc81fcc9b27b65498"}, + {file = "pyobjc_framework_Quartz-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:66ab58d65348863b8707e63b2ec5cdc54569ee8189d1af90d52f29f5fdf6272c"}, + {file = "pyobjc_framework_Quartz-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1032f63f2a4ee98366764e69c249f1d93813821e17d224cf626cf11fb1801fc4"}, + {file = "pyobjc_framework_quartz-11.0.tar.gz", hash = "sha256:3205bf7795fb9ae34747f701486b3db6dfac71924894d1f372977c4d70c3c619"}, +] + +[package.dependencies] +pyobjc-core = ">=11.0" +pyobjc-framework-Cocoa = ">=11.0" + +[[package]] +name = "pyparsing" +version = "3.2.1" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyparsing-3.2.1-py3-none-any.whl", hash = "sha256:506ff4f4386c4cec0590ec19e6302d3aedb992fdc02c761e90416f158dacf8e1"}, + {file = "pyparsing-3.2.1.tar.gz", hash = "sha256:61980854fd66de3a90028d679a954d5f2623e83144b5afe5ee86f43d762e5f0a"}, +] + +[package.extras] +diagrams = ["jinja2", "railroad-diagrams"] + +[[package]] +name = "pytest" +version = "8.3.5" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"}, + {file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-base-url" +version = "2.1.0" +description = "pytest plugin for URL based testing" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_base_url-2.1.0-py3-none-any.whl", hash = "sha256:3ad15611778764d451927b2a53240c1a7a591b521ea44cebfe45849d2d2812e6"}, + {file = "pytest_base_url-2.1.0.tar.gz", hash = "sha256:02748589a54f9e63fcbe62301d6b0496da0d10231b753e950c63e03aee745d45"}, +] + +[package.dependencies] +pytest = ">=7.0.0" +requests = ">=2.9" + +[package.extras] +test = ["black (>=22.1.0)", "flake8 (>=4.0.1)", "pre-commit (>=2.17.0)", "pytest-localserver (>=0.7.1)", "tox (>=3.24.5)"] + +[[package]] +name = "pytest-cov" +version = "6.0.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.9" +files = [ + {file = "pytest-cov-6.0.0.tar.gz", hash = "sha256:fde0b595ca248bb8e2d76f020b465f3b107c9632e6a1d1705f17834c89dcadc0"}, + {file = "pytest_cov-6.0.0-py3-none-any.whl", hash = "sha256:eee6f1b9e61008bd34975a4d5bab25801eb31898b032dd55addc93e96fcaaa35"}, +] + +[package.dependencies] +coverage = {version = ">=7.5", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] + +[[package]] +name = "pytest-playwright" +version = "0.7.0" +description = "A pytest wrapper with fixtures for Playwright to automate web browsers" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pytest_playwright-0.7.0-py3-none-any.whl", hash = "sha256:2516d0871fa606634bfe32afbcc0342d68da2dbff97fe3459849e9c428486da2"}, + {file = "pytest_playwright-0.7.0.tar.gz", hash = "sha256:b3f2ea514bbead96d26376fac182f68dcd6571e7cb41680a89ff1673c05d60b6"}, +] + +[package.dependencies] +playwright = ">=1.18" +pytest = ">=6.2.4,<9.0.0" +pytest-base-url = ">=1.0.0,<3.0.0" +python-slugify = ">=6.0.0,<9.0.0" + +[[package]] +name = "python-magic" +version = "0.4.27" +description = "File type identification using libmagic" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "python-magic-0.4.27.tar.gz", hash = "sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b"}, + {file = "python_magic-0.4.27-py2.py3-none-any.whl", hash = "sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3"}, +] + +[[package]] +name = "python-slugify" +version = "8.0.4" +description = "A Python slugify application that also handles Unicode" +optional = false +python-versions = ">=3.7" +files = [ + {file = "python-slugify-8.0.4.tar.gz", hash = "sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856"}, + {file = "python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8"}, +] + +[package.dependencies] +text-unidecode = ">=1.3" + +[package.extras] +unidecode = ["Unidecode (>=1.1.1)"] + +[[package]] +name = "python-xlib" +version = "0.33" +description = "Python X Library" +optional = false +python-versions = "*" +files = [ + {file = "python-xlib-0.33.tar.gz", hash = "sha256:55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32"}, + {file = "python_xlib-0.33-py2.py3-none-any.whl", hash = "sha256:c3534038d42e0df2f1392a1b30a15a4ff5fdc2b86cfa94f072bf11b10a164398"}, +] + +[package.dependencies] +six = ">=1.10.0" + +[[package]] +name = "pyyaml" +version = "6.0.2" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, +] + +[[package]] +name = "recommonmark" +version = "0.7.1" +description = "A docutils-compatibility bridge to CommonMark, enabling you to write CommonMark inside of Docutils & Sphinx projects." +optional = false +python-versions = "*" +files = [ + {file = "recommonmark-0.7.1-py2.py3-none-any.whl", hash = "sha256:1b1db69af0231efce3fa21b94ff627ea33dee7079a01dd0a7f8482c3da148b3f"}, + {file = "recommonmark-0.7.1.tar.gz", hash = "sha256:bdb4db649f2222dcd8d2d844f0006b958d627f732415d399791ee436a3686d67"}, +] + +[package.dependencies] +commonmark = ">=0.8.1" +docutils = ">=0.11" +sphinx = ">=1.3.1" + +[[package]] +name = "regex" +version = "2024.11.6" +description = "Alternative regular expression module, to replace re." +optional = false +python-versions = ">=3.8" +files = [ + {file = "regex-2024.11.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ff590880083d60acc0433f9c3f713c51f7ac6ebb9adf889c79a261ecf541aa91"}, + {file = "regex-2024.11.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:658f90550f38270639e83ce492f27d2c8d2cd63805c65a13a14d36ca126753f0"}, + {file = "regex-2024.11.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:164d8b7b3b4bcb2068b97428060b2a53be050085ef94eca7f240e7947f1b080e"}, + {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3660c82f209655a06b587d55e723f0b813d3a7db2e32e5e7dc64ac2a9e86fde"}, + {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d22326fcdef5e08c154280b71163ced384b428343ae16a5ab2b3354aed12436e"}, + {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac758ef6aebfc8943560194e9fd0fa18bcb34d89fd8bd2af18183afd8da3a2"}, + {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:997d6a487ff00807ba810e0f8332c18b4eb8d29463cfb7c820dc4b6e7562d0cf"}, + {file = "regex-2024.11.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:02a02d2bb04fec86ad61f3ea7f49c015a0681bf76abb9857f945d26159d2968c"}, + {file = "regex-2024.11.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f02f93b92358ee3f78660e43b4b0091229260c5d5c408d17d60bf26b6c900e86"}, + {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06eb1be98df10e81ebaded73fcd51989dcf534e3c753466e4b60c4697a003b67"}, + {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:040df6fe1a5504eb0f04f048e6d09cd7c7110fef851d7c567a6b6e09942feb7d"}, + {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabbfc59f2c6edba2a6622c647b716e34e8e3867e0ab975412c5c2f79b82da2"}, + {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8447d2d39b5abe381419319f942de20b7ecd60ce86f16a23b0698f22e1b70008"}, + {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:da8f5fc57d1933de22a9e23eec290a0d8a5927a5370d24bda9a6abe50683fe62"}, + {file = "regex-2024.11.6-cp310-cp310-win32.whl", hash = "sha256:b489578720afb782f6ccf2840920f3a32e31ba28a4b162e13900c3e6bd3f930e"}, + {file = "regex-2024.11.6-cp310-cp310-win_amd64.whl", hash = "sha256:5071b2093e793357c9d8b2929dfc13ac5f0a6c650559503bb81189d0a3814519"}, + {file = "regex-2024.11.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5478c6962ad548b54a591778e93cd7c456a7a29f8eca9c49e4f9a806dcc5d638"}, + {file = "regex-2024.11.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c89a8cc122b25ce6945f0423dc1352cb9593c68abd19223eebbd4e56612c5b7"}, + {file = "regex-2024.11.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94d87b689cdd831934fa3ce16cc15cd65748e6d689f5d2b8f4f4df2065c9fa20"}, + {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1062b39a0a2b75a9c694f7a08e7183a80c63c0d62b301418ffd9c35f55aaa114"}, + {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:167ed4852351d8a750da48712c3930b031f6efdaa0f22fa1933716bfcd6bf4a3"}, + {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d548dafee61f06ebdb584080621f3e0c23fff312f0de1afc776e2a2ba99a74f"}, + {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2a19f302cd1ce5dd01a9099aaa19cae6173306d1302a43b627f62e21cf18ac0"}, + {file = "regex-2024.11.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bec9931dfb61ddd8ef2ebc05646293812cb6b16b60cf7c9511a832b6f1854b55"}, + {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9714398225f299aa85267fd222f7142fcb5c769e73d7733344efc46f2ef5cf89"}, + {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:202eb32e89f60fc147a41e55cb086db2a3f8cb82f9a9a88440dcfc5d37faae8d"}, + {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:4181b814e56078e9b00427ca358ec44333765f5ca1b45597ec7446d3a1ef6e34"}, + {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:068376da5a7e4da51968ce4c122a7cd31afaaec4fccc7856c92f63876e57b51d"}, + {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f2c4184420d881a3475fb2c6f4d95d53a8d50209a2500723d831036f7c45"}, + {file = "regex-2024.11.6-cp311-cp311-win32.whl", hash = "sha256:c36f9b6f5f8649bb251a5f3f66564438977b7ef8386a52460ae77e6070d309d9"}, + {file = "regex-2024.11.6-cp311-cp311-win_amd64.whl", hash = "sha256:02e28184be537f0e75c1f9b2f8847dc51e08e6e171c6bde130b2687e0c33cf60"}, + {file = "regex-2024.11.6-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:52fb28f528778f184f870b7cf8f225f5eef0a8f6e3778529bdd40c7b3920796a"}, + {file = "regex-2024.11.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fdd6028445d2460f33136c55eeb1f601ab06d74cb3347132e1c24250187500d9"}, + {file = "regex-2024.11.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:805e6b60c54bf766b251e94526ebad60b7de0c70f70a4e6210ee2891acb70bf2"}, + {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b85c2530be953a890eaffde05485238f07029600e8f098cdf1848d414a8b45e4"}, + {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb26437975da7dc36b7efad18aa9dd4ea569d2357ae6b783bf1118dabd9ea577"}, + {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abfa5080c374a76a251ba60683242bc17eeb2c9818d0d30117b4486be10c59d3"}, + {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b7fa6606c2881c1db9479b0eaa11ed5dfa11c8d60a474ff0e095099f39d98e"}, + {file = "regex-2024.11.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0c32f75920cf99fe6b6c539c399a4a128452eaf1af27f39bce8909c9a3fd8cbe"}, + {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:982e6d21414e78e1f51cf595d7f321dcd14de1f2881c5dc6a6e23bbbbd68435e"}, + {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a7c2155f790e2fb448faed6dd241386719802296ec588a8b9051c1f5c481bc29"}, + {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:149f5008d286636e48cd0b1dd65018548944e495b0265b45e1bffecce1ef7f39"}, + {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e5364a4502efca094731680e80009632ad6624084aff9a23ce8c8c6820de3e51"}, + {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0a86e7eeca091c09e021db8eb72d54751e527fa47b8d5787caf96d9831bd02ad"}, + {file = "regex-2024.11.6-cp312-cp312-win32.whl", hash = "sha256:32f9a4c643baad4efa81d549c2aadefaeba12249b2adc5af541759237eee1c54"}, + {file = "regex-2024.11.6-cp312-cp312-win_amd64.whl", hash = "sha256:a93c194e2df18f7d264092dc8539b8ffb86b45b899ab976aa15d48214138e81b"}, + {file = "regex-2024.11.6-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a6ba92c0bcdf96cbf43a12c717eae4bc98325ca3730f6b130ffa2e3c3c723d84"}, + {file = "regex-2024.11.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:525eab0b789891ac3be914d36893bdf972d483fe66551f79d3e27146191a37d4"}, + {file = "regex-2024.11.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:086a27a0b4ca227941700e0b31425e7a28ef1ae8e5e05a33826e17e47fbfdba0"}, + {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bde01f35767c4a7899b7eb6e823b125a64de314a8ee9791367c9a34d56af18d0"}, + {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b583904576650166b3d920d2bcce13971f6f9e9a396c673187f49811b2769dc7"}, + {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c4de13f06a0d54fa0d5ab1b7138bfa0d883220965a29616e3ea61b35d5f5fc7"}, + {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cde6e9f2580eb1665965ce9bf17ff4952f34f5b126beb509fee8f4e994f143c"}, + {file = "regex-2024.11.6-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d7f453dca13f40a02b79636a339c5b62b670141e63efd511d3f8f73fba162b3"}, + {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:59dfe1ed21aea057a65c6b586afd2a945de04fc7db3de0a6e3ed5397ad491b07"}, + {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b97c1e0bd37c5cd7902e65f410779d39eeda155800b65fc4d04cc432efa9bc6e"}, + {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f9d1e379028e0fc2ae3654bac3cbbef81bf3fd571272a42d56c24007979bafb6"}, + {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:13291b39131e2d002a7940fb176e120bec5145f3aeb7621be6534e46251912c4"}, + {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f51f88c126370dcec4908576c5a627220da6c09d0bff31cfa89f2523843316d"}, + {file = "regex-2024.11.6-cp313-cp313-win32.whl", hash = "sha256:63b13cfd72e9601125027202cad74995ab26921d8cd935c25f09c630436348ff"}, + {file = "regex-2024.11.6-cp313-cp313-win_amd64.whl", hash = "sha256:2b3361af3198667e99927da8b84c1b010752fa4b1115ee30beaa332cabc3ef1a"}, + {file = "regex-2024.11.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:3a51ccc315653ba012774efca4f23d1d2a8a8f278a6072e29c7147eee7da446b"}, + {file = "regex-2024.11.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ad182d02e40de7459b73155deb8996bbd8e96852267879396fb274e8700190e3"}, + {file = "regex-2024.11.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ba9b72e5643641b7d41fa1f6d5abda2c9a263ae835b917348fc3c928182ad467"}, + {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40291b1b89ca6ad8d3f2b82782cc33807f1406cf68c8d440861da6304d8ffbbd"}, + {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cdf58d0e516ee426a48f7b2c03a332a4114420716d55769ff7108c37a09951bf"}, + {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a36fdf2af13c2b14738f6e973aba563623cb77d753bbbd8d414d18bfaa3105dd"}, + {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1cee317bfc014c2419a76bcc87f071405e3966da434e03e13beb45f8aced1a6"}, + {file = "regex-2024.11.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50153825ee016b91549962f970d6a4442fa106832e14c918acd1c8e479916c4f"}, + {file = "regex-2024.11.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea1bfda2f7162605f6e8178223576856b3d791109f15ea99a9f95c16a7636fb5"}, + {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:df951c5f4a1b1910f1a99ff42c473ff60f8225baa1cdd3539fe2819d9543e9df"}, + {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:072623554418a9911446278f16ecb398fb3b540147a7828c06e2011fa531e773"}, + {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f654882311409afb1d780b940234208a252322c24a93b442ca714d119e68086c"}, + {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:89d75e7293d2b3e674db7d4d9b1bee7f8f3d1609428e293771d1a962617150cc"}, + {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:f65557897fc977a44ab205ea871b690adaef6b9da6afda4790a2484b04293a5f"}, + {file = "regex-2024.11.6-cp38-cp38-win32.whl", hash = "sha256:6f44ec28b1f858c98d3036ad5d7d0bfc568bdd7a74f9c24e25f41ef1ebfd81a4"}, + {file = "regex-2024.11.6-cp38-cp38-win_amd64.whl", hash = "sha256:bb8f74f2f10dbf13a0be8de623ba4f9491faf58c24064f32b65679b021ed0001"}, + {file = "regex-2024.11.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5704e174f8ccab2026bd2f1ab6c510345ae8eac818b613d7d73e785f1310f839"}, + {file = "regex-2024.11.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:220902c3c5cc6af55d4fe19ead504de80eb91f786dc102fbd74894b1551f095e"}, + {file = "regex-2024.11.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5e7e351589da0850c125f1600a4c4ba3c722efefe16b297de54300f08d734fbf"}, + {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5056b185ca113c88e18223183aa1a50e66507769c9640a6ff75859619d73957b"}, + {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e34b51b650b23ed3354b5a07aab37034d9f923db2a40519139af34f485f77d0"}, + {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5670bce7b200273eee1840ef307bfa07cda90b38ae56e9a6ebcc9f50da9c469b"}, + {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08986dce1339bc932923e7d1232ce9881499a0e02925f7402fb7c982515419ef"}, + {file = "regex-2024.11.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93c0b12d3d3bc25af4ebbf38f9ee780a487e8bf6954c115b9f015822d3bb8e48"}, + {file = "regex-2024.11.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:764e71f22ab3b305e7f4c21f1a97e1526a25ebdd22513e251cf376760213da13"}, + {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f056bf21105c2515c32372bbc057f43eb02aae2fda61052e2f7622c801f0b4e2"}, + {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:69ab78f848845569401469da20df3e081e6b5a11cb086de3eed1d48f5ed57c95"}, + {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:86fddba590aad9208e2fa8b43b4c098bb0ec74f15718bb6a704e3c63e2cef3e9"}, + {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:684d7a212682996d21ca12ef3c17353c021fe9de6049e19ac8481ec35574a70f"}, + {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a03e02f48cd1abbd9f3b7e3586d97c8f7a9721c436f51a5245b3b9483044480b"}, + {file = "regex-2024.11.6-cp39-cp39-win32.whl", hash = "sha256:41758407fc32d5c3c5de163888068cfee69cb4c2be844e7ac517a52770f9af57"}, + {file = "regex-2024.11.6-cp39-cp39-win_amd64.whl", hash = "sha256:b2837718570f95dd41675328e111345f9b7095d821bac435aac173ac80b19983"}, + {file = "regex-2024.11.6.tar.gz", hash = "sha256:7ab159b063c52a0333c884e4679f8d7a85112ee3078fe3d9004b2dd875585519"}, +] + +[[package]] +name = "requests" +version = "2.32.3" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.8" +files = [ + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "rich" +version = "13.9.4" +description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"}, + {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"}, +] + +[package.dependencies] +markdown-it-py = ">=2.2.0" +pygments = ">=2.13.0,<3.0.0" +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.11\""} + +[package.extras] +jupyter = ["ipywidgets (>=7.5.1,<9)"] + +[[package]] +name = "ruamel-yaml" +version = "0.18.10" +description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruamel.yaml-0.18.10-py3-none-any.whl", hash = "sha256:30f22513ab2301b3d2b577adc121c6471f28734d3d9728581245f1e76468b4f1"}, + {file = "ruamel.yaml-0.18.10.tar.gz", hash = "sha256:20c86ab29ac2153f80a428e1254a8adf686d3383df04490514ca3b79a362db58"}, +] + +[package.dependencies] +"ruamel.yaml.clib" = {version = ">=0.2.7", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.13\""} + +[package.extras] +docs = ["mercurial (>5.7)", "ryd"] +jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] + +[[package]] +name = "ruamel-yaml-clib" +version = "0.2.12" +description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" +optional = false +python-versions = ">=3.9" +files = [ + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-macosx_13_0_arm64.whl", hash = "sha256:11f891336688faf5156a36293a9c362bdc7c88f03a8a027c2c1d8e0bcde998e5"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:a606ef75a60ecf3d924613892cc603b154178ee25abb3055db5062da811fd969"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd5415dded15c3822597455bc02bcd66e81ef8b7a48cb71a33628fc9fdde39df"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f66efbc1caa63c088dead1c4170d148eabc9b80d95fb75b6c92ac0aad2437d76"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:22353049ba4181685023b25b5b51a574bce33e7f51c759371a7422dcae5402a6"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:932205970b9f9991b34f55136be327501903f7c66830e9760a8ffb15b07f05cd"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a52d48f4e7bf9005e8f0a89209bf9a73f7190ddf0489eee5eb51377385f59f2a"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-win32.whl", hash = "sha256:3eac5a91891ceb88138c113f9db04f3cebdae277f5d44eaa3651a4f573e6a5da"}, + {file = "ruamel.yaml.clib-0.2.12-cp310-cp310-win_amd64.whl", hash = "sha256:ab007f2f5a87bd08ab1499bdf96f3d5c6ad4dcfa364884cb4549aa0154b13a28"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:4a6679521a58256a90b0d89e03992c15144c5f3858f40d7c18886023d7943db6"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:d84318609196d6bd6da0edfa25cedfbabd8dbde5140a0a23af29ad4b8f91fb1e"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb43a269eb827806502c7c8efb7ae7e9e9d0573257a46e8e952f4d4caba4f31e"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:811ea1594b8a0fb466172c384267a4e5e367298af6b228931f273b111f17ef52"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cf12567a7b565cbf65d438dec6cfbe2917d3c1bdddfce84a9930b7d35ea59642"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7dd5adc8b930b12c8fc5b99e2d535a09889941aa0d0bd06f4749e9a9397c71d2"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1492a6051dab8d912fc2adeef0e8c72216b24d57bd896ea607cb90bb0c4981d3"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-win32.whl", hash = "sha256:bd0a08f0bab19093c54e18a14a10b4322e1eacc5217056f3c063bd2f59853ce4"}, + {file = "ruamel.yaml.clib-0.2.12-cp311-cp311-win_amd64.whl", hash = "sha256:a274fb2cb086c7a3dea4322ec27f4cb5cc4b6298adb583ab0e211a4682f241eb"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:20b0f8dc160ba83b6dcc0e256846e1a02d044e13f7ea74a3d1d56ede4e48c632"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:943f32bc9dedb3abff9879edc134901df92cfce2c3d5c9348f172f62eb2d771d"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95c3829bb364fdb8e0332c9931ecf57d9be3519241323c5274bd82f709cebc0c"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:749c16fcc4a2b09f28843cda5a193e0283e47454b63ec4b81eaa2242f50e4ccd"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bf165fef1f223beae7333275156ab2022cffe255dcc51c27f066b4370da81e31"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:32621c177bbf782ca5a18ba4d7af0f1082a3f6e517ac2a18b3974d4edf349680"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b82a7c94a498853aa0b272fd5bc67f29008da798d4f93a2f9f289feb8426a58d"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-win32.whl", hash = "sha256:e8c4ebfcfd57177b572e2040777b8abc537cdef58a2120e830124946aa9b42c5"}, + {file = "ruamel.yaml.clib-0.2.12-cp312-cp312-win_amd64.whl", hash = "sha256:0467c5965282c62203273b838ae77c0d29d7638c8a4e3a1c8bdd3602c10904e4"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:4c8c5d82f50bb53986a5e02d1b3092b03622c02c2eb78e29bec33fd9593bae1a"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux2014_aarch64.whl", hash = "sha256:e7e3736715fbf53e9be2a79eb4db68e4ed857017344d697e8b9749444ae57475"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b7e75b4965e1d4690e93021adfcecccbca7d61c7bddd8e22406ef2ff20d74ef"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96777d473c05ee3e5e3c3e999f5d23c6f4ec5b0c38c098b3a5229085f74236c6"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:3bc2a80e6420ca8b7d3590791e2dfc709c88ab9152c00eeb511c9875ce5778bf"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e188d2699864c11c36cdfdada94d781fd5d6b0071cd9c427bceb08ad3d7c70e1"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4f6f3eac23941b32afccc23081e1f50612bdbe4e982012ef4f5797986828cd01"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-win32.whl", hash = "sha256:6442cb36270b3afb1b4951f060eccca1ce49f3d087ca1ca4563a6eb479cb3de6"}, + {file = "ruamel.yaml.clib-0.2.12-cp313-cp313-win_amd64.whl", hash = "sha256:e5b8daf27af0b90da7bb903a876477a9e6d7270be6146906b276605997c7e9a3"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:fc4b630cd3fa2cf7fce38afa91d7cfe844a9f75d7f0f36393fa98815e911d987"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bc5f1e1c28e966d61d2519f2a3d451ba989f9ea0f2307de7bc45baa526de9e45"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a0e060aace4c24dcaf71023bbd7d42674e3b230f7e7b97317baf1e953e5b519"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2f1c3765db32be59d18ab3953f43ab62a761327aafc1594a2a1fbe038b8b8a7"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d85252669dc32f98ebcd5d36768f5d4faeaeaa2d655ac0473be490ecdae3c285"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e143ada795c341b56de9418c58d028989093ee611aa27ffb9b7f609c00d813ed"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2c59aa6170b990d8d2719323e628aaf36f3bfbc1c26279c0eeeb24d05d2d11c7"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-win32.whl", hash = "sha256:beffaed67936fbbeffd10966a4eb53c402fafd3d6833770516bf7314bc6ffa12"}, + {file = "ruamel.yaml.clib-0.2.12-cp39-cp39-win_amd64.whl", hash = "sha256:040ae85536960525ea62868b642bdb0c2cc6021c9f9d507810c0c604e66f5a7b"}, + {file = "ruamel.yaml.clib-0.2.12.tar.gz", hash = "sha256:6c8fbb13ec503f99a91901ab46e0b07ae7941cd527393187039aec586fdfd36f"}, +] + +[[package]] +name = "ruff" +version = "0.9.10" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.9.10-py3-none-linux_armv6l.whl", hash = "sha256:eb4d25532cfd9fe461acc83498361ec2e2252795b4f40b17e80692814329e42d"}, + {file = "ruff-0.9.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:188a6638dab1aa9bb6228a7302387b2c9954e455fb25d6b4470cb0641d16759d"}, + {file = "ruff-0.9.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5284dcac6b9dbc2fcb71fdfc26a217b2ca4ede6ccd57476f52a587451ebe450d"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47678f39fa2a3da62724851107f438c8229a3470f533894b5568a39b40029c0c"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:99713a6e2766b7a17147b309e8c915b32b07a25c9efd12ada79f217c9c778b3e"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524ee184d92f7c7304aa568e2db20f50c32d1d0caa235d8ddf10497566ea1a12"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:df92aeac30af821f9acf819fc01b4afc3dfb829d2782884f8739fb52a8119a16"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de42e4edc296f520bb84954eb992a07a0ec5a02fecb834498415908469854a52"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d257f95b65806104b6b1ffca0ea53f4ef98454036df65b1eda3693534813ecd1"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b60dec7201c0b10d6d11be00e8f2dbb6f40ef1828ee75ed739923799513db24c"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d838b60007da7a39c046fcdd317293d10b845001f38bcb55ba766c3875b01e43"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ccaf903108b899beb8e09a63ffae5869057ab649c1e9231c05ae354ebc62066c"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f9567d135265d46e59d62dc60c0bfad10e9a6822e231f5b24032dba5a55be6b5"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5f202f0d93738c28a89f8ed9eaba01b7be339e5d8d642c994347eaa81c6d75b8"}, + {file = "ruff-0.9.10-py3-none-win32.whl", hash = "sha256:bfb834e87c916521ce46b1788fbb8484966e5113c02df216680102e9eb960029"}, + {file = "ruff-0.9.10-py3-none-win_amd64.whl", hash = "sha256:f2160eeef3031bf4b17df74e307d4c5fb689a6f3a26a2de3f7ef4044e3c484f1"}, + {file = "ruff-0.9.10-py3-none-win_arm64.whl", hash = "sha256:5fd804c0327a5e5ea26615550e706942f348b197d5475ff34c19733aee4b2e69"}, + {file = "ruff-0.9.10.tar.gz", hash = "sha256:9bacb735d7bada9cfb0f2c227d3658fc443d90a727b47f206fb33f52f3c0eac7"}, +] + +[[package]] +name = "safety" +version = "3.3.1" +description = "Scan dependencies for known vulnerabilities and licenses." +optional = false +python-versions = ">=3.8" +files = [ + {file = "safety-3.3.1-py3-none-any.whl", hash = "sha256:243355a961403b873c1504e3e6f79ce36b86881d559722595632d788aa92b7ea"}, + {file = "safety-3.3.1.tar.gz", hash = "sha256:679834432d0ad64c54e0b864ac6715d4743a65f8db67512380ee7ee2011c206a"}, +] + +[package.dependencies] +authlib = ">=1.2.0" +click = ">=8.0.2" +dparse = ">=0.6.4" +filelock = ">=3.16.1,<3.17.0" +jinja2 = ">=3.1.0" +marshmallow = ">=3.15.0" +nltk = ">=3.9" +packaging = ">=21.0" +psutil = ">=6.1.0,<6.2.0" +pydantic = ">=2.6.0,<2.10.0" +requests = "*" +ruamel-yaml = ">=0.17.21" +safety-schemas = "0.0.11" +setuptools = ">=65.5.1" +typer = ">=0.12.1" +typing-extensions = ">=4.7.1" + +[package.extras] +github = ["pygithub (>=1.43.3)"] +gitlab = ["python-gitlab (>=1.3.0)"] +spdx = ["spdx-tools (>=0.8.2)"] + +[[package]] +name = "safety-schemas" +version = "0.0.11" +description = "Schemas for Safety tools" +optional = false +python-versions = ">=3.7" +files = [ + {file = "safety_schemas-0.0.11-py3-none-any.whl", hash = "sha256:2af940c1c992d6891a6b84403a7c12fd445e20651752b1818b86c205690b3e03"}, + {file = "safety_schemas-0.0.11.tar.gz", hash = "sha256:10804372e077ca5a95e740cc507e73d9173663284006fcaaf5756179ba13ac9d"}, +] + +[package.dependencies] +dparse = ">=0.6.4" +packaging = ">=21.0" +pydantic = ">=2.6.0,<2.10.0" +ruamel-yaml = ">=0.17.21" +typing-extensions = ">=4.7.1" + +[[package]] +name = "schedule" +version = "1.2.2" +description = "Job scheduling for humans." +optional = false +python-versions = ">=3.7" +files = [ + {file = "schedule-1.2.2-py3-none-any.whl", hash = "sha256:5bef4a2a0183abf44046ae0d164cadcac21b1db011bdd8102e4a0c1e91e06a7d"}, + {file = "schedule-1.2.2.tar.gz", hash = "sha256:15fe9c75fe5fd9b9627f3f19cc0ef1420508f9f9a46f45cd0769ef75ede5f0b7"}, +] + +[package.extras] +timezone = ["pytz"] + +[[package]] +name = "setuptools" +version = "76.0.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.9" +files = [ + {file = "setuptools-76.0.0-py3-none-any.whl", hash = "sha256:199466a166ff664970d0ee145839f5582cb9bca7a0a3a2e795b6a9cb2308e9c6"}, + {file = "setuptools-76.0.0.tar.gz", hash = "sha256:43b4ee60e10b0d0ee98ad11918e114c70701bc6051662a9a675a0496c1a158f4"}, +] + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.8.0)"] +core = ["importlib_metadata (>=6)", "jaraco.collections", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.14.*)", "pytest-mypy"] + +[[package]] +name = "shellingham" +version = "1.5.4" +description = "Tool to Detect Surrounding Shell" +optional = false +python-versions = ">=3.7" +files = [ + {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"}, + {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, +] + +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + +[[package]] +name = "sphinx" +version = "8.1.3" +description = "Python documentation generator" +optional = false +python-versions = ">=3.10" +files = [ + {file = "sphinx-8.1.3-py3-none-any.whl", hash = "sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2"}, + {file = "sphinx-8.1.3.tar.gz", hash = "sha256:43c1911eecb0d3e161ad78611bc905d1ad0e523e4ddc202a58a821773dc4c927"}, +] + +[package.dependencies] +alabaster = ">=0.7.14" +babel = ">=2.13" +colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} +docutils = ">=0.20,<0.22" +imagesize = ">=1.3" +Jinja2 = ">=3.1" +packaging = ">=23.0" +Pygments = ">=2.17" +requests = ">=2.30.0" +snowballstemmer = ">=2.2" +sphinxcontrib-applehelp = ">=1.0.7" +sphinxcontrib-devhelp = ">=1.0.6" +sphinxcontrib-htmlhelp = ">=2.0.6" +sphinxcontrib-jsmath = ">=1.0.1" +sphinxcontrib-qthelp = ">=1.0.6" +sphinxcontrib-serializinghtml = ">=1.1.9" +tomli = {version = ">=2", markers = "python_version < \"3.11\""} + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["flake8 (>=6.0)", "mypy (==1.11.1)", "pyright (==1.1.384)", "pytest (>=6.0)", "ruff (==0.6.9)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-Pillow (==10.2.0.20240822)", "types-Pygments (==2.18.0.20240506)", "types-colorama (==0.4.15.20240311)", "types-defusedxml (==0.7.0.20240218)", "types-docutils (==0.21.0.20241005)", "types-requests (==2.32.0.20240914)", "types-urllib3 (==1.26.25.14)"] +test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "2.0.0" +description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5"}, + {file = "sphinxcontrib_applehelp-2.0.0.tar.gz", hash = "sha256:2f29ef331735ce958efa4734873f084941970894c6090408b079c61b2e1c06d1"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "2.0.0" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2"}, + {file = "sphinxcontrib_devhelp-2.0.0.tar.gz", hash = "sha256:411f5d96d445d1d73bb5d52133377b4248ec79db5c793ce7dbe59e074b4dd1ad"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.1.0" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8"}, + {file = "sphinxcontrib_htmlhelp-2.1.0.tar.gz", hash = "sha256:c9e2916ace8aad64cc13a0d233ee22317f2b9025b9cf3295249fa985cc7082e9"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["html5lib", "pytest"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] + +[package.extras] +test = ["flake8", "mypy", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "2.0.0" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb"}, + {file = "sphinxcontrib_qthelp-2.0.0.tar.gz", hash = "sha256:4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["defusedxml (>=0.7.1)", "pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "2.0.0" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331"}, + {file = "sphinxcontrib_serializinghtml-2.0.0.tar.gz", hash = "sha256:e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "text-unidecode" +version = "1.3" +description = "The most basic Text::Unidecode port" +optional = false +python-versions = "*" +files = [ + {file = "text-unidecode-1.3.tar.gz", hash = "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93"}, + {file = "text_unidecode-1.3-py2.py3-none-any.whl", hash = "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8"}, +] + +[[package]] +name = "tomli" +version = "2.2.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, +] + +[[package]] +name = "tqdm" +version = "4.67.1" +description = "Fast, Extensible Progress Meter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2"}, + {file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +dev = ["nbval", "pytest (>=6)", "pytest-asyncio (>=0.24)", "pytest-cov", "pytest-timeout"] +discord = ["requests"] +notebook = ["ipywidgets (>=6)"] +slack = ["slack-sdk"] +telegram = ["requests"] + +[[package]] +name = "typeguard" +version = "4.4.2" +description = "Run-time type checker for Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "typeguard-4.4.2-py3-none-any.whl", hash = "sha256:77a78f11f09777aeae7fa08585f33b5f4ef0e7335af40005b0c422ed398ff48c"}, + {file = "typeguard-4.4.2.tar.gz", hash = "sha256:a6f1065813e32ef365bc3b3f503af8a96f9dd4e0033a02c28c4a4983de8c6c49"}, +] + +[package.dependencies] +typing_extensions = ">=4.10.0" + +[package.extras] +doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme (>=1.3.0)"] +test = ["coverage[toml] (>=7)", "mypy (>=1.2.0)", "pytest (>=7)"] + +[[package]] +name = "typer" +version = "0.15.2" +description = "Typer, build great CLIs. Easy to code. Based on Python type hints." +optional = false +python-versions = ">=3.7" +files = [ + {file = "typer-0.15.2-py3-none-any.whl", hash = "sha256:46a499c6107d645a9c13f7ee46c5d5096cae6f5fc57dd11eccbbb9ae3e44ddfc"}, + {file = "typer-0.15.2.tar.gz", hash = "sha256:ab2fab47533a813c49fe1f16b1a370fd5819099c00b119e0633df65f22144ba5"}, +] + +[package.dependencies] +click = ">=8.0.0" +rich = ">=10.11.0" +shellingham = ">=1.3.0" +typing-extensions = ">=3.7.4.3" + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[[package]] +name = "urllib3" +version = "2.3.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.9" +files = [ + {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, + {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "virtualenv" +version = "20.29.3" +description = "Virtual Python Environment builder" +optional = false +python-versions = ">=3.8" +files = [ + {file = "virtualenv-20.29.3-py3-none-any.whl", hash = "sha256:3e3d00f5807e83b234dfb6122bf37cfadf4be216c53a49ac059d02414f819170"}, + {file = "virtualenv-20.29.3.tar.gz", hash = "sha256:95e39403fcf3940ac45bc717597dba16110b74506131845d9b687d5e73d947ac"}, +] + +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<5" + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] + +[[package]] +name = "watchdog" +version = "6.0.0" +description = "Filesystem events monitoring" +optional = false +python-versions = ">=3.9" +files = [ + {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d1cdb490583ebd691c012b3d6dae011000fe42edb7a82ece80965b42abd61f26"}, + {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bc64ab3bdb6a04d69d4023b29422170b74681784ffb9463ed4870cf2f3e66112"}, + {file = "watchdog-6.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c897ac1b55c5a1461e16dae288d22bb2e412ba9807df8397a635d88f671d36c3"}, + {file = "watchdog-6.0.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6eb11feb5a0d452ee41f824e271ca311a09e250441c262ca2fd7ebcf2461a06c"}, + {file = "watchdog-6.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ef810fbf7b781a5a593894e4f439773830bdecb885e6880d957d5b9382a960d2"}, + {file = "watchdog-6.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:afd0fe1b2270917c5e23c2a65ce50c2a4abb63daafb0d419fde368e272a76b7c"}, + {file = "watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948"}, + {file = "watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860"}, + {file = "watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0"}, + {file = "watchdog-6.0.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:490ab2ef84f11129844c23fb14ecf30ef3d8a6abafd3754a6f75ca1e6654136c"}, + {file = "watchdog-6.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:76aae96b00ae814b181bb25b1b98076d5fc84e8a53cd8885a318b42b6d3a5134"}, + {file = "watchdog-6.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a175f755fc2279e0b7312c0035d52e27211a5bc39719dd529625b1930917345b"}, + {file = "watchdog-6.0.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e6f0e77c9417e7cd62af82529b10563db3423625c5fce018430b249bf977f9e8"}, + {file = "watchdog-6.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:90c8e78f3b94014f7aaae121e6b909674df5b46ec24d6bebc45c44c56729af2a"}, + {file = "watchdog-6.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e7631a77ffb1f7d2eefa4445ebbee491c720a5661ddf6df3498ebecae5ed375c"}, + {file = "watchdog-6.0.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:c7ac31a19f4545dd92fc25d200694098f42c9a8e391bc00bdd362c5736dbf881"}, + {file = "watchdog-6.0.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:9513f27a1a582d9808cf21a07dae516f0fab1cf2d7683a742c498b93eedabb11"}, + {file = "watchdog-6.0.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7a0e56874cfbc4b9b05c60c8a1926fedf56324bb08cfbc188969777940aef3aa"}, + {file = "watchdog-6.0.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:e6439e374fc012255b4ec786ae3c4bc838cd7309a540e5fe0952d03687d8804e"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7607498efa04a3542ae3e05e64da8202e58159aa1fa4acddf7678d34a35d4f13"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_armv7l.whl", hash = "sha256:9041567ee8953024c83343288ccc458fd0a2d811d6a0fd68c4c22609e3490379"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_i686.whl", hash = "sha256:82dc3e3143c7e38ec49d61af98d6558288c415eac98486a5c581726e0737c00e"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_ppc64.whl", hash = "sha256:212ac9b8bf1161dc91bd09c048048a95ca3a4c4f5e5d4a7d1b1a7d5752a7f96f"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e3df4cbb9a450c6d49318f6d14f4bbc80d763fa587ba46ec86f99f9e6876bb26"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:2cce7cfc2008eb51feb6aab51251fd79b85d9894e98ba847408f662b3395ca3c"}, + {file = "watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2"}, + {file = "watchdog-6.0.0-py3-none-win32.whl", hash = "sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a"}, + {file = "watchdog-6.0.0-py3-none-win_amd64.whl", hash = "sha256:cbafb470cf848d93b5d013e2ecb245d4aa1c8fd0504e863ccefa32445359d680"}, + {file = "watchdog-6.0.0-py3-none-win_ia64.whl", hash = "sha256:a1914259fa9e1454315171103c6a30961236f508b9b623eae470268bbcc6a22f"}, + {file = "watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282"}, +] + +[package.dependencies] +PyYAML = {version = ">=3.10", optional = true, markers = "extra == \"watchmedo\""} + +[package.extras] +watchmedo = ["PyYAML (>=3.10)"] + +[[package]] +name = "websocket-client" +version = "1.8.0" +description = "WebSocket client for Python with low level API options" +optional = false +python-versions = ">=3.8" +files = [ + {file = "websocket_client-1.8.0-py3-none-any.whl", hash = "sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526"}, + {file = "websocket_client-1.8.0.tar.gz", hash = "sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da"}, +] + +[package.extras] +docs = ["Sphinx (>=6.0)", "myst-parser (>=2.0.0)", "sphinx-rtd-theme (>=1.1.0)"] +optional = ["python-socks", "wsaccel"] +test = ["websockets"] + +[[package]] +name = "xdoctest" +version = "1.2.0" +description = "A rewrite of the builtin doctest module" +optional = false +python-versions = ">=3.8" +files = [ + {file = "xdoctest-1.2.0-py3-none-any.whl", hash = "sha256:0f1ecf5939a687bd1fc8deefbff1743c65419cce26dff908f8b84c93fbe486bc"}, + {file = "xdoctest-1.2.0.tar.gz", hash = "sha256:d8cfca6d8991e488d33f756e600d35b9fdf5efd5c3a249d644efcbbbd2ed5863"}, +] + +[package.extras] +all = ["IPython (>=7.23.1)", "Pygments (>=2.0.0)", "Pygments (>=2.4.1)", "attrs (>=19.2.0)", "colorama (>=0.4.1)", "debugpy (>=1.0.0)", "debugpy (>=1.3.0)", "debugpy (>=1.6.0)", "ipykernel (>=6.0.0)", "ipykernel (>=6.11.0)", "ipython-genutils (>=0.2.0)", "jedi (>=0.16)", "jinja2 (>=3.0.0)", "jupyter-client (>=7.0.0)", "jupyter-core (>=4.7.0)", "nbconvert (>=6.0.0)", "nbconvert (>=6.1.0)", "pyflakes (>=2.2.0)", "pytest (>=4.6.0)", "pytest (>=6.2.5)", "pytest-cov (>=3.0.0)", "tomli (>=0.2.0)"] +all-strict = ["IPython (==7.23.1)", "Pygments (==2.0.0)", "Pygments (==2.4.1)", "attrs (==19.2.0)", "colorama (==0.4.1)", "debugpy (==1.0.0)", "debugpy (==1.3.0)", "debugpy (==1.6.0)", "ipykernel (==6.0.0)", "ipykernel (==6.11.0)", "ipython-genutils (==0.2.0)", "jedi (==0.16)", "jinja2 (==3.0.0)", "jupyter-client (==7.0.0)", "jupyter-core (==4.7.0)", "nbconvert (==6.0.0)", "nbconvert (==6.1.0)", "pyflakes (==2.2.0)", "pytest (==4.6.0)", "pytest (==6.2.5)", "pytest-cov (==3.0.0)", "tomli (==0.2.0)"] +colors = ["Pygments (>=2.0.0)", "Pygments (>=2.4.1)", "colorama (>=0.4.1)"] +colors-strict = ["Pygments (==2.0.0)", "Pygments (==2.4.1)", "colorama (==0.4.1)"] +docs = ["Pygments (>=2.9.0)", "myst-parser (>=0.18.0)", "sphinx (>=5.0.1)", "sphinx-autoapi (>=1.8.4)", "sphinx-autobuild (>=2021.3.14)", "sphinx-reredirects (>=0.0.1)", "sphinx-rtd-theme (>=1.0.0)", "sphinxcontrib-napoleon (>=0.7)"] +docs-strict = ["Pygments (==2.9.0)", "myst-parser (==0.18.0)", "sphinx (==5.0.1)", "sphinx-autoapi (==1.8.4)", "sphinx-autobuild (==2021.3.14)", "sphinx-reredirects (==0.0.1)", "sphinx-rtd-theme (==1.0.0)", "sphinxcontrib-napoleon (==0.7)"] +jupyter = ["IPython (>=7.23.1)", "attrs (>=19.2.0)", "debugpy (>=1.0.0)", "debugpy (>=1.3.0)", "debugpy (>=1.6.0)", "ipykernel (>=6.0.0)", "ipykernel (>=6.11.0)", "ipython-genutils (>=0.2.0)", "jedi (>=0.16)", "jinja2 (>=3.0.0)", "jupyter-client (>=7.0.0)", "jupyter-core (>=4.7.0)", "nbconvert (>=6.0.0)", "nbconvert (>=6.1.0)"] +jupyter-strict = ["IPython (==7.23.1)", "attrs (==19.2.0)", "debugpy (==1.0.0)", "debugpy (==1.3.0)", "debugpy (==1.6.0)", "ipykernel (==6.0.0)", "ipykernel (==6.11.0)", "ipython-genutils (==0.2.0)", "jedi (==0.16)", "jinja2 (==3.0.0)", "jupyter-client (==7.0.0)", "jupyter-core (==4.7.0)", "nbconvert (==6.0.0)", "nbconvert (==6.1.0)"] +optional = ["IPython (>=7.23.1)", "Pygments (>=2.0.0)", "Pygments (>=2.4.1)", "attrs (>=19.2.0)", "colorama (>=0.4.1)", "debugpy (>=1.0.0)", "debugpy (>=1.3.0)", "debugpy (>=1.6.0)", "ipykernel (>=6.0.0)", "ipykernel (>=6.11.0)", "ipython-genutils (>=0.2.0)", "jedi (>=0.16)", "jinja2 (>=3.0.0)", "jupyter-client (>=7.0.0)", "jupyter-core (>=4.7.0)", "nbconvert (>=6.0.0)", "nbconvert (>=6.1.0)", "pyflakes (>=2.2.0)", "tomli (>=0.2.0)"] +optional-strict = ["IPython (==7.23.1)", "Pygments (==2.0.0)", "Pygments (==2.4.1)", "attrs (==19.2.0)", "colorama (==0.4.1)", "debugpy (==1.0.0)", "debugpy (==1.3.0)", "debugpy (==1.6.0)", "ipykernel (==6.0.0)", "ipykernel (==6.11.0)", "ipython-genutils (==0.2.0)", "jedi (==0.16)", "jinja2 (==3.0.0)", "jupyter-client (==7.0.0)", "jupyter-core (==4.7.0)", "nbconvert (==6.0.0)", "nbconvert (==6.1.0)", "pyflakes (==2.2.0)", "tomli (==0.2.0)"] +tests = ["pytest (>=4.6.0)", "pytest (>=6.2.5)", "pytest-cov (>=3.0.0)"] +tests-binary = ["cmake (>=3.21.2)", "cmake (>=3.25.0)", "ninja (>=1.10.2)", "ninja (>=1.11.1)", "pybind11 (>=2.10.3)", "pybind11 (>=2.7.1)", "scikit-build (>=0.11.1)", "scikit-build (>=0.16.1)"] +tests-binary-strict = ["cmake (==3.21.2)", "cmake (==3.25.0)", "ninja (==1.10.2)", "ninja (==1.11.1)", "pybind11 (==2.10.3)", "pybind11 (==2.7.1)", "scikit-build (==0.11.1)", "scikit-build (==0.16.1)"] +tests-strict = ["pytest (==4.6.0)", "pytest (==6.2.5)", "pytest-cov (==3.0.0)"] + +[metadata] +lock-version = "2.0" +python-versions = ">=3.10" +content-hash = "277084918f25fc4615207e3dad05a00b618fd422a735f628dd1e56a464b47200" diff --git a/program.prof b/program.prof new file mode 100644 index 0000000..ad96207 Binary files /dev/null and b/program.prof differ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a123f52 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,204 @@ +[tool.poetry] +name = "ai-marketplace-monitor" +version = "0.9.1" +description = "An AI-based tool for monitoring facebook marketplace" +authors = ["Bo Peng "] +readme = "README.md" +homepage = "https://github.com/BoPeng/ai-marketplace-monitor" +repository = "https://github.com/BoPeng/ai-marketplace-monitor" +documentation = "https://ai-marketplace-monitor.readthedocs.io" +keywords = ["ai-marketplace-monitor"] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/BoPeng/ai-marketplace-monitor/issues" + +[tool.poetry.scripts] +ai-marketplace-monitor = 'ai_marketplace_monitor.cli:app' + +[tool.poetry.dependencies] +python = ">=3.10" +typer = { extras = ["all"], version = "^0.15.1" } +playwright = ">=1.41.0" +rich = ">=13.7.0" +"pushbullet.py" = ">=0.12.0" +diskcache = ">=5.6.3" +watchdog = ">=4.0.0" +openai = ">=1.24.0" +parsedatetime = ">=2.5" +humanize = ">=4.0.0" +schedule = ">=1.2.2" +inflect = ">=7.0.0" +pynput = ">=1.7.0" +pillow = ">=10.0.0" +jinja2 = ">=3.0.0" +pyparsing = ">=3.1.0" +requests = ">=2.30.0" +tomli = { version = "2.2.1", markers = "python_version < '3.11'" } + +[tool.poetry.group.dev.dependencies] +pre-commit = "^4.0.1" +invoke = "^2.2.0" +bump2version = "^1.0.1" +watchdog = { version = "^6.0.0", extras = ["watchmedo"] } + +[tool.poetry.group.test.dependencies] +pytest = "^8.3.3" +xdoctest = "^1.2.0" +coverage = { version = "^7.6.7", extras = ["toml"] } +pytest-cov = "^6.0.0" +pytest-playwright = "^0.7.0" + +[tool.poetry.group.linters.dependencies] +isort = ">=5.13.2,<7.0.0" +black = ">=24.10,<26.0" +ruff = "^0.9.2" + +[tool.poetry.group.security.dependencies] +safety = "^3.2.11" + +[tool.poetry.group.typing.dependencies] +mypy = "^1.13.0" + +[tool.poetry.group.docs.dependencies] +sphinx = "^8.1.3" +recommonmark = "^0.7.1" + +[tool.coverage.paths] +source = ["src", "*/site-packages"] + +[tool.coverage.run] +branch = true +source = ["ai_marketplace_monitor"] + +[tool.coverage.report] +fail_under = 100 +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "if self.debug", + "if settings.DEBUG:", + "raise AssertionError", + "raise NotImplementedError", + "if 0:", + "if __name__ == __main__:", +] +show_missing = true + +[tool.coverage.html] +directory = "htmlcov" + +[tool.ruff] +target-version = "py39" +output-format = "full" +line-length = 99 +fix = true +extend-exclude = ["docs/*"] + +[tool.ruff.lint] +ignore = [ + "ANN202", # **kwargs: Any + "ANN401", + "ANN002", + "ANN003", + "E722", + "G004", + "S311", + "B017", + "S106", + "G003", + "S101", # use of assert + "BLE001", # blank exception + "C901", # too complex (function name too long etc) + "D100", # docstring + "D101", # docstring + "D102", # docstring + "D103", # docstring + "D107", # docstring + "D415", # docstring + "ERA001", # commented code + "S108", # use of /tmp + "S603", # subprocess.run security + "S607", # subprocess.run with relative path + "E501", # line too long + "S112", # logging try/except/continue +] +select = [ + "E", + "F", + "W", # flake8 + "C", # mccabe + "I", # isort + "N", # pep8-naming + "D", # flake8-docstrings + "ANN", # flake8-annotations + "S", # flake8-bandit + "BLE", # flake8-blind-except + "B", # flake8-bugbear + "A", # flake8-builtins + "G", # flake8-logging-format + "ERA", # eradicate + "ISC", # flake8-implicit-str-concat + "RUF", # Ruff-specific rules +] + +unfixable = [ + "ERA", # Don't remove commented-out code +] + +[tool.ruff.lint.per-file-ignores] +"tests/*" = ["S101"] + +[tool.ruff.lint.mccabe] +max-complexity = 10 + +[tool.ruff.lint.isort] +known-first-party = ["ai_marketplace_monitor"] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +[tool.isort] +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +line_length = 99 +known_third_party = ["invoke", "nox", "nox_poetry"] + +[tool.black] +line-length = 99 +target-version = ["py39"] + +[tool.mypy] +warn_return_any = false +warn_unused_configs = true + +[[tool.mypy.overrides]] +module = ["pytest.*", "invoke.*", "nox.*", "nox_poetry.*"] +allow_redefinition = false +check_untyped_defs = true +ignore_errors = false +ignore_missing_imports = true +implicit_reexport = true +local_partial_types = true +strict_optional = true +strict_equality = true +no_implicit_optional = true +warn_unused_ignores = true +warn_unreachable = true +warn_no_return = true + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/src/ai_marketplace_monitor/__init__.py b/src/ai_marketplace_monitor/__init__.py new file mode 100644 index 0000000..f195a0f --- /dev/null +++ b/src/ai_marketplace_monitor/__init__.py @@ -0,0 +1,5 @@ +"""Top-level package for ai-marketplace-monitor.""" + +__author__ = """Bo Peng""" +__email__ = "ben.bob@gmail.com" +__version__ = "0.9.1" diff --git a/src/ai_marketplace_monitor/ai.py b/src/ai_marketplace_monitor/ai.py new file mode 100644 index 0000000..49e68e4 --- /dev/null +++ b/src/ai_marketplace_monitor/ai.py @@ -0,0 +1,364 @@ +import re +import time +from dataclasses import asdict, dataclass, field +from enum import Enum +from logging import Logger +from typing import Any, ClassVar, Generic, Optional, Type, TypeVar + +from diskcache import Cache # type: ignore +from openai import OpenAI # type: ignore +from rich.pretty import pretty_repr + +from .listing import Listing +from .marketplace import TItemConfig, TMarketplaceConfig +from .utils import BaseConfig, CacheType, CounterItem, cache, counter, hilight + + +class AIServiceProvider(Enum): + OPENAI = "OpenAI" + DEEPSEEK = "DeepSeek" + OLLAMA = "Ollama" + + +@dataclass +class AIResponse: + score: int + comment: str + name: str = "" + + NOT_EVALUATED: ClassVar = "Not evaluated by AI" + + @property + def conclusion(self: "AIResponse") -> str: + return { + 1: "No match", + 2: "Potential match", + 3: "Poor match", + 4: "Good match", + 5: "Great deal", + }[self.score] + + @property + def style(self: "AIResponse") -> str: + if self.comment == self.NOT_EVALUATED: + return "dim" + if self.score < 3: + return "fail" + if self.score > 3: + return "succ" + return "name" + + @property + def stars(self: "AIResponse") -> str: + full_stars = self.score + empty_stars = 5 - full_stars + return ( + '' * full_stars + + '' * empty_stars + ) + + @classmethod + def from_cache( + cls: Type["AIResponse"], + listing: Listing, + item_config: TItemConfig, + marketplace_config: TMarketplaceConfig, + local_cache: Cache | None = None, + ) -> Optional["AIResponse"]: + res = (cache if local_cache is None else local_cache).get( + (CacheType.AI_INQUIRY.value, item_config.hash, marketplace_config.hash, listing.hash) + ) + if res is None: + return None + return AIResponse(**res) + + def to_cache( + self: "AIResponse", + listing: Listing, + item_config: TItemConfig, + marketplace_config: TMarketplaceConfig, + local_cache: Cache | None = None, + ) -> None: + (cache if local_cache is None else local_cache).set( + (CacheType.AI_INQUIRY.value, item_config.hash, marketplace_config.hash, listing.hash), + asdict(self), + tag=CacheType.AI_INQUIRY.value, + ) + + +@dataclass +class AIConfig(BaseConfig): + # this argument is required + + api_key: str | None = None + provider: str | None = None + model: str | None = None + base_url: str | None = None + max_retries: int = 10 + timeout: int | None = None + + def handle_provider(self: "AIConfig") -> None: + if self.provider is None: + return + if self.provider.lower() not in [x.value.lower() for x in AIServiceProvider]: + raise ValueError( + f"""AIConfig requires a valid service provider. Valid providers are {hilight(", ".join([x.value for x in AIServiceProvider]))}""" + ) + + def handle_api_key(self: "AIConfig") -> None: + if self.api_key is None: + return + if not isinstance(self.api_key, str): + raise ValueError("AIConfig requires a string api_key.") + self.api_key = self.api_key.strip() + + def handle_max_retries(self: "AIConfig") -> None: + if not isinstance(self.max_retries, int) or self.max_retries < 0: + raise ValueError("AIConfig requires a positive integer max_retries.") + + def handle_timeout(self: "AIConfig") -> None: + if self.timeout is None: + return + if not isinstance(self.timeout, int) or self.timeout < 0: + raise ValueError("AIConfig requires a positive integer timeout.") + + +@dataclass +class OpenAIConfig(AIConfig): + def handle_api_key(self: "OpenAIConfig") -> None: + if self.api_key is None: + raise ValueError("OpenAI requires a string api_key.") + + +@dataclass +class DeekSeekConfig(OpenAIConfig): + pass + + +@dataclass +class OllamaConfig(OpenAIConfig): + api_key: str | None = field(default="ollama") # required but not used. + + def handle_base_url(self: "OllamaConfig") -> None: + if self.base_url is None: + raise ValueError("Ollama requires a string base_url.") + + def handle_model(self: "OllamaConfig") -> None: + if self.model is None: + raise ValueError("Ollama requires a string model.") + + +TAIConfig = TypeVar("TAIConfig", bound=AIConfig) + + +class AIBackend(Generic[TAIConfig]): + def __init__(self: "AIBackend", config: AIConfig, logger: Logger | None = None) -> None: + self.config = config + self.logger = logger + self.client: OpenAI | None = None + + @classmethod + def get_config(cls: Type["AIBackend"], **kwargs: Any) -> TAIConfig: + raise NotImplementedError("get_config method must be implemented by subclasses.") + + def connect(self: "AIBackend") -> None: + raise NotImplementedError("Connect method must be implemented by subclasses.") + + def get_prompt( + self: "AIBackend", + listing: Listing, + item_config: TItemConfig, + marketplace_config: TMarketplaceConfig, + ) -> str: + prompt = ( + f"""A user wants to buy a {item_config.name} from Facebook Marketplace. """ + f"""Search phrases: "{'" and "'.join(item_config.search_phrases)}", """ + ) + if item_config.description: + prompt += f"""Description: "{item_config.description}", """ + # + max_price = item_config.max_price or 0 + min_price = item_config.min_price or 0 + if max_price and min_price: + prompt += f"""Price range: {min_price} to {max_price}. """ + elif max_price: + prompt += f"""Max price {max_price}. """ + elif min_price: + prompt += f"""Min price {min_price}. """ + # + if item_config.antikeywords: + prompt += f"""Exclude keywords "{'" and "'.join(item_config.antikeywords)}" in title or description.""" + # + prompt += ( + f"""\n\nThe user found a listing titled "{listing.title}" in {listing.condition} condition, """ + f"""priced at {listing.price}, located in {listing.location}, """ + f"""posted at {listing.post_url} with description "{listing.description}"\n\n""" + ) + # prompt + if item_config.prompt is not None: + prompt += item_config.prompt + elif marketplace_config.prompt is not None: + prompt += marketplace_config.prompt + else: + prompt += ( + "Evaluate how well this listing matches the user's criteria. Assess the description, MSRP, model year, " + "condition, and seller's credibility." + ) + # extra_prompt + prompt += "\n" + if item_config.extra_prompt is not None: + prompt += f"\n{item_config.extra_prompt.strip()}\n" + elif marketplace_config.extra_prompt is not None: + prompt += f"\n{marketplace_config.extra_prompt.strip()}\n" + # rating_prompt + if item_config.rating_prompt is not None: + prompt += f"\n{item_config.rating_prompt.strip()}\n" + elif marketplace_config.rating_prompt is not None: + prompt += f"\n{marketplace_config.rating_prompt.strip()}\n" + else: + prompt += ( + "\nRate from 1 to 5 based on the following: \n" + "1 - No match: Missing key details, wrong category/brand, or suspicious activity (e.g., external links).\n" + "2 - Potential match: Lacks essential info (e.g., condition, brand, or model); needs clarification.\n" + "3 - Poor match: Some mismatches or missing details; acceptable but not ideal.\n" + "4 - Good match: Mostly meets criteria with clear, relevant details.\n" + "5 - Great deal: Fully matches criteria, with excellent condition or price.\n" + "Conclude with:\n" + '"Rating <1-5>: "\n' + "where <1-5> is the rating and is a brief recommendation (max 30 words)." + ) + if self.logger: + self.logger.debug(f"""{hilight("[AI-Prompt]", "info")} {prompt}""") + return prompt + + def evaluate( + self: "AIBackend", + listing: Listing, + item_config: TItemConfig, + marketplace_config: TMarketplaceConfig, + ) -> AIResponse: + raise NotImplementedError("Confirm method must be implemented by subclasses.") + + +class OpenAIBackend(AIBackend): + default_model = "gpt-4o" + # the default is f"https://api.openai.com/v1" + base_url: str | None = None + + @classmethod + def get_config(cls: Type["OpenAIBackend"], **kwargs: Any) -> OpenAIConfig: + return OpenAIConfig(**kwargs) + + def connect(self: "OpenAIBackend") -> None: + if self.client is None: + self.client = OpenAI( + api_key=self.config.api_key, + base_url=self.config.base_url or self.base_url, + timeout=self.config.timeout, + ) + if self.logger: + self.logger.info(f"""{hilight("[AI]", "name")} {self.config.name} connected.""") + + def evaluate( + self: "OpenAIBackend", + listing: Listing, + item_config: TItemConfig, + marketplace_config: TMarketplaceConfig, + ) -> AIResponse: + # ask openai to confirm the item is correct + counter.increment(CounterItem.AI_QUERY, item_config.name) + prompt = self.get_prompt(listing, item_config, marketplace_config) + res: AIResponse | None = AIResponse.from_cache(listing, item_config, marketplace_config) + if res is not None: + if self.logger: + self.logger.info( + f"""{hilight("[AI]", res.style)} {self.config.name} previously concluded {hilight(f"{res.conclusion} ({res.score}): {res.comment}", res.style)} for listing {hilight(listing.title)}.""" + ) + return res + + self.connect() + + retries = 0 + while retries < self.config.max_retries: + self.connect() + assert self.client is not None + try: + response = self.client.chat.completions.create( + model=self.config.model or self.default_model, + messages=[ + { + "role": "system", + "content": "You are a helpful assistant that can confirm if a user's search criteria matches the item he is interested in.", + }, + {"role": "user", "content": prompt}, + ], + stream=False, + ) + break + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.error( + f"""{hilight("[AI-Error]", "fail")} {self.config.name} failed to evaluate {hilight(listing.title)}: {e}""" + ) + retries += 1 + # try to initiate a connection + self.client = None + time.sleep(5) + + # check if the response is yes + if self.logger: + self.logger.debug(f"""{hilight("[AI-Response]", "info")} {pretty_repr(response)}""") + + answer = response.choices[0].message.content or "" + if ( + answer is None + or not answer.strip() + or re.search(r"Rating[^1-5]*[1-5]", answer, re.DOTALL) is None + ): + counter.increment(CounterItem.FAILED_AI_QUERY, item_config.name) + raise ValueError(f"Empty or invalid response from {self.config.name}: {response}") + + lines = answer.split("\n") + # if any of the lines contains "Rating: ", extract the rating from it. + score: int = 1 + comment = "" + rating_line = None + for idx, line in enumerate(lines): + matched = re.match(r".*Rating[^1-5]*([1-5])[:\s]*(.*)", line) + if matched: + score = int(matched.group(1)) + comment = matched.group(2).strip() + rating_line = idx + continue + if rating_line is not None: + # if the AI puts comment after Rating, we need to include them + comment += " " + line + # if the AI puts the rating at the end, let us try to use the line before the Rating line + if len(comment.strip()) < 5 and rating_line is not None and rating_line > 0: + comment = lines[rating_line - 1] + + # remove multiple spaces, take first 30 words + comment = " ".join([x for x in comment.split() if x.strip()]).strip() + res = AIResponse(name=self.config.name, score=score, comment=comment) + res.to_cache(listing, item_config, marketplace_config) + counter.increment(CounterItem.NEW_AI_QUERY, item_config.name) + return res + + +class DeepSeekBackend(OpenAIBackend): + default_model = "deepseek-chat" + base_url = "https://api.deepseek.com" + + @classmethod + def get_config(cls: Type["DeepSeekBackend"], **kwargs: Any) -> DeekSeekConfig: + return DeekSeekConfig(**kwargs) + + +class OllamaBackend(OpenAIBackend): + default_model = "deepseek-r1:14b" + + @classmethod + def get_config(cls: Type["OllamaBackend"], **kwargs: Any) -> OllamaConfig: + return OllamaConfig(**kwargs) diff --git a/src/ai_marketplace_monitor/cli.py b/src/ai_marketplace_monitor/cli.py new file mode 100644 index 0000000..2a95895 --- /dev/null +++ b/src/ai_marketplace_monitor/cli.py @@ -0,0 +1,161 @@ +"""Console script for ai-marketplace-monitor.""" + +import logging +import sys +from logging.handlers import RotatingFileHandler +from pathlib import Path +from typing import Annotated, List, Optional + +import rich +import typer +from rich.logging import RichHandler + +from . import __version__ +from .utils import CacheType, amm_home, cache, counter, hilight + +app = typer.Typer() + + +def version_callback(value: bool) -> None: + """Callback function for the --version option. + + Parameters: + - value: The value provided for the --version option. + + Raises: + - typer.Exit: Raises an Exit exception if the --version option is provided, + printing the Awesome CLI version and exiting the program. + """ + if value: + typer.echo(f"AI Marketplace Monitor, version {__version__}") + raise typer.Exit() + + +@app.command() +def main( + config_files: Annotated[ + List[Path] | None, + typer.Option( + "-r", + "--config", + help="Path to one or more configuration files in TOML format. `~/.ai-marketplace-monitor/config.toml will always be read.", + ), + ] = None, + headless: Annotated[ + Optional[bool], + typer.Option("--headless", help="If set to true, will not show the browser window."), + ] = False, + clear_cache: Annotated[ + Optional[str], + typer.Option( + "--clear-cache", + help=( + "Remove all or selected category of cached items and treat all queries as new. " + f"""Allowed cache types are {", ".join([x.value for x in CacheType])} and all """ + ), + ), + ] = None, + verbose: Annotated[ + Optional[bool], + typer.Option("--verbose", "-v", help="If set to true, will show debug messages."), + ] = False, + items: Annotated[ + List[str] | None, + typer.Option( + "--check", + help="""Check one or more cached items by their id or URL, + and list why the item was accepted or denied.""", + ), + ] = None, + for_item: Annotated[ + Optional[str], + typer.Option( + "--for", + help="Item to check for URLs specified --check. You will be prmopted for each URL if unspecified and there are multiple items to search.", + ), + ] = None, + version: Annotated[ + Optional[bool], typer.Option("--version", callback=version_callback, is_eager=True) + ] = None, +) -> None: + """Console script for AI Marketplace Monitor.""" + logging.basicConfig( + level="DEBUG", + # format="%(name)s %(message)s", + format="%(message)s", + handlers=[ + RichHandler( + markup=True, + rich_tracebacks=True, + show_path=False if verbose is None else verbose, + level="DEBUG" if verbose else "INFO", + ), + RotatingFileHandler( + amm_home / "ai-marketplace-monitor.log", + encoding="utf-8", + maxBytes=1024 * 1024, + backupCount=5, + ), + ], + ) + + # remove logging from other packages. + for logger_name in ( + "asyncio", + "openai._base_client", + "httpcore.connection", + "httpcore.http11", + "httpx", + ): + logging.getLogger(logger_name).setLevel(logging.ERROR) + + logger = logging.getLogger("monitor") + logger.info( + f"""{hilight("[VERSION]", "info")} AI Marketplace Monitor, version {hilight(__version__, "name")}""" + ) + + if clear_cache is not None: + if clear_cache == "all": + cache.clear() + elif clear_cache in [x.value for x in CacheType]: + cache.evict(tag=clear_cache) + else: + logger.error( + f"""{hilight("[Clear Cache]", "fail")} {clear_cache} is not a valid cache type. Allowed cache types are {", ".join([x.value for x in CacheType])} and all """ + ) + sys.exit(1) + logger.info(f"""{hilight("[Clear Cache]", "succ")} Cache cleared.""") + sys.exit(0) + + # make --version a bit faster by lazy loading of MarketplaceMonitor + from .monitor import MarketplaceMonitor + + if items is not None: + try: + monitor = MarketplaceMonitor(config_files, headless, logger) + monitor.check_items(items, for_item) + except Exception as e: + logger.error(f"""{hilight("[Check]", "fail")} {e}""") + raise + finally: + monitor.stop_monitor() + + sys.exit(0) + + try: + monitor = MarketplaceMonitor(config_files, headless, logger) + monitor.start_monitor() + except KeyboardInterrupt: + rich.print("Exiting...") + sys.exit(0) + except Exception as e: + logger.error(f"""{hilight("[Monitor]", "fail")} {e}""") + raise + sys.exit(1) + finally: + monitor.stop_monitor() + rich.print(counter) + + +if __name__ == "__main__": + app() # pragma: no cover diff --git a/src/ai_marketplace_monitor/config.py b/src/ai_marketplace_monitor/config.py new file mode 100644 index 0000000..d154187 --- /dev/null +++ b/src/ai_marketplace_monitor/config.py @@ -0,0 +1,301 @@ +import sys +from dataclasses import dataclass, field +from enum import Enum +from itertools import chain +from logging import Logger +from pathlib import Path +from typing import Any, Dict, Generic, List + +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + +from .ai import DeepSeekBackend, OllamaBackend, OpenAIBackend, TAIConfig +from .facebook import FacebookMarketplace +from .marketplace import TItemConfig, TMarketplaceConfig +from .notification import NotificationConfig +from .region import RegionConfig +from .user import User, UserConfig +from .utils import MonitorConfig, Translator, hilight, merge_dicts + +supported_marketplaces = {"facebook": FacebookMarketplace} +supported_ai_backends = { + "deepseek": DeepSeekBackend, + "openai": OpenAIBackend, + "ollama": OllamaBackend, +} + + +class ConfigItem(Enum): + MONITOR = "monitor" + MARKETPLACE = "marketplace" + USER = "user" + ITEM = "item" + AI = "ai" + REGION = "region" + NOTIFICATION = "notification" + TRANSLATION = "translation" + + +@dataclass +class Config(Generic[TAIConfig, TItemConfig, TMarketplaceConfig]): + monitor: MonitorConfig = field(init=False) + ai: Dict[str, TAIConfig] = field(init=False) + user: Dict[str, UserConfig] = field(init=False) + notification: Dict[str, NotificationConfig] = field(init=False) + marketplace: Dict[str, TMarketplaceConfig] = field(init=False) + item: Dict[str, TItemConfig] = field(init=False) + translator: Dict[str, Translator] = field(init=False) + region: Dict[str, RegionConfig] = field(init=False) + + def __init__(self: "Config", config_files: List[Path], logger: Logger | None = None) -> None: + configs = [] + system_config = Path(__file__).parent / "config.toml" + + for config_file in [system_config, *config_files]: + try: + if logger: + logger.debug( + f"""{hilight("[Monitor]", "succ")} config file {hilight(str(config_file))}""" + ) + with open(config_file, "rb") as f: + configs.append(tomllib.load(f)) + except tomllib.TOMLDecodeError as e: + raise ValueError(f"Error parsing config file {config_file}: {e}") from e + # + # merge the list of configs into a single dictionary, including dictionaries in the values + config = merge_dicts(configs) + + self.validate_sections(config) + self.get_translator_config(config) + self.get_monitor_config(config) + self.get_ai_config(config) + self.get_notification_config(config) + self.get_marketplace_config(config) + self.get_user_config(config) + self.get_region_config(config) + self.get_item_config(config) + self.validate_users() + self.validate_ais() + self.expand_notifications(logger) + self.expand_regions() + self.validate_items() + + def get_translator_config(self: "Config", config: Dict[str, Any]) -> None: + if not isinstance(config.get("translation", {}), dict): + raise ValueError("translation section must be a dictionary.") + + self.translator = {} + for key, value in config.get("translation", {}).items(): + if "locale" not in value: + raise ValueError(f"Translation section {hilight(key)} must contain a locale.") + self.translator[key] = Translator( + locale=value["locale"], + dictionary={k: v for k, v in value.items() if k != "locale"}, + ) + + def get_monitor_config(self: "Config", config: Dict[str, Any]) -> None: + self.monitor = MonitorConfig(name="monitor", **config.get("monitor", {})) + + def get_ai_config(self: "Config", config: Dict[str, Any]) -> None: + # convert ai config to AIConfig objects + if not isinstance(config.get("ai", {}), dict): + raise ValueError("ai section must be a dictionary.") + + self.ai = {} + for key, value in config.get("ai", {}).items(): + try: + backend_class = supported_ai_backends[value.get("provider", key).lower()] + except KeyboardInterrupt: + raise + except Exception as e: + raise ValueError( + f"Config file contains an unsupported AI backend {key} in the ai section." + ) from e + self.ai[key] = backend_class.get_config(name=key, **value) + + def get_notification_config(self: "Config", config: Dict[str, Any]) -> None: + if not isinstance(config.get("notification", {}), dict): + raise ValueError("notification section must be a dictionary.") + + self.notification: Dict[str, NotificationConfig] = {} + for key, value in config.get("notification", {}).items(): + cfg = NotificationConfig.get_config(name=key, **value) + if cfg is None: + raise ValueError( + f"Unable to determine notification type for notification section {key}" + ) + else: + self.notification[key] = cfg + + def get_marketplace_config(self: "Config", config: Dict[str, Any]) -> None: + # check for required fields in each marketplace + self.marketplace = {} + for marketplace_name, marketplace_config in config["marketplace"].items(): + market_type = marketplace_config.get("market_type", "facebook") + if market_type not in supported_marketplaces: + raise ValueError( + f"Marketplace {hilight(market_type)} is not supported. Supported marketplaces are: {supported_marketplaces.keys()}" + ) + marketplace_class = supported_marketplaces[market_type] + self.marketplace[marketplace_name] = marketplace_class.get_config( + name=marketplace_name, **marketplace_config + ) + lan = self.marketplace[marketplace_name].language + if lan is None: + continue + # no exact match is required + if lan.split("_")[0] not in { + x.split("_")[0] for x in config[ConfigItem.TRANSLATION.value].keys() + }: + raise ValueError(f"Translation for language {lan} is not supported.") + + def get_user_config(self: "Config", config: Dict[str, Any]) -> None: + # check for required fields in each user + self.user: Dict[str, UserConfig] = {} + for user_name, user_config in config["user"].items(): + self.user[user_name] = User.get_config(name=user_name, **user_config) + + def get_region_config(self: "Config", config: Dict[str, Any]) -> None: + # check for required fields in each user + self.region: Dict[str, RegionConfig] = {} + for region_name, region_config in config.get("region", {}).items(): + self.region[region_name] = RegionConfig(name=region_name, **region_config) + + def get_item_config(self: "Config", config: Dict[str, Any]) -> None: + # check for required fields in each user + + self.item = {} + for item_name, item_config in config["item"].items(): + # if marketplace is specified, it must exist + if "marketplace" in item_config: + if item_config["marketplace"] not in config["marketplace"]: + raise ValueError( + f"Item {hilight(item_name)} specifies a marketplace that does not exist." + ) + + for marketplace_name, markerplace_config in config["marketplace"].items(): + marketplace_class = supported_marketplaces[ + markerplace_config.get("market_type", "facebook") + ] + if ( + "marketplace" not in item_config + or item_config["marketplace"] == marketplace_name + ): + # use the first available marketplace + self.item[item_name] = marketplace_class.get_item_config( + name=item_name, + marketplace=marketplace_name, + **{x: y for x, y in item_config.items() if x != "marketplace"}, + ) + break + + def validate_sections(self: "Config", config: Dict[str, Any]) -> None: + # check for required sections + for required_section in ["marketplace", "user", "item"]: + if required_section not in config: + raise ValueError(f"Config file does not contain a {required_section} section.") + + # check allowed keys in config + for key in config: + if key not in [x.value for x in ConfigItem]: + raise ValueError(f"Config file contains an invalid section {key}.") + + def validate_users(self: "Config") -> None: + """Check if notified users exists""" + # if user is specified in other section, they must exist + for config in chain(self.marketplace.values(), self.item.values()): + for user in config.notify or []: + if user not in self.user: + raise ValueError( + f"User {hilight(user)} specified in {hilight(config.name)} does not exist." + ) + + def validate_ais(self: "Config") -> None: + # if ai is specified in other section, they must exist + for config in chain(self.marketplace.values(), self.item.values()): + for ai in config.ai or []: + if ai not in self.ai: + raise ValueError( + f"AI {hilight(config.ai)} specified in {hilight(config.name)} does not exist." + ) + + def expand_notifications(self: "Config", logger: Logger | None = None) -> None: + for config in self.user.values(): + for notification_name in ( + config.notify_with if config.notify_with is not None else self.notification.keys() + ): + notification_types = set() + if notification_name not in self.notification: + raise ValueError( + f"User {hilight(config.name)} specifies an undefined notification method {notification_name}." + ) + notification_config = self.notification[notification_name] + # + if notification_config.enabled is False: + continue + # add values of notification_config to user config + if notification_config.__class__.__name__ in notification_types: + if logger: + logger.warning( + f"Ignore additional notification {hilight(notification_name)} with type {notification_config.__class__.__name__} for user {config.name}." + ) + continue + else: + notification_types.add(notification_config.__class__.__name__) + + for key, value in notification_config.__dict__.items(): + # name is the notification name and should not override username + if key not in ("type", "name") and value is not None: + if getattr(config, key) is not None: + if logger: + logger.warning( + f"Overriding {hilight(key)} for user {config.name} with value {value} from notification {hilight(notification_name)}." + ) + setattr(config, key, value) + + def expand_regions(self: "Config") -> None: + # if region is specified in other section, they must exist + for config in chain(self.marketplace.values(), self.item.values()): + if config.search_region is None: + continue + config.city_name = [] + config.search_city = [] + config.radius = [] + + for region in config.search_region: + region_config: RegionConfig = self.region[region] + if region not in self.region: + raise ValueError( + f"Region {hilight(region)} specified in {hilight(config.name)} does not exist." + ) + if region_config.enabled is False: + continue + # avoid duplicated addition of search_city + for search_city, city_name, radius in zip( + region_config.search_city or [], + region_config.city_name or [], + region_config.radius or [], + ): + if search_city not in config.search_city: + config.search_city.append(search_city) + config.city_name.append(city_name) + config.radius.append(radius) + + def validate_items(self: "Config") -> None: + # if item is specified in other section, they must exist + for marketplace_config in self.marketplace.values(): + if marketplace_config.enabled is False: + continue + for item_config in self.item.values(): + if item_config.enabled is False: + continue + if ( + item_config.marketplace is None + or item_config.marketplace == marketplace_config.name + ): + if not item_config.search_city and not marketplace_config.search_city: + raise ValueError( + f"No search_city or search_region is specified for {item_config.name} or market {marketplace_config.name}" + ) diff --git a/src/ai_marketplace_monitor/config.toml b/src/ai_marketplace_monitor/config.toml new file mode 100644 index 0000000..f4ea0fd --- /dev/null +++ b/src/ai_marketplace_monitor/config.toml @@ -0,0 +1,321 @@ +# +# Region definitions. +# - full_name and city_name are for readability/booktracking purpose only +# - different radius can be used for different search_city. In this case +# radius should an array with the same length as search_city +# +# Usage: +# - ·search_city` will be ignored if `search_region` is specified. +# - under the hood search_city is replaced by `search_city` of the regions +# + +[region.usa] +full_name = "USA (without AK or HI)" +radius = 500 +city_name = [ + "Portland, OR", + "Los Angeles, CA", + "Durango, CO", + "Broadus, MT", + "Fort Worth, TX", + "Boscobel, WI", + "Fitzgerald, GA", + "Oneonta, NY", +] +search_city = [ + "portland", + "la", + "108129565875623", + "109613652398861", + "114148045261892", + "106171882747436", + "112442175434378", + "113333232014461", +] + + +[region.usa_full] +full_name = "USA" +radius = 500 +city_name = [ + "Portland, OR", + "Los Angeles, CA", + "Durango, CO", + "Broadus, MT", + "Fort Worth, TX", + "Boscobel, WI", + "Fitzgerald, GA", + "Oneonta, NY", + "McGrath, AK", + "Prudhoe Bay, AK", + "Unalaska, AK", + "Elfin Cove, AK", + "Honolulu, HI", +] +search_city = [ + "portland", + "la", + "108129565875623", + "109613652398861", + "114148045261892", + "106171882747436", + "112442175434378", + "113333232014461", + "108203532540672", + "171705676191734", + "103760199662259", + "196626670491979", + "110444738976181", +] + + +[region.can] +full_name = "Canada" +radius = 805 +city_name = [ + "Saint Quentin, NB", + "Baysville, ON", + "Compeer, AB", + "One Hundred Mile House, BC", + "Moosehorn, MB", + "Skibi Lake, ON", + "Yellowknife, NT", + "White Horse, YK", + "Channel-Port aux Basques, NL", +] +search_city = [ + "108562712499750", + "183509305085293", + "112682018747951", + "111922062167097", + "112583085425676", + "362073744288039", + "114459998571182", + "115392538472860", + "115477851802820", +] + + +[region.mex] +full_name = "Mexico" +radius = 805 +city_name = [ + "Irapuato,Guanajuato ", + "Chapala, Jalisco", + "Creel, Chihuahua", + "Monclova, Coahuila", + "Campeche, Campeche", + "Cabo San Lucas, Baja California", + "Tehuantepec, Oaxaca", +] +search_city = [ + "108476082510080", + "106142666084683", + "110176719011514", + "110799538947338", + "619367721515573", + "154130198035072", + "116186601728289", +] + + +[region.bra] +full_name = "Brazil" +radius = 805 +city_name = [ + "Betim, Minas Gerais", + "Ibaiti, Paraná", + "Montes Claros de Goiás, Goiás", + "Alto Da Várzea, Ceara", + "Várzea Nova, Bahia", + "Salinas, Minas Gerais", + "Piquiá, Amazonas", + "Bom Jardim, Para", + "Salto do Jacuí, Rio Grande Do Sud", + "Altamira do Maranhão, Maranhão", + "Brasnorte, Mato Grosso", + "Corguinho, Mato Grosso Do Sul", + "Dianópolis, Tocantins", + "Japurá, Amazonas", + "Barraca Da Bôca, Amapa", + "Pôrto Velho, Rondônia", + "Feijó, Acre", + "Vista Alegre, Roraima", +] +search_city = [ + "241025963776891", + "107813919248792", + "182609075084572", + "115057491845194", + "400163803477498", + "630835887017960", + "111605828861709", + "112619282090096", + "110549925683118", + "112596635420890", + "173196699369921", + "108281459194195", + "113373648672696", + "107544435935385", + "117344181609620", + "108549759176811", + "103727253000065", + "117248258288799", +] + + +[region.arg] +full_name = "Argentina" +radius = 805 +city_name = [ + "Pehuajó, Buenos Aires", + "Ulapes, La Rioja", + "Mburucuyá, Corrientes", + "Rosario de la Frontera, Salta", + "La Reforma, La Pampa", + "Paso de Indios, Chubut", + "Rio Gallegos, Santa Cruz", +] +search_city = [ + "112089622140241", + "107413102628881", + "103767409662395", + "108630072495327", + "106494259383808", + "105646196135882", + "300807386607332", +] + + +[region.aus] +full_name = "Australia" +radius = 805 +city_name = [ + "Tamworth, NSW", + "Deniliquin, NSW", + "Oakden Hills, SA", + "Warralakin, WA", + "Yeppoon, QLD", + "Hobart, TAS", + "Darwin, NT", + "Carnarvon, WA", + "Port Hedland, WA", + "Port Douglas, QLD", + "Cloncurry, QLD", + "Alice Springs, NT", + "Quilpie, QLD", +] +search_city = [ + "112577755420955", + "104020242968596", + "277036799317188", + "106555549377269", + "108131009215930", + "111652435519898", + "109437725742749", + "103825936322408", + "248019175333793", + "106373139394499", + "112359378775421", + "107929299235881", + "109465839072367", +] + + +[region.aus_miles] +full_name = "Australia" +radius = 500 +city_name = [ + "Warburton, Western Australia", + "Mount Magnet, Western Australia", + "Coober Pedy, South Australia", + "Melbourne, Victoria, Australia", + "Tooraweenah", + "Clermont, Queensland", + "Daly Waters, Northern Territory", + "Broome, Western Australia", +] +search_city = [ + "112262705457494", + "105508376148373", + "107723845924377", + "melbourne", + "107928752568747", + "105632482805073", + "108276829196663", + "112099285474124", +] + +[region.nzl] +full_name = "New Zealand" +radius = 805 +city_name = ["Hamilton", "Lake Tekapo"] +search_city = ["104080336295923", "106528236047934"] + + +[region.ind] +full_name = "India" +radius = 805 +city_name = [ + "Sanquelim, Goa", + "Sangrur, Punjab", + "Kolkata, West Bengal", + "Himatnagar, Gujarat", + "Allahabad, Uttar Pradesh", + "Bhamragarh, Maharashtra", + "Salem, Tamil Nadu", +] +search_city = [ + "104029036299831", + "109148435777996", + "108212225873404", + "112269678784935", + "2099665383411187", + "115852108431709", + "1410397895862431", +] + + +[region.gbr] +full_name = "United Kingdom" +radius = 805 +city_name = ["Manchester", "Kirkwall"] +search_city = ["114629675219759", "107972512564724"] + + +[region.fra] +full_name = "France" +radius = 805 +city_name = ["Chartres", "Montpellier"] +search_city = ["115700691777803", "115100621840245"] + + +[region.spa] +full_name = "Spain" +radius = 805 +city_name = ["Plasencia", "Valencia"] +search_city = ["108336475863182", "2404588816444858"] + + +# +# Translation for different languages +# +[translation.es] +locale = "Spanish" +'Collection of Marketplace items' = 'Colección de artículos de Marketplace' +'Condition' = 'Estado' +'Description' = 'Descripción' +'Details' = 'Detalles' +'Location is approximate' = 'La ubicación es aproximada' +"About this vehicle" = 'Descripción del vendedor' +"Seller's description" = 'Información sobre este vehículo' + +[translation.zh] +locale = "Chinese" +'Collection of Marketplace items' = 'Marketplace 商品收藏夹' +'Condition' = '商品状况' +'Description' = '描述' +'Details' = '详细信息' +'Location is approximate' = '我们只提供大概位置' +"About this vehicle" = "车辆信息" +"Seller's description" = "卖家描述" diff --git a/src/ai_marketplace_monitor/email.html.j2 b/src/ai_marketplace_monitor/email.html.j2 new file mode 100644 index 0000000..060e15d --- /dev/null +++ b/src/ai_marketplace_monitor/email.html.j2 @@ -0,0 +1,223 @@ + + + + + + + + +
+ + + + + +
+

AI Marketplace Monitor

+
+ + + + + + +
+

Latest {{ item_name }} Listings

+ + {% for listing, rating, ns in listings %} + + + + {% endfor %} +
+ +
+

+ {{ listing.title }} +

+ {% if ns == NotificationStatus.NOT_NOTIFIED %} + NEW + {% elif ns == NotificationStatus.LISTING_CHANGED %} + UPDATED + {% elif ns == NotificationStatus.LISTING_DISCOUNTED %} + DISCOUNTED + {% elif ns == NotificationStatus.EXPIRED %} + REVISITABLE + {% elif ns == NotificationStatus.NOTIFIED and force %} + REVISITABLE + {% endif %} +
+ + +
+ Price: + {% if '|' in listing.price %} + {% set prices = listing.price.split('|') %} + {{ prices[0].strip() }} + {{ prices[1].strip() }} + {% else %} + {{ listing.price }} + {% endif %} +
+
+ Location: {{ listing.location }} +
+ + + {% if listing.description %} +
+ {{ listing.description }} +
+ {% endif %} + + + {% if rating.comment != rating.NOT_EVALUATED %} +
+
+ AI Rating: + {{ rating.stars }} +
+
+ {{ rating.comment }} +
+
+ {% else %} +
+
+ This listing has not been evaluated by AI service for relevance. +
+
+ {% endif %} + + + {% if listing.image and (listing.image|hash in valid_image_hashes) %} + {{ listing.title }} + {% endif %} + + +

+ + View Listing + +

+
+
+ + + + + + +
+
+ + diff --git a/src/ai_marketplace_monitor/email_notify.py b/src/ai_marketplace_monitor/email_notify.py new file mode 100644 index 0000000..3dd1fb4 --- /dev/null +++ b/src/ai_marketplace_monitor/email_notify.py @@ -0,0 +1,337 @@ +import smtplib +import ssl +import time +from dataclasses import dataclass +from email.mime.image import MIMEImage +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText +from email.utils import formataddr +from logging import Logger +from pathlib import Path +from typing import ClassVar, List, Tuple + +import inflect +from jinja2 import Environment, FileSystemLoader, select_autoescape + +from .ai import AIResponse # type: ignore +from .listing import Listing +from .notification import NotificationConfig, NotificationStatus +from .utils import fetch_with_retry, hilight, resize_image_data + + +@dataclass +class EmailNotificationConfig(NotificationConfig): + required_fields: ClassVar[List[str]] = ["email", "smtp_password"] + + email: List[str] | None = None + smtp_server: str | None = None + smtp_port: int | None = None + smtp_username: str | None = None + smtp_password: str | None = None + smtp_from: str | None = None + + def handle_email(self: "EmailNotificationConfig") -> None: + if self.email is None: + return + if isinstance(self.email, str): + self.email = [self.email] + if not isinstance(self.email, list) or not all( + (isinstance(x, str) and "@" in x and "." in x.split("@")[1]) for x in self.email + ): + raise ValueError( + f"Item {hilight(self.name)} email must be a string or list of string." + ) + + def handle_smtp_server(self: "EmailNotificationConfig") -> None: + if self.smtp_server is None: + return + + if not isinstance(self.smtp_server, str): + raise ValueError("user requires a string smtp_server.") + self.smtp_server = self.smtp_server.strip() + + def handle_smtp_port(self: "EmailNotificationConfig") -> None: + if self.smtp_port is None: + return + + if not isinstance(self.smtp_port, int): + raise ValueError("user requires an integer smtp_port.") + if self.smtp_port < 1 or self.smtp_port > 65535: + raise ValueError("user requires an integer smtp_port between 1 and 65535.") + + def handle_smtp_username(self: "EmailNotificationConfig") -> None: + if self.smtp_username is None: + return + + # smtp_username should be a string + if not isinstance(self.smtp_username, str) or not self.smtp_username: + raise ValueError("A non-empty value is requires for option smtp_username.") + self.smtp_username = self.smtp_username.strip() + + def handle_smtp_password(self: "EmailNotificationConfig") -> None: + if self.smtp_password is None: + return + + # smtp_password should be a string + if not isinstance(self.smtp_password, str) or not self.smtp_password: + raise ValueError("A non-empty value is is required for option smtp_password.") + self.smtp_password = self.smtp_password.strip() + + def handle_smtp_from(self: "EmailNotificationConfig") -> None: + if self.smtp_from is None: + return + # smtp_from should be a string + if not isinstance(self.smtp_from, str): + raise ValueError("user requires a string smtp_from.") + self.smtp_from = self.smtp_from.strip() + + def get_title( + self: "EmailNotificationConfig", + listings: List[Listing], + notification_status: List[NotificationStatus], + force: bool = False, + ) -> str: + p = inflect.engine() + n_new = len([x for x in notification_status if x == NotificationStatus.NOT_NOTIFIED]) + n_notified = len([x for x in notification_status if x == NotificationStatus.NOTIFIED]) + n_expired = len([x for x in notification_status if x == NotificationStatus.EXPIRED]) + n_updated = len( + [x for x in notification_status if x == NotificationStatus.LISTING_CHANGED] + ) + n_discounted = len( + [x for x in notification_status if x == NotificationStatus.LISTING_DISCOUNTED] + ) + title = "Found " + cnts = [] + if n_new > 0: + cnts.append(f"{n_new} new ") + if n_updated > 0: + cnts.append(f"{n_updated} updated ") + if n_discounted > 0: + cnts.append(f"{n_discounted} discounted ") + if n_expired > 0 or (force and n_notified > 0): + cnts.append(f"{n_expired + (n_notified if force else 0)} revisitable ") + if len(cnts) > 1: + cnts[-1] = f"and {cnts[-1]}" + elif len(cnts) == 0: + # no new items + return "" + + title += " ".join(cnts) + title += f"{listings[0].name} {p.plural_noun('listing', len(listings)-(0 if force else n_notified))} from {listings[0].marketplace}" + return title + + def get_text_message( + self: "EmailNotificationConfig", + listings: List[Listing], + ratings: List[AIResponse], + notification_status: List[NotificationStatus], + force: bool = False, + logger: Logger | None = None, + ) -> str: + messages = [] + for listing, rating, ns in zip(listings, ratings, notification_status): + prefix = "" + if ns == NotificationStatus.NOTIFIED: + if force: + prefix = "[NOTIFIED] " + else: + continue + if ns == NotificationStatus.EXPIRED: + prefix = "[REMINDER] " + elif ns == NotificationStatus.LISTING_CHANGED: + prefix = "[lISTING UPDATED] " + elif ns == NotificationStatus.LISTING_DISCOUNTED: + prefix = "[lISTING DISCOUNTED] " + + messages.append( + ( + f"{prefix}{listing.title}\n{listing.price}, {listing.location}\n" + f"{listing.post_url.split('?')[0]}" + ) + if rating.comment == AIResponse.NOT_EVALUATED + else ( + f"{prefix} [{rating.conclusion} ({rating.score})] {listing.title}\n" + f"{listing.price}, {listing.location}\n" + f"{listing.post_url.split('?')[0]}\n" + f"AI: {rating.comment}" + ) + ) + message = "\n\n".join(messages) + return message + + def get_html_message( + self: "EmailNotificationConfig", + listings: List[Listing], + ratings: List[AIResponse], + notification_status: List[NotificationStatus], + force: bool = False, + logger: Logger | None = None, + ) -> Tuple[str, list[Tuple[bytes, str, str]]]: # Return HTML and image data + template_dir = Path(__file__).parent + + # Set up Jinja2 environment + env = Environment( + loader=FileSystemLoader(template_dir), autoescape=select_autoescape(["html", "xml"]) + ) + + # Add custom filter for hashing + env.filters["hash"] = hash + + # Load template + template = env.get_template("email.html.j2") + + # Prepare images list for attachments + images = [] + valid_image_hashes = set() # Track which images were successfully processed + + # Process images first + for listing in listings: + if listing.image: + result = fetch_with_retry(listing.image, logger=logger) + if result: + image_data, content_type = result + image_data = resize_image_data(image_data) + if image_data and len(image_data) <= 1024 * 1024: + image_hash = hash(listing.image) + images.append((image_data, content_type, f"image_{image_hash}")) + valid_image_hashes.add(image_hash) # Track valid image + else: + if logger: + logger.debug(f"Image too large: {len(image_data)} bytes, skipped.") + else: + if logger: + logger.debug(f"Failed to fetch image: {listing.image}") + + # Render template + html = template.render( + listings=zip(listings, ratings, notification_status), + force=force, + item_name=listings[0].name.capitalize(), + NotificationStatus=NotificationStatus, # Pass enum for comparison + valid_image_hashes=valid_image_hashes, # Pass set of valid image hashes + ) + return html, images + + def notify( + self: "EmailNotificationConfig", + listings: List[Listing], + ratings: List[AIResponse], + notification_status: List[NotificationStatus], + force: bool = False, + logger: Logger | None = None, + ) -> bool: + if not self._has_required_fields(): + return False + + title = self.get_title(listings, notification_status, force=force) + if not title: + if logger: + logger.debug("No new listings. No email sent.") + return False + message = self.get_text_message( + listings, ratings, notification_status, force, logger=logger + ) + html_message, images = self.get_html_message( + listings, ratings, notification_status, force, logger=logger + ) + return self.send_email_message(title, message, html_message, images, logger=logger) + + def send_email_message( + self: "EmailNotificationConfig", + title: str, + message: str, + html: str, + images: List[Tuple[bytes, str, str]], + logger: Logger | None = None, + ) -> bool: + if not self.email: + if logger: + logger.debug("No recipients specified. No email sent.") + return False + + sender = self.smtp_from or self.smtp_username or self.email[0] + + if self.smtp_server: + smtp_server = self.smtp_server + else: + smtp_server = f"""smtp.{sender.split("@")[1]}""" + + # s.starttls() + msg = MIMEMultipart("related") + msg["Subject"] = title + # can use the humanized version of self.name as well + msg["From"] = formataddr(("AI Marketplace Monitor", sender)) + msg["To"] = ", ".join(self.email) + + # Create alternative part + alt_part = MIMEMultipart("alternative") + msg.attach(alt_part) + + alt_part.attach(MIMEText(message, "plain")) + alt_part.attach(MIMEText(html, "html")) # HTML part last = preferred + + # Attach images + for image_data, _, cid in images: + image = MIMEImage(image_data) + image.add_header("Content-ID", f"<{cid}>") + image.add_header("Content-Disposition", "inline") + msg.attach(image) + + for attempt in range(self.max_retries): + try: + smtp_port = self.smtp_port or 587 + smtp_username = self.smtp_username or sender + if not smtp_username: + if logger: + logger.error("No smtp username.") + return False + + smtp_password = self.smtp_password + if not smtp_password: + if logger: + logger.error("No smtp password.") + return False + + context = ssl.create_default_context() + with smtplib.SMTP(smtp_server, smtp_port) as smtp: + # smtp.set_debuglevel(1) + smtp.ehlo() # Can be omitted + smtp.starttls(context=context) + smtp.ehlo() # Can be omitted + try: + smtp.login(smtp_username, smtp_password) + except KeyboardInterrupt: + raise + except Exception as e: + if logger: + logger.error( + f"Failed to login to smtp server {smtp_server}:{smtp_port} with username {smtp_username}: {e}" + ) + return False + smtp.send_message(msg) + if logger: + logger.info( + f"""{hilight("[Notify]", "succ")} Sent {self.name} an email with title {hilight(title)}""" + ) + return True + except KeyboardInterrupt: + raise + except Exception as e: + if logger: + logger.debug( + f"""{hilight("[Notify]", "fail")} Attempt {attempt + 1} failed: {e}""" + ) + if attempt < self.max_retries - 1: + if logger: + logger.debug( + f"""{hilight("[Notify]", "fail")} Retrying in {self.retry_delay} seconds...""" + ) + time.sleep(self.retry_delay) + else: + if logger: + logger.error( + f"""{hilight("[Notify]", "fail")} Max retries reached. Failed to push note to {self.name}.""" + ) + return False + return False diff --git a/src/ai_marketplace_monitor/facebook.py b/src/ai_marketplace_monitor/facebook.py new file mode 100644 index 0000000..ca79aa1 --- /dev/null +++ b/src/ai_marketplace_monitor/facebook.py @@ -0,0 +1,1048 @@ +import datetime +import re +import time +from dataclasses import dataclass +from enum import Enum +from itertools import repeat +from logging import Logger +from typing import Any, Generator, List, Type, cast +from urllib.parse import quote + +import humanize +from playwright.sync_api import Browser, ElementHandle, Page # type: ignore +from rich.pretty import pretty_repr + +from .listing import Listing +from .marketplace import ItemConfig, Marketplace, MarketplaceConfig, WebPage +from .utils import ( + BaseConfig, + CounterItem, + KeyboardMonitor, + Translator, + convert_to_seconds, + counter, + doze, + extract_price, + hilight, + is_substring, +) + + +class Condition(Enum): + NEW = "new" + USED_LIKE_NEW = "used_like_new" + USED_GOOD = "used_good" + USED_FAIR = "used_fair" + + +class DateListed(Enum): + ANYTIME = 0 + PAST_24_HOURS = 1 + PAST_WEEK = 7 + PAST_MONTH = 30 + + +class DeliveryMethod(Enum): + LOCAL_PICK_UP = "local_pick_up" + SHIPPING = "shipping" + ALL = "all" + + +class Availability(Enum): + ALL = "all" + INSTOCK = "in" + OUTSTOCK = "out" + + +@dataclass +class FacebookMarketItemCommonConfig(BaseConfig): + """Item options that can be defined in marketplace + + This class defines and processes options that can be specified + in both marketplace and item sections, specific to facebook marketplace + """ + + seller_locations: List[str] | None = None + availability: List[str] | None = None + condition: List[str] | None = None + date_listed: List[int] | None = None + delivery_method: List[str] | None = None + + def handle_seller_locations(self: "FacebookMarketItemCommonConfig") -> None: + if self.seller_locations is None: + return + + if isinstance(self.seller_locations, str): + self.seller_locations = [self.seller_locations] + if not isinstance(self.seller_locations, list) or not all( + isinstance(x, str) for x in self.seller_locations + ): + raise ValueError(f"Item {hilight(self.name)} seller_locations must be a list.") + + def handle_availability(self: "FacebookMarketItemCommonConfig") -> None: + if self.availability is None: + return + + if isinstance(self.availability, str): + self.availability = [self.availability] + if not all(val in [x.value for x in Availability] for val in self.availability): + raise ValueError( + f"Item {hilight(self.name)} availability must be one or two values of 'all', 'in', and 'out'." + ) + if len(self.availability) > 2: + raise ValueError( + f"Item {hilight(self.name)} availability must be one or two values of 'all', 'in', and 'out'." + ) + + def handle_condition(self: "FacebookMarketItemCommonConfig") -> None: + if self.condition is None: + return + if isinstance(self.condition, Condition): + self.condition = [self.condition] + if not isinstance(self.condition, list) or not all( + isinstance(x, str) and x in [cond.value for cond in Condition] for x in self.condition + ): + raise ValueError( + f"Item {hilight(self.name)} condition must be one or more of that can be one of 'new', 'used_like_new', 'used_good', 'used_fair'." + ) + + def handle_date_listed(self: "FacebookMarketItemCommonConfig") -> None: + if self.date_listed is None: + return + if not isinstance(self.date_listed, list): + self.date_listed = [self.date_listed] + # + new_values: List[int] = [] + for val in self.date_listed: + if isinstance(val, str): + if val.isdigit(): + new_values.append(int(val)) + elif val.lower() == "all": + new_values.append(DateListed.ANYTIME.value) + elif val.lower() == "last 24 hours": + new_values.append(DateListed.PAST_24_HOURS.value) + elif val.lower() == "last 7 days": + new_values.append(DateListed.PAST_WEEK.value) + elif val.lower() == "last 30 days": + new_values.append(DateListed.PAST_MONTH.value) + else: + raise ValueError( + f"""Item {hilight(self.name)} date_listed must be one of 1, 7, and 30, or All, Last 24 hours, Last 7 days, Last 30 days.: {self.date_listed} provided.""" + ) + elif isinstance(val, (int, float)): + if int(val) not in [x.value for x in DateListed]: + raise ValueError( + f"""Item {hilight(self.name)} date_listed must be one of 1, 7, and 30, or All, Last 24 hours, Last 7 days, Last 30 days.: {self.date_listed} provided.""" + ) + new_values.append(int(val)) + else: + raise ValueError( + f"""Item {hilight(self.name)} date_listed must be one of 1, 7, and 30, or All, Last 24 hours, Last 7 days, Last 30 days.: {self.date_listed} provided.""" + ) + # new_values should have length 1 or 2 + if len(new_values) > 2: + raise ValueError( + f"""Item {hilight(self.name)} date_listed must have one or two values.""" + ) + self.date_listed = new_values + + def handle_delivery_method(self: "FacebookMarketItemCommonConfig") -> None: + if self.delivery_method is None: + return + + if isinstance(self.delivery_method, str): + self.delivery_method = [self.delivery_method] + + if len(self.delivery_method) > 2: + raise ValueError( + f"Item {hilight(self.name)} delivery_method must be one or two values of 'local_pick_up' and 'shipping'." + ) + + if not isinstance(self.delivery_method, list) or not all( + val in [x.value for x in DeliveryMethod] for val in self.delivery_method + ): + raise ValueError( + f"Item {hilight(self.name)} delivery_method must be one of 'local_pick_up' and 'shipping'." + ) + + +@dataclass +class FacebookMarketplaceConfig(MarketplaceConfig, FacebookMarketItemCommonConfig): + """Options specific to facebook marketplace + + This class defines and processes options that can be specified + in the marketplace.facebook section only. None of the options are required. + """ + + login_wait_time: int | None = None + password: str | None = None + username: str | None = None + + def handle_username(self: "FacebookMarketplaceConfig") -> None: + if self.username is None: + return + + if not isinstance(self.username, str): + raise ValueError(f"Marketplace {self.name} username must be a string.") + + def handle_password(self: "FacebookMarketplaceConfig") -> None: + if self.password is None: + return + + if not isinstance(self.password, str): + raise ValueError(f"Marketplace {self.name} password must be a string.") + + def handle_login_wait_time(self: "FacebookMarketplaceConfig") -> None: + if self.login_wait_time is None: + return + if isinstance(self.login_wait_time, str): + try: + self.login_wait_time = convert_to_seconds(self.login_wait_time) + except KeyboardInterrupt: + raise + except Exception as e: + raise ValueError( + f"Marketplace {self.name} login_wait_time {self.login_wait_time} is not recognized." + ) from e + if not isinstance(self.login_wait_time, int) or self.login_wait_time < 0: + raise ValueError( + f"Marketplace {self.name} login_wait_time should be a non-negative number." + ) + + +@dataclass +class FacebookItemConfig(ItemConfig, FacebookMarketItemCommonConfig): + pass + + +class FacebookMarketplace(Marketplace): + initial_url = "https://www.facebook.com/login/device-based/regular/login/" + + name = "facebook" + + def __init__( + self: "FacebookMarketplace", + name: str, + browser: Browser | None, + keyboard_monitor: KeyboardMonitor | None = None, + logger: Logger | None = None, + ) -> None: + assert name == self.name + super().__init__(name, browser, keyboard_monitor, logger) + self.page: Page | None = None + + @classmethod + def get_config(cls: Type["FacebookMarketplace"], **kwargs: Any) -> FacebookMarketplaceConfig: + return FacebookMarketplaceConfig(**kwargs) + + @classmethod + def get_item_config(cls: Type["FacebookMarketplace"], **kwargs: Any) -> FacebookItemConfig: + return FacebookItemConfig(**kwargs) + + def login(self: "FacebookMarketplace") -> None: + assert self.browser is not None + context = self.browser.new_context() + self.page = context.new_page() + + # Navigate to the URL, no timeout + self.goto_url(self.initial_url) + + self.config: FacebookMarketplaceConfig + try: + if self.config.username: + time.sleep(2) + selector = self.page.wait_for_selector('input[name="email"]') + if selector is not None: + selector.type(self.config.username, delay=250) + if self.config.password: + time.sleep(2) + selector = self.page.wait_for_selector('input[name="pass"]') + if selector is not None: + selector.type(self.config.password, delay=250) + if self.config.username and self.config.password: + time.sleep(2) + selector = self.page.wait_for_selector('button[name="login"]') + if selector is not None: + selector.click() + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.error(f"""{hilight("[Login]", "fail")} {e}""") + + # in case there is a need to enter additional information + login_wait_time = ( + 60 if self.config.login_wait_time is None else self.config.login_wait_time + ) + if login_wait_time > 0: + if self.logger: + self.logger.info( + f"""{hilight("[Login]", "info")} Waiting {humanize.naturaldelta(login_wait_time)}""" + + ( + f""" or press {hilight("Esc")} when you are ready.""" + if self.keyboard_monitor is not None + else "" + ) + ) + doze(login_wait_time, keyboard_monitor=self.keyboard_monitor) + + def search( + self: "FacebookMarketplace", item_config: FacebookItemConfig + ) -> Generator[Listing, None, None]: + if not self.page: + self.login() + assert self.page is not None + + options = [] + + max_price = item_config.max_price or self.config.max_price + if max_price: + options.append(f"maxPrice={max_price}") + + min_price = item_config.min_price or self.config.min_price + if min_price: + options.append(f"minPrice={min_price}") + + condition = item_config.condition or self.config.condition + if condition: + options.append(f"itemCondition={'%2C'.join(condition)}") + + # availability can take values from item_config, or marketplace config and will + # use the first or second value depending on how many times the item has been searched. + if item_config.date_listed: + date_listed = item_config.date_listed[0 if item_config.searched_count == 0 else -1] + elif self.config.date_listed: + date_listed = self.config.date_listed[0 if item_config.searched_count == 0 else -1] + else: + date_listed = DateListed.ANYTIME.value + if date_listed is not None and date_listed != DateListed.ANYTIME.value: + options.append(f"daysSinceListed={date_listed}") + + # delivery_method can take values from item_config, or marketplace config and will + # use the first or second value depending on how many times the item has been searched. + if item_config.delivery_method: + delivery_method = item_config.delivery_method[ + 0 if item_config.searched_count == 0 else -1 + ] + elif self.config.delivery_method: + delivery_method = self.config.delivery_method[ + 0 if item_config.searched_count == 0 else -1 + ] + else: + delivery_method = DeliveryMethod.ALL.value + if delivery_method is not None and delivery_method != DeliveryMethod.ALL.value: + options.append(f"deliveryMethod={delivery_method}") + + # availability can take values from item_config, or marketplace config and will + # use the first or second value depending on how many times the item has been searched. + if item_config.availability: + availability = item_config.availability[0 if item_config.searched_count == 0 else -1] + elif self.config.availability: + availability = self.config.availability[0 if item_config.searched_count == 0 else -1] + else: + availability = Availability.ALL.value + if availability is not None and availability != Availability.ALL.value: + options.append(f"availability={availability}") + + # search multiple keywords and cities + # there is a small chance that search by different keywords and city will return the same items. + found = {} + search_city = item_config.search_city or self.config.search_city or [] + city_name = item_config.city_name or self.config.city_name or [] + radiuses = item_config.radius or self.config.radius + + # this should not happen because `Config.validate_items` has checked this + if not search_city: + if self.logger: + self.logger.error( + f"""{hilight("[Search]", "fail")} No search city provided for {item_config.name}""" + ) + # increase the searched_count to differentiate first and subsequent searches + item_config.searched_count += 1 + for city, cname, radius in zip( + search_city, + repeat(None) if city_name is None else city_name, + repeat(None) if radiuses is None else radiuses, + ): + marketplace_url = f"https://www.facebook.com/marketplace/{city}/search?" + + if radius: + # avoid specifying radius more than once + if options and options[-1].startswith("radius"): + options.pop() + options.append(f"radius={radius}") + + for search_phrase in item_config.search_phrases: + if self.logger: + self.logger.info( + f"""{hilight("[Search]", "info")} Searching {item_config.marketplace} for """ + f"""{hilight(item_config.name)} from {hilight(cname or city)}""" + + (f" with radius={radius}" if radius else " with default radius") + ) + retries = 0 + while True: + self.goto_url( + marketplace_url + "&".join([f"query={quote(search_phrase)}", *options]) + ) + + found_listings = FacebookSearchResultPage( + self.page, self.translator, self.logger + ).get_listings() + time.sleep(5) + if found_listings: + break + if retries > 5: + if self.logger: + self.logger.error( + f"""{hilight("[Search]", "fail")} Failed to get search results for {search_phrase}""" + ) + break + else: + retries += 1 + if self.logger: + self.logger.debug( + f"""{hilight("[Search]", "info")} Retrying to get search results for {search_phrase}""" + ) + + counter.increment(CounterItem.SEARCH_PERFORMED, item_config.name) + + # go to each item and get the description + # if we have not done that before + for listing in found_listings: + if listing.post_url.split("?")[0] in found: + continue + if self.keyboard_monitor is not None and self.keyboard_monitor.is_paused(): + return + counter.increment(CounterItem.LISTING_EXAMINED, item_config.name) + found[listing.post_url.split("?")[0]] = True + # filter by title and location since we do not have description and seller yet. + if not self.check_listing(listing, item_config): + counter.increment(CounterItem.EXCLUDED_LISTING, item_config.name) + continue + try: + details = self.get_listing_details( + listing.post_url, + item_config, + price=listing.price, + title=listing.title, + ) + time.sleep(5) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.error( + f"""{hilight("[Retrieve]", "fail")} Failed to get item details: {e}""" + ) + continue + # currently we trust the other items from summary page a bit better + # so we do not copy title, description etc from the detailed result + for attr in ("condition", "seller", "description"): + # other attributes should be consistent + setattr(listing, attr, getattr(details, attr)) + listing.name = item_config.name + if self.logger: + self.logger.debug( + f"""{hilight("[Retrieve]", "succ")} New item "{listing.title}" from https://www.facebook.com{listing.post_url} is sold by "{listing.seller}" and with description "{listing.description[:100]}..." """ + ) + if self.check_listing(listing, item_config): + yield listing + else: + counter.increment(CounterItem.EXCLUDED_LISTING, item_config.name) + + def get_listing_details( + self: "FacebookMarketplace", + post_url: str, + item_config: ItemConfig, + price: str | None = None, + title: str | None = None, + ) -> Listing: + assert post_url.startswith("https://www.facebook.com") + details = Listing.from_cache(post_url) + if ( + details is not None + and (price is None or details.price == price) + and (title is None or details.title == title) + ): + # if the price and title are the same, we assume everything else is unchanged. + return details + + if not self.page: + self.login() + + assert self.page is not None + self.goto_url(post_url) + counter.increment(CounterItem.LISTING_QUERY, item_config.name) + details = parse_listing(self.page, post_url, self.translator, self.logger) + if details is None: + raise ValueError( + f"Failed to get item details of listing {post_url}. " + "The listing might be missing key information (e.g. seller) or not in English." + "Please add option language to your marketplace configuration is the latter is the case. See https://github.com/BoPeng/ai-marketplace-monitor?tab=readme-ov-file#support-for-non-english-languages for details." + ) + details.to_cache(post_url) + return details + + def check_listing( + self: "FacebookMarketplace", item: Listing, item_config: FacebookItemConfig + ) -> bool: + # get antikeywords from both item_config or config + antikeywords = item_config.antikeywords + if antikeywords and ( + is_substring(antikeywords, item.title + " " + item.description, logger=self.logger) + ): + if self.logger: + self.logger.info( + f"""{hilight("[Skip]", "fail")} Exclude {hilight(item.title)} due to {hilight("excluded keywords", "fail")}: {', '.join(antikeywords)}""" + ) + return False + + # if the return description does not contain any of the search keywords + keywords = item_config.keywords + if keywords and not ( + is_substring(keywords, item.title + " " + item.description, logger=self.logger) + ): + if self.logger: + self.logger.info( + f"""{hilight("[Skip]", "fail")} Exclude {hilight(item.title)} {hilight("without required keywords", "fail")} in title and description.""" + ) + return False + + # get locations from either marketplace config or item config + if item_config.seller_locations is not None: + allowed_locations = item_config.seller_locations + else: + allowed_locations = self.config.seller_locations or [] + if allowed_locations and not is_substring( + allowed_locations, item.location, logger=self.logger + ): + if self.logger: + self.logger.info( + f"""{hilight("[Skip]", "fail")} Exclude {hilight("out of area", "fail")} item {hilight(item.title)} from location {hilight(item.location)}""" + ) + return False + + # get exclude_sellers from both item_config or config + if item_config.exclude_sellers is not None: + exclude_sellers = item_config.exclude_sellers + else: + exclude_sellers = self.config.exclude_sellers or [] + if ( + item.seller + and exclude_sellers + and is_substring(exclude_sellers, item.seller, logger=self.logger) + ): + if self.logger: + self.logger.info( + f"""{hilight("[Skip]", "fail")} Exclude {hilight(item.title)} sold by {hilight("banned seller", "failed")} {hilight(item.seller)}""" + ) + return False + + return True + + +class FacebookSearchResultPage(WebPage): + + def _get_listings_elements_by_children_counts(self: "FacebookSearchResultPage"): + parent: ElementHandle | None = self.page.locator("img").first.element_handle() + # look for parent of parent until it has more than 10 children + children = [] + while parent: + children = parent.query_selector_all(":scope > *") + if len(children) > 10: + break + parent = parent.query_selector("xpath=..") + # find each listing + valid_listings = [] + try: + for listing in children: + if not listing.text_content(): + continue + valid_listings.append(listing) + except Exception as e: + # this error should be tolerated + if self.logger: + self.logger.debug( + f'{hilight("[Retrieve]", "fail")} Some grid item cannot be read: {e}' + ) + return valid_listings + + def _get_listing_elements_by_traversing_header(self: "FacebookSearchResultPage"): + heading = self.page.locator( + f'[aria-label="{self.translator("Collection of Marketplace items")}"]' + ) + if not heading: + return [] + + grid_items = heading.locator( + ":scope > :first-child > :first-child > :nth-child(3) > :first-child > :nth-child(2) > div" + ) + # find each listing + valid_listings = [] + try: + for listing in grid_items.all(): + if not listing.text_content(): + continue + valid_listings.append(listing.element_handle()) + except Exception as e: + # this error should be tolerated + if self.logger: + self.logger.debug( + f'{hilight("[Retrieve]", "fail")} Some grid item cannot be read: {e}' + ) + return valid_listings + + def get_listings(self: "FacebookSearchResultPage") -> List[Listing]: + # find the grid box + try: + valid_listings = ( + self._get_listing_elements_by_traversing_header() + or self._get_listings_elements_by_children_counts() + ) + except KeyboardInterrupt: + raise + except Exception as e: + filename = datetime.datetime.now().strftime("debug_%Y%m%d_%H%M%S.html") + if self.logger: + self.logger.error( + f'{hilight("[Retrieve]", "fail")} failed to parse searching result. Page saved to {filename}: {e}' + ) + with open(filename, "w", encoding="utf-8") as f: + f.write(self.page.content()) + return [] + + listings: List[Listing] = [] + for idx, listing in enumerate(valid_listings): + try: + atag = listing.query_selector( + ":scope > :first-child > :first-child > :first-child > :first-child > :first-child > :first-child > :first-child > :first-child" + ) + if not atag: + continue + post_url = atag.get_attribute("href") or "" + details_divs = atag.query_selector_all(":scope > :first-child > div") + if not details_divs: + continue + details = details_divs[1] + divs = details.query_selector_all(":scope > div") + raw_price = "" if len(divs) < 1 else divs[0].text_content() or "" + title = "" if len(divs) < 2 else divs[1].text_content() or "" + # location can be empty in some rare cases + location = "" if len(divs) < 3 else (divs[2].text_content() or "") + + # get image + img = listing.query_selector("img") + image = img.get_attribute("src") if img else "" + price = extract_price(raw_price) + + if post_url.startswith("/"): + post_url = f"https://www.facebook.com{post_url}" + + if image.startswith("/"): + image = f"https://www.facebook.com{image}" + + listings.append( + Listing( + marketplace="facebook", + name="", + id=post_url.split("?")[0].rstrip("/").split("/")[-1], + title=title, + image=image, + price=price, + # all the ?referral_code&referral_sotry_type etc + # could be helpful for live navigation, but will be stripped + # for caching item details. + post_url=post_url, + location=location, + condition="", + seller="", + description="", + ) + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.error( + f'{hilight("[Retrieve]", "fail")} Failed to parse search results {idx + 1} listing: {e}' + ) + continue + return listings + + +class FacebookItemPage(WebPage): + + def verify_layout(self: "FacebookItemPage") -> bool: + return True + + def get_title(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_title is not implemented for this page") + + def get_price(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_price is not implemented for this page") + + def get_image_url(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_image_url is not implemented for this page") + + def get_seller(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_seller is not implemented for this page") + + def get_description(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_description is not implemented for this page") + + def get_location(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_location is not implemented for this page") + + def get_condition(self: "FacebookItemPage") -> str: + raise NotImplementedError("get_condition is not implemented for this page") + + def parse(self: "FacebookItemPage", post_url: str) -> Listing: + if not self.verify_layout(): + raise ValueError("Layout mismatch") + + # title + title = self.get_title() + price = self.get_price() + description = self.get_description() + + if not title or not price or not description: + raise ValueError(f"Failed to parse {post_url}") + + if self.logger: + self.logger.info(f'{hilight("[Retrieve]", "succ")} Parsing {hilight(title)}') + res = Listing( + marketplace="facebook", + name="", + id=post_url.split("?")[0].rstrip("/").split("/")[-1], + title=title, + image=self.get_image_url(), + price=extract_price(price), + post_url=post_url, + location=self.get_location(), + condition=self.get_condition(), + description=description, + seller=self.get_seller(), + ) + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "succ")} {pretty_repr(res)}') + return cast(Listing, res) + + +class FacebookRegularItemPage(FacebookItemPage): + def verify_layout(self: "FacebookRegularItemPage") -> bool: + return any( + self.translator("Condition") in (x.text_content() or "") + for x in self.page.query_selector_all("li") + ) + + def get_title(self: "FacebookRegularItemPage") -> str: + try: + h1_element = self.page.query_selector_all("h1")[-1] + return h1_element.text_content() or self.translator("**unspecified**") + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_price(self: "FacebookRegularItemPage") -> str: + try: + price_element = self.page.locator("h1 + *") + return price_element.text_content() or self.translator("**unspecified**") + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_image_url(self: "FacebookRegularItemPage") -> str: + try: + image_url = self.page.locator("img").first.get_attribute("src") or "" + return image_url + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_seller(self: "FacebookRegularItemPage") -> str: + try: + seller_link = self.page.locator("//a[contains(@href, '/marketplace/profile')]").last + return seller_link.text_content() or self.translator("**unspecified**") + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_description(self: "FacebookRegularItemPage") -> str: + try: + # Find the span with text "condition", then parent, then next... + description_element = self.page.locator( + f'span:text("{self.translator("Condition")}") >> xpath=ancestor::ul[1] >> xpath=following-sibling::*[1]' + ) + return description_element.text_content() or self.translator("**unspecified**") + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_condition(self: "FacebookRegularItemPage") -> str: + try: + # Find the span with text "condition", then parent, then next... + condition_element = self.page.locator(f'span:text("{self.translator("Condition")}")') + return self._parent_with_cond( + condition_element, + lambda x: len(x) >= 2 + and self.translator("Condition") in (x[0].text_content() or ""), + 1, + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_location(self: "FacebookRegularItemPage") -> str: + try: + # look for "Location is approximate", then find its neighbor + approximate_element = self.page.locator( + f'span:text("{self.translator("Location is approximate")}")' + ) + return self._parent_with_cond( + approximate_element, + lambda x: len(x) == 2 + and self.translator("Location is approximate") in (x[1].text_content() or ""), + 0, + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + +class FacebookRentalItemPage(FacebookRegularItemPage): + def verify_layout(self: "FacebookRentalItemPage") -> bool: + # there is a header h2 with text Description + return any( + self.translator("Description") in (x.text_content() or "") + for x in self.page.query_selector_all("h2") + ) + + def get_description(self: "FacebookRentalItemPage") -> str: + # some pages do not have a condition box and appears to have a "Description" header + # See https://github.com/BoPeng/ai-marketplace-monitor/issues/29 for details. + try: + description_header = self.page.query_selector( + f'h2:has(span:text("{self.translator("Description")}"))' + ) + return self._parent_with_cond( + description_header, + lambda x: len(x) > 1 and x[0].text_content() == self.translator("Description"), + 1, + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_condition(self: "FacebookRentalItemPage") -> str: + # no condition information for rental items + return self.translator("**unspecified**") + + +class FacebookAutoItemWithAboutAndDescriptionPage(FacebookRegularItemPage): + def _has_about_this_vehicle(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> bool: + return any( + self.translator("About this vehicle") in (x.text_content() or "") + for x in self.page.query_selector_all("h2") + ) + + def _has_seller_description(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> bool: + return any( + self.translator("Seller's description") in (x.text_content() or "") + for x in self.page.query_selector_all("h2") + ) + + def _get_about_this_vehicle(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> str: + try: + about_element = self.page.locator( + f'h2:has(span:text("{self.translator("About this vehicle")}"))' + ) + return self._parent_with_cond( + # start from About this vehicle + about_element, + # find an array of elements with the first one being "About this vehicle" + lambda x: len(x) > 1 + and self.translator("About this vehicle") in (x[0].text_content() or ""), + # Extract all texts from the elements + lambda x: "\n".join([child.text_content() or "" for child in x]), + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def _get_seller_description(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> str: + try: + description_header = self.page.query_selector( + f"""h2:has(span:text("{self.translator("Seller's description")}"))""" + ) + + return self._parent_with_cond( + # start from the description header + description_header, + # find an array of elements with the first one being "Seller's description" + lambda x: len(x) > 1 + and self.translator("Seller's description") in (x[0].text_content() or ""), + # then, drill down from the second child + lambda x: self._children_with_cond( + x[1], + # find the an array of elements + lambda y: len(y) > 1, + # and return the texts. + lambda y: f"""\n\n{self.translator("Seller's description")}\n\n{y[0].text_content() or self.translator("**unspecified**")}""", + ), + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def verify_layout(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> bool: + # there is a header h2 with text "About this vehicle" + return self._has_about_this_vehicle() and self._has_seller_description() + + def get_description(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> str: + return self._get_about_this_vehicle() + self._get_seller_description() + + def get_price(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> str: + description = self.get_description() + # using regular expression to find text that looks like price in the description + price_pattern = r"\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?(?:,\d{2})?" + match = re.search(price_pattern, description) + return match.group(0) if match else self.translator("**unspecified**") + + def get_condition(self: "FacebookAutoItemWithAboutAndDescriptionPage") -> str: + # no condition information for auto items + return self.translator("**unspecified**") + + +class FacebookAutoItemWithDescriptionPage(FacebookAutoItemWithAboutAndDescriptionPage): + def verify_layout(self: "FacebookAutoItemWithDescriptionPage") -> bool: + return self._has_seller_description() and not self._has_about_this_vehicle() + + def get_description(self: "FacebookAutoItemWithDescriptionPage") -> str: + try: + description_header = self.page.query_selector( + f"""h2:has(span:text("{self.translator("Seller's description")}"))""" + ) + + return self._parent_with_cond( + # start from the description header + description_header, + # find an array of elements with the first one being "Seller's description" + lambda x: len(x) > 1 + and self.translator("Seller's description") in (x[0].text_content() or ""), + # then, drill down from the second child + lambda x: self._children_with_cond( + x[1], + # find the an array of elements + lambda y: len(y) > 2, + # and return the texts. + lambda y: f"""\n\n{self.translator("Seller's description")}\n\n{y[1].text_content() or self.translator("**unspecified**")}""", + ), + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_condition(self: "FacebookAutoItemWithDescriptionPage") -> str: + try: + description_header = self.page.query_selector( + f"""h2:has(span:text("{self.translator("Seller's description")}"))""" + ) + + res = self._parent_with_cond( + # start from the description header + description_header, + # find an array of elements with the first one being "Seller's description" + lambda x: len(x) > 1 + and self.translator("Seller's description") in (x[0].text_content() or ""), + # then, drill down from the second child + lambda x: self._children_with_cond( + x[1], + # find the an array of elements + lambda y: len(y) > 2, + # and return the texts after seller's description. + lambda y: y[0].text_content() or self.translator("**unspecified**"), + ), + ) + if res.startswith(self.translator("Condition")): + res = res[len(self.translator("Condition")) :] + return res.strip() + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + def get_price(self: "FacebookAutoItemWithDescriptionPage") -> str: + # for this page, price is after header + try: + h1_element = self.page.query_selector_all("h1")[-1] + header = h1_element.text_content() + return self._parent_with_cond( + # start from the header + h1_element, + # find an array of elements with the first one being "Seller's description" + lambda x: len(x) > 1 and header in (x[0].text_content() or ""), + # then, find the element after header + 1, + ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "fail")} {e}') + return "" + + +def parse_listing( + page: Page, post_url: str, translator: Translator | None = None, logger: Logger | None = None +) -> Listing | None: + supported_facebook_item_layouts = [ + FacebookRentalItemPage, + FacebookAutoItemWithAboutAndDescriptionPage, + FacebookAutoItemWithDescriptionPage, + FacebookRegularItemPage, + ] + + for page_model in supported_facebook_item_layouts: + try: + return page_model(page, translator, logger).parse(post_url) + except KeyboardInterrupt: + raise + except Exception: + # try next page layout + continue + return None diff --git a/src/ai_marketplace_monitor/listing.py b/src/ai_marketplace_monitor/listing.py new file mode 100644 index 0000000..cb75b63 --- /dev/null +++ b/src/ai_marketplace_monitor/listing.py @@ -0,0 +1,68 @@ +from dataclasses import asdict, dataclass +from typing import Optional, Tuple, Type + +from diskcache import Cache # type: ignore + +from .utils import CacheType, cache, hash_dict + + +@dataclass +class Listing: + marketplace: str + name: str + # unique identification + id: str + title: str + image: str + price: str + post_url: str + location: str + seller: str + condition: str + description: str + + @property + def content(self: "Listing") -> Tuple[str, str, str]: + return (self.title, self.description, self.price) + + @property + def hash(self: "Listing") -> str: + # we need to normalize post_url before hashing because post_url will be different + # each time from a search page. We also does not count image + return hash_dict( + { + x: (y.split("?")[0] if x == "post_url" else y) + for x, y in asdict(self).items() + if x != "image" + } + ) + + @classmethod + def from_cache( + cls: Type["Listing"], + post_url: str, + local_cache: Cache | None = None, + ) -> Optional["Listing"]: + try: + # details could be a different datatype, miss some key etc. + # and we have recently changed to save Listing as a dictionary + return cls( + **(cache if local_cache is None else local_cache).get( + (CacheType.LISTING_DETAILS.value, post_url.split("?")[0]) + ) + ) + except KeyboardInterrupt: + raise + except Exception: + return None + + def to_cache( + self: "Listing", + post_url: str, + local_cache: Cache | None = None, + ) -> None: + (cache if local_cache is None else local_cache).set( + (CacheType.LISTING_DETAILS.value, post_url.split("?")[0]), + asdict(self), + tag=CacheType.LISTING_DETAILS.value, + ) diff --git a/src/ai_marketplace_monitor/marketplace.py b/src/ai_marketplace_monitor/marketplace.py new file mode 100644 index 0000000..bbbe06e --- /dev/null +++ b/src/ai_marketplace_monitor/marketplace.py @@ -0,0 +1,483 @@ +import time +from dataclasses import dataclass, field +from enum import Enum +from logging import Logger +from typing import Any, Callable, Generator, Generic, List, Type, TypeVar + +from playwright.sync_api import Browser, ElementHandle, Locator, Page # type: ignore + +from .listing import Listing +from .utils import BaseConfig, KeyboardMonitor, Translator, convert_to_seconds, hilight + + +class MarketPlace(Enum): + FACEBOOK = "facebook" + + +@dataclass +class MarketItemCommonConfig(BaseConfig): + """Item options that can be specified in market (non-marketplace specifc) + + This class defines and processes options that can be specified + in both marketplace and item sections, generic to all marketplaces + """ + + ai: List[str] | None = None + exclude_sellers: List[str] | None = None + notify: List[str] | None = None + search_city: List[str] | None = None + city_name: List[str] | None = None + # radius must be processed after search_city + radius: List[int] | None = None + search_interval: int | None = None + max_search_interval: int | None = None + start_at: List[str] | None = None + search_region: List[str] | None = None + max_price: int | None = None + min_price: int | None = None + rating: List[int] | None = None + prompt: str | None = None + extra_prompt: str | None = None + rating_prompt: str | None = None + + def handle_ai(self: "MarketItemCommonConfig") -> None: + if self.ai is None: + return + + if isinstance(self.ai, str): + self.ai = [self.ai] + if not all(isinstance(x, str) for x in self.ai): + raise ValueError(f"Item {hilight(self.name)} ai must be a string or list.") + + def handle_exclude_sellers(self: "MarketItemCommonConfig") -> None: + if self.exclude_sellers is None: + return + + if isinstance(self.exclude_sellers, str): + self.exclude_sellers = [self.exclude_sellers] + if not isinstance(self.exclude_sellers, list) or not all( + isinstance(x, str) for x in self.exclude_sellers + ): + raise ValueError(f"Item {hilight(self.name)} exclude_sellers must be a list.") + + def handle_max_search_interval(self: "MarketItemCommonConfig") -> None: + if self.max_search_interval is None: + return + + if isinstance(self.max_search_interval, str): + try: + self.max_search_interval = convert_to_seconds(self.max_search_interval) + except Exception as e: + raise ValueError( + f"Marketplace {self.name} max_search_interval {self.max_search_interval} is not recognized." + ) from e + if not isinstance(self.max_search_interval, int) or self.max_search_interval < 1: + raise ValueError( + f"Item {hilight(self.name)} max_search_interval must be at least 1 second." + ) + + def handle_notify(self: "MarketItemCommonConfig") -> None: + if self.notify is None: + return + + if isinstance(self.notify, str): + self.notify = [self.notify] + if not all(isinstance(x, str) for x in self.notify): + raise ValueError( + f"Item {hilight(self.name)} notify must be a string or list of string." + ) + + def handle_radius(self: "MarketItemCommonConfig") -> None: + if self.radius is None: + return + + if self.search_city is None: + raise ValueError( + f"Item {hilight(self.name)} radius must be None if search_city is None." + ) + + if isinstance(self.radius, int): + self.radius = [self.radius] + + if not all(isinstance(x, int) for x in self.radius): + raise ValueError( + f"Item {hilight(self.name)} radius must be one or a list of integers." + ) + + if len(self.radius) != len(self.search_city): + raise ValueError( + f"Item {hilight(self.name)} radius must be the same length as search_city." + ) + + def handle_search_city(self: "MarketItemCommonConfig") -> None: + if self.search_city is None: + return + + if isinstance(self.search_city, str): + self.search_city = [self.search_city] + + if not isinstance(self.search_city, list) or not all( + isinstance(x, str) for x in self.search_city + ): + raise ValueError( + f"Item {hilight(self.name)} search_city must be a string or list of string." + ) + + def handle_city_name(self: "MarketItemCommonConfig") -> None: + if self.city_name is None: + if self.search_city is None: + return + self.city_name = [x.capitalize() for x in self.search_city] + return + + if self.search_city is None: + raise ValueError( + f"Item {hilight(self.name)} city_name must be None if search_city is None." + ) + if isinstance(self.city_name, str): + self.city_name = [self.city_name] + # check if city_name is a list of strings + if not isinstance(self.city_name, list) or not all( + isinstance(x, str) for x in self.city_name + ): + raise ValueError(f"Region {self.name} city_name must be a list of strings.") + + if len(self.city_name) != len(self.search_city): + raise ValueError( + f"Region {self.name} city_name ({self.city_name}) must be the same length as search_city ({self.search_city})." + ) + + def handle_search_interval(self: "MarketItemCommonConfig") -> None: + if self.search_interval is None: + return + + if isinstance(self.search_interval, str): + try: + self.search_interval = convert_to_seconds(self.search_interval) + except Exception as e: + raise ValueError( + f"Marketplace {self.name} search_interval {self.search_interval} is not recognized." + ) from e + if not isinstance(self.search_interval, int) or self.search_interval < 1: + raise ValueError( + f"Item {hilight(self.name)} search_interval must be at least 1 second." + ) + + def handle_search_region(self: "MarketItemCommonConfig") -> None: + if self.search_region is None: + return + + if isinstance(self.search_region, str): + self.search_region = [self.search_region] + + if not isinstance(self.search_region, list) or not all( + isinstance(x, str) for x in self.search_region + ): + raise ValueError( + f"Item {hilight(self.name)} search_region must be one or a list of string." + ) + + def handle_max_price(self: "MarketItemCommonConfig") -> None: + if self.max_price is None: + return + if not isinstance(self.max_price, int): + raise ValueError(f"Item {hilight(self.name)} max_price must be an integer.") + + def handle_min_price(self: "MarketItemCommonConfig") -> None: + if self.min_price is None: + return + + if not isinstance(self.min_price, int): + raise ValueError(f"Item {hilight(self.name)} min_price must be an integer.") + + def handle_start_at(self: "MarketItemCommonConfig") -> None: + if self.start_at is None: + return + + if isinstance(self.start_at, str): + self.start_at = [self.start_at] + + if not isinstance(self.start_at, list) or not all( + isinstance(x, str) for x in self.start_at + ): + raise ValueError( + f"Item {hilight(self.name)} start_at must be a string or list of string." + ) + + # start_at should be in one of the format of + # HH:MM:SS, HH:MM, *:MM:SS, or *:MM, or *:*:SS + # where HH, MM, SS are hour, minutes and seconds + # and * can be any number + # if not, raise ValueError + for val in self.start_at: + if ( + val.count(":") not in (1, 2) + or val.count("*") == 3 + or not all(x == "*" or (x.isdigit() and len(x) == 2) for x in val.split(":")) + ): + raise ValueError(f"Item {hilight(self.name)} start_at {val} is not recognized.") + # + acceptable = False + for pattern in ["%H:%M:%S", "%H:%M", "*:%M:%S", "*:%M", "*:*:%S"]: + try: + time.strptime(val, pattern) + acceptable = True + break + except ValueError: + pass + if not acceptable: + raise ValueError(f"Item {hilight(self.name)} start_at {val} is not recognized.") + + def handle_rating(self: "MarketItemCommonConfig") -> None: + if self.rating is None: + return + if isinstance(self.rating, int): + self.rating = [self.rating] + + if not all(isinstance(x, int) and x >= 1 and x <= 5 for x in self.rating): + raise ValueError( + f"Item {hilight(self.name)} rating must be one or a list of integers between 1 and 5 inclusive." + ) + + def handle_prompt(self: "MarketItemCommonConfig") -> None: + if self.prompt is None: + return + if not isinstance(self.prompt, str): + raise ValueError(f"Item {hilight(self.name)} requires a string prompt, if specified.") + + def handle_extra_prompt(self: "MarketItemCommonConfig") -> None: + if self.extra_prompt is None: + return + if not isinstance(self.extra_prompt, str): + raise ValueError( + f"Item {hilight(self.name)} requires a string extra_prompt, if specified." + ) + + def handle_rating_prompt(self: "MarketItemCommonConfig") -> None: + if self.rating_prompt is None: + return + if not isinstance(self.rating_prompt, str): + raise ValueError( + f"Item {hilight(self.name)} requires a string rating_prompt, if specified." + ) + + +@dataclass +class MarketplaceConfig(MarketItemCommonConfig): + """Generic marketplace config""" + + # name of market, right now facebook is the only supported one + market_type: str | None = MarketPlace.FACEBOOK.value + language: str | None = None + + def handle_market_type(self: "MarketplaceConfig") -> None: + if self.market_type is None: + return + if not isinstance(self.market_type, str): + raise ValueError(f"Marketplace {hilight(self.market_type)} market must be a string.") + if self.market_type.lower() != MarketPlace.FACEBOOK.value: + raise ValueError( + f"Marketplace {hilight(self.market_type)} market must be {MarketPlace.FACEBOOK.value}." + ) + + def handle_language(self: "MarketplaceConfig") -> None: + if self.language is None: + return + if not isinstance(self.language, str): + raise ValueError( + f"Marketplace {hilight(self.market_type)} language, if specified, must be a string." + ) + + +@dataclass +class ItemConfig(MarketItemCommonConfig): + """This class defined options that can only be specified for items.""" + + # the number of times that this item has been searched + searched_count: int = 0 + + # keywords is required, all others are optional + search_phrases: List[str] = field(default_factory=list) + keywords: List[str] | None = None + antikeywords: List[str] | None = None + description: str | None = None + marketplace: str | None = None + + def handle_search_phrases(self: "ItemConfig") -> None: + if isinstance(self.search_phrases, str): + self.search_phrases = [self.search_phrases] + + if not isinstance(self.search_phrases, list) or not all( + isinstance(x, str) for x in self.search_phrases + ): + raise ValueError(f"Item {hilight(self.name)} search_phrases must be a list.") + if len(self.search_phrases) == 0: + raise ValueError(f"Item {hilight(self.name)} search_phrases list is empty.") + + def handle_antikeywords(self: "ItemConfig") -> None: + if self.antikeywords is None: + return + + if isinstance(self.antikeywords, str): + self.antikeywords = [self.antikeywords] + + if not isinstance(self.antikeywords, list) or not all( + isinstance(x, str) for x in self.antikeywords + ): + raise ValueError(f"Item {hilight(self.name)} antikeywords must be a list of strings.") + + def handle_keywords(self: "ItemConfig") -> None: + if self.keywords is None: + return + + if isinstance(self.keywords, str): + self.keywords = [self.keywords] + + if not isinstance(self.keywords, list) or not all( + isinstance(x, str) for x in self.keywords + ): + raise ValueError(f"Item {hilight(self.name)} keywords must be a list.") + + def handle_description(self: "ItemConfig") -> None: + if self.description is None: + return + if not isinstance(self.description, str): + raise ValueError(f"Item {hilight(self.name)} description must be a string.") + + +TMarketplaceConfig = TypeVar("TMarketplaceConfig", bound=MarketplaceConfig) +TItemConfig = TypeVar("TItemConfig", bound=ItemConfig) + + +class Marketplace(Generic[TMarketplaceConfig, TItemConfig]): + + def __init__( + self: "Marketplace", + name: str, + browser: Browser | None, + keyboard_monitor: KeyboardMonitor | None = None, + logger: Logger | None = None, + ) -> None: + self.name = name + self.browser = browser + self.keyboard_monitor = keyboard_monitor + self.translator = Translator() + self.logger = logger + self.page: Page | None = None + + @classmethod + def get_config(cls: Type["Marketplace"], **kwargs: Any) -> TMarketplaceConfig: + raise NotImplementedError("get_config method must be implemented by subclasses.") + + @classmethod + def get_item_config(cls: Type["Marketplace"], **kwargs: Any) -> TItemConfig: + raise NotImplementedError("get_config method must be implemented by subclasses.") + + def configure( + self: "Marketplace", config: TMarketplaceConfig, translator: Translator | None = None + ) -> None: + self.config = config + if translator is not None: + self.translator = translator + + def set_browser(self: "Marketplace", browser: Browser | None = None) -> None: + if browser is not None: + self.browser = browser + self.page = None + + def stop(self: "Marketplace") -> None: + if self.browser is not None: + # stop closing the browser since Ctrl-C will kill playwright, + # leaving browser in a dysfunctional status. + # see + # https://github.com/microsoft/playwright-python/issues/1170 + # for details. + # self.browser.close() + self.browser = None + self.page = None + + def goto_url(self: "Marketplace", url: str, attempt: int = 0) -> None: + try: + assert self.page is not None + if self.logger: + self.logger.debug(f'{hilight("[Retrieve]", "info")} Navigating to {url}') + self.page.goto(url, timeout=0) + self.page.wait_for_load_state("domcontentloaded") + except KeyboardInterrupt: + raise + except Exception as e: + if attempt == 10: + raise RuntimeError(f"Failed to navigate to {url} after 10 attempts. {e}") from e + time.sleep(5) + self.goto_url(url, attempt + 1) + + def search(self: "Marketplace", item: TItemConfig) -> Generator[Listing, None, None]: + raise NotImplementedError("Search method must be implemented by subclasses.") + + +class WebPage: + + def __init__( + self: "WebPage", + page: Page, + translator: Translator | None = None, + logger: Logger | None = None, + ) -> None: + self.page = page + self.translator: Translator = Translator() if translator is None else translator + self.logger = logger + + def _parent_with_cond( + self: "WebPage", + element: Locator | ElementHandle | None, + cond: Callable, + ret: Callable | int, + ) -> str: + """Finding a parent element + + Starting from `element`, finding its parents, until `cond` matches, then return the `ret`th children, + or a callable. + """ + if element is None: + return "" + # get up at the DOM level, testing the children elements with cond, + # apply the res callable to return a string + parent: ElementHandle | None = ( + element.element_handle() if isinstance(element, Locator) else element + ) + # look for parent of approximate_element until it has two children and the first child is the heading + while parent: + children = parent.query_selector_all(":scope > *") + if cond(children): + if isinstance(ret, int): + return children[ret].text_content() or self.translator("**unspecified**") + else: + return ret(children) + parent = parent.query_selector("xpath=..") + raise ValueError("Could not find parent element with condition.") + + def _children_with_cond( + self: "WebPage", + element: Locator | ElementHandle | None, + cond: Callable, + ret: Callable | int, + ) -> str: + if element is None: + return "" + # Getting the children of an element, test condition, return the `index` or apply res + # on the children element if the condition is met. Otherwise locate the first child and repeat the process. + child: ElementHandle | None = ( + element.element_handle() if isinstance(element, Locator) else element + ) + # look for parent of approximate_element until it has two children and the first child is the heading + while child: + children = child.query_selector_all(":scope > *") + if cond(children): + if isinstance(ret, int): + return children[ret].text_content() or self.translator("**unspecified**") + return ret(children) + if not children: + raise ValueError("Could not find child element with condition.") + # or we could use query_selector("./*[1]") + child = children[0] + raise ValueError("Could not find child element with condition.") diff --git a/src/ai_marketplace_monitor/monitor.py b/src/ai_marketplace_monitor/monitor.py new file mode 100644 index 0000000..da972e0 --- /dev/null +++ b/src/ai_marketplace_monitor/monitor.py @@ -0,0 +1,666 @@ +import sys +import time +from logging import Logger +from pathlib import Path +from typing import ClassVar, List + +import humanize +import inflect +import rich +import schedule # type: ignore +from playwright.sync_api import Browser, Playwright, sync_playwright +from rich.pretty import pretty_repr +from rich.prompt import Prompt + +from .ai import AIBackend, AIResponse +from .config import Config, supported_ai_backends, supported_marketplaces +from .listing import Listing +from .marketplace import Marketplace, TItemConfig, TMarketplaceConfig +from .notification import NotificationStatus +from .user import User +from .utils import ( + CounterItem, + KeyboardMonitor, + SleepStatus, + Translator, + amm_home, + cache, + calculate_file_hash, + counter, + doze, + hilight, +) + + +class MarketplaceMonitor: + active_marketplaces: ClassVar = {} + + def __init__( + self: "MarketplaceMonitor", + config_files: List[Path] | None, + headless: bool | None, + logger: Logger | None, + ) -> None: + for file_path in config_files or []: + if not file_path.exists(): + raise FileNotFoundError(f"Config file {file_path} not found.") + default_config = amm_home / "config.toml" + self.config_files = ([default_config] if default_config.exists() else []) + ( + [x.expanduser().resolve() for x in config_files or []] + ) + # + self.config: Config | None = None + self.config_hash: str | None = None + self.headless = headless + self.ai_agents: List[AIBackend] = [] + self.keyboard_monitor: KeyboardMonitor | None = None + self.playwright: Playwright = sync_playwright().start() + self.browser: Browser | None = None + self.logger = logger + + def load_config_file(self: "MarketplaceMonitor") -> Config: + """Load the configuration file.""" + last_invalid_hash = None + while True: + new_file_hash = calculate_file_hash(self.config_files) + config_changed = self.config_hash is None or new_file_hash != self.config_hash + if not config_changed: + assert self.config is not None + return self.config + try: + # if the config file is ok, break + assert self.logger is not None + self.config = Config(self.config_files, self.logger) + self.config_hash = new_file_hash + # self.logger.debug(self.config) + assert self.config is not None + return self.config + except KeyboardInterrupt: + raise + except Exception as e: + if last_invalid_hash != new_file_hash: + last_invalid_hash = new_file_hash + if self.logger: + self.logger.error( + f"""{hilight("[Config]", "fail")} Error parsing:\n\n{hilight(str(e), "fail")}\n\nPlease fix the configuration and I will try again as soon as you are done.""" + ) + doze(60, self.config_files, self.keyboard_monitor) + continue + + def load_ai_agents(self: "MarketplaceMonitor") -> None: + """Load the AI agent.""" + assert self.config is not None + for ai_config in (self.config.ai or {}).values(): + if ai_config.enabled is False: + continue + if ( + ai_config.provider is not None + and ai_config.provider.lower() in supported_ai_backends + ): + ai_class = supported_ai_backends[ai_config.provider.lower()] + elif ai_config.name.lower() in supported_ai_backends: + ai_class = supported_ai_backends[ai_config.name.lower()] + else: + if self.logger: + self.logger.error( + f"""{hilight("[Config]", "fail")} Cannot determine an AI service provider from service name or provider.""" + ) + continue + + try: + self.ai_agents.append(ai_class(config=ai_config, logger=self.logger)) + # self.ai_agents[-1].connect() + # self.logger.info( + # f"""{hilight("[AI]", "succ")} Connected to {hilight(ai_config.name)}""" + # ) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.error( + f"""{hilight("[AI]", "fail")} Failed to connect to {hilight(ai_config.name, "fail")}: {e}""" + ) + continue + + def search_item( + self: "MarketplaceMonitor", + marketplace_config: TMarketplaceConfig, + marketplace: Marketplace, + item_config: TItemConfig, + ) -> None: + """Search for an item on the marketplace.""" + new_listings: List[Listing] = [] + listing_ratings = [] + # users to notify is determined from item, then marketplace, then all users + assert self.config is not None + users_to_notify = ( + item_config.notify or marketplace_config.notify or list(self.config.user.keys()) + ) + for listing in marketplace.search(item_config): + # duplicated ID should not happen, but sellers could repost the same listing, + # potentially under different seller names + if listing.id in [x.id for x in new_listings] or listing.content in [ + x.content for x in new_listings + ]: + if self.logger: + self.logger.debug(f"Found duplicated result for {listing}") + continue + # if everyone has been notified + if all( + User(self.config.user[user], self.logger).notification_status(listing) + == NotificationStatus.NOTIFIED + for user in users_to_notify + ): + if self.logger: + self.logger.info( + f"""{hilight("[Skip]", "info")} Already sent notification for item {hilight(listing.title)}, skipping.""" + ) + continue + # for x in self.find_new_items(found_items) + res = self.evaluate_by_ai( + listing, item_config=item_config, marketplace_config=marketplace_config + ) + if self.logger: + if res.comment == AIResponse.NOT_EVALUATED: + if res.name: + self.logger.info( + f"""{hilight("[AI]", res.style)} {res.name or "AI"} did not evaluate {hilight(listing.title)}.""" + ) + else: + self.logger.info( + f"""{hilight("[AI]", res.style)} No AI available to evaluate {hilight(listing.title)}.""" + ) + else: + self.logger.info( + f"""{hilight("[AI]", res.style)} {res.name or "AI"} concludes {hilight(f"{res.conclusion} ({res.score}): {res.comment}", res.style)} for listing {hilight(listing.title)}.""" + ) + if item_config.rating: + acceptable_rating = item_config.rating[ + 0 if item_config.searched_count == 0 else -1 + ] + elif marketplace_config.rating: + acceptable_rating = marketplace_config.rating[ + 0 if item_config.searched_count == 0 else -1 + ] + else: + acceptable_rating = 3 + + if res.score < acceptable_rating: + if self.logger: + self.logger.info( + f"""{hilight("[Skip]", "fail")} Rating {hilight(f"{res.conclusion} ({res.score})")} for {listing.title} is below threshold {acceptable_rating}.""" + ) + counter.increment(CounterItem.EXCLUDED_LISTING, item_config.name) + continue + new_listings.append(listing) + listing_ratings.append(res) + + p = inflect.engine() + if self.logger: + self.logger.info( + f"""{hilight("[Search]", "succ" if len(new_listings) > 0 else "fail")} {hilight(str(len(new_listings)))} new {p.plural_noun("listing", len(new_listings))} for {item_config.name} {p.plural_verb("is", len(new_listings))} found.""" + ) + if new_listings: + counter.increment( + CounterItem.NEW_VALIDATED_LISTING, item_config.name, len(new_listings) + ) + for user in users_to_notify: + User(self.config.user[user], logger=self.logger).notify( + new_listings, listing_ratings, item_config + ) + time.sleep(5) + + def _select_translator( + self: "MarketplaceMonitor", language: str | None = None + ) -> Translator | None: + """Select the language for the marketplace.""" + # self.config.translator.get(marketplace_config.language, None) + assert self.config is not None + if not language: + return None + if language in self.config.translator: + return self.config.translator[language] + # if there is no exact match, we are going to match the language code + # e.g. 'en' to 'en_US' + if "_" in language: + # if a more general languge exists? + if language.split("_")[0] in self.config.translator: + translator = self.config.translator[language.split("_")[0]] + if self.logger: + self.logger.info( + f"""{hilight("[Translator]", "info")} Using language {language.split("_")[0]} (locale {translator.locale}) for {language} translation.""" + ) + return translator + # if not, we are going to match the language code + # e.g. 'en' to 'en_US' + for name, translator in self.config.translator.items(): + if name.startswith(language.split("_")[0] + "_"): + if self.logger: + self.logger.info( + f"""{hilight("[Translator]", "info")} Using language {name} (locale {translator.locale}) for {language} translation.""" + ) + return translator + # if there is no match, we are going to match the language code + # e.g. 'en' to 'en_US' + for name, translator in self.config.translator.items(): + if name.startswith(language + "_"): + if self.logger: + self.logger.info( + f"""{hilight("[Translator]", "info")} Using language {name} (locale {translator.locale}) for {language} translation.""" + ) + return translator + raise RuntimeError(f"Cannot find translator for language {language}.") + + def schedule_jobs(self: "MarketplaceMonitor") -> None: + """Schedule jobs to run periodically.""" + # we reload the config file each time when a scan action is completed + # this allows users to add/remove products dynamically. + self.load_config_file() + self.load_ai_agents() + + assert self.config is not None + for marketplace_config in self.config.marketplace.values(): + if marketplace_config.enabled is False: + continue + marketplace_class = supported_marketplaces[marketplace_config.name] + if marketplace_config.name in self.active_marketplaces: + marketplace = self.active_marketplaces[marketplace_config.name] + else: + marketplace = marketplace_class( + marketplace_config.name, self.browser, self.keyboard_monitor, self.logger + ) + self.active_marketplaces[marketplace_config.name] = marketplace + + # Configure might have been changed + marketplace.configure( + marketplace_config, + translator=self._select_translator(marketplace_config.language), + ) + + for item_config in self.config.item.values(): + if item_config.enabled is False: + continue + + if ( + item_config.marketplace is None + or item_config.marketplace == marketplace_config.name + ): + # wait for some time before next search + # interval (in minutes) can be defined both for the marketplace + # if there is any configuration file change, stop sleeping and search again + scheduled = None + start_at_list = item_config.start_at or marketplace_config.start_at + if start_at_list is not None and start_at_list: + for start_at in start_at_list: + if start_at.startswith("*:*:"): + # '*:*:12' to ':12' + if self.logger: + self.logger.info( + f"""{hilight("[Schedule]", "info")} Scheduling to search for {item_config.name} every minute at {start_at[3:]}s""" + ) + scheduled = schedule.every().minute.at(start_at[3:]) + elif start_at.startswith("*:"): + # '*:12:12' or '*:12' + if self.logger: + self.logger.info( + f"""{hilight("[Schedule]", "info")} Scheduling to search for {item_config.name} every hour at {start_at[1:]}m""" + ) + scheduled = schedule.every().hour.at( + start_at[1:] if start_at.count(":") == 1 else start_at[2:] + ) + else: + # '12:12:12' or '12:12' + if self.logger: + self.logger.info( + f"""{hilight("[Schedule]", "ss")} Scheduling to search for {item_config.name} every day at {start_at}""" + ) + scheduled = schedule.every().day.at(start_at) + else: + search_interval = max( + item_config.search_interval + or marketplace_config.search_interval + or 30 * 60, + 1, + ) + max_search_interval = max( + item_config.max_search_interval + or marketplace_config.max_search_interval + or 60 * 60, + search_interval, + ) + if self.logger: + self.logger.info( + f"""{hilight("[Schedule]", "info")} Scheduling to search for {item_config.name} every {humanize.naturaldelta(search_interval)} {'' if search_interval == max_search_interval else f'to {humanize.naturaldelta(max_search_interval)}'}""" + ) + scheduled = schedule.every(search_interval).to(max_search_interval).seconds + if scheduled is None: + raise ValueError( + f"Cannot determine a schedule for {item_config.name} from configuration file." + ) + scheduled.do( + self.search_item, + marketplace_config, + marketplace, + item_config, + ).tag(item_config.name) + + def handle_pause(self: "MarketplaceMonitor") -> None: + """Handle interruption signal.""" + if self.keyboard_monitor is None or not self.keyboard_monitor.is_paused(): + return + + rich.print(counter) + if not self.keyboard_monitor.confirm(): + return + + # now we should go to an interactive session + while True: + while True: + url = ( + Prompt.ask( + f"""\nEnter an {hilight("ID")} or a {hilight("URL")} to check, or {hilight("exit")}.""" + ) + .strip("\x1b") + .strip() + ) + + if not url.isnumeric() and not url.startswith("https://"): + if url.endswith("exit"): + url = "exit" + break + if url: + print(f'Invalid input "{url}". Please try again.') + else: + break + + if url == "exit": + break + + try: + self.check_items([url], for_item=None) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.debug(f"Failed to check item {url}: {e}") + + def start_monitor(self: "MarketplaceMonitor") -> None: + """Main function to monitor the marketplace.""" + # start a browser with playwright, cannot use with statement since the jobs will be + # executed outside of the scope by schedule job runner + self.keyboard_monitor = KeyboardMonitor() + self.keyboard_monitor.start() + + # Open a new browser page. + self.load_config_file() + assert self.config is not None + self.browser = self.playwright.chromium.launch( + headless=self.headless, proxy=self.config.monitor.get_proxy_options() + ) + # + assert self.browser is not None + while True: + self.handle_pause() + self.schedule_jobs() + if not schedule.get_jobs(): + # this actually should not happen because at least one item is required for the configuration file + if self.logger: + self.logger.error( + "No search job is defined. Please add search items to your config file." + ) + self.handle_pause() + if doze(60, self.config_files, self.keyboard_monitor) == SleepStatus.BY_KEYBOARD: + self.keyboard_monitor.set_paused(True) + continue + # run all jobs at the first time, then on their own schedule + # we could have used schedule.run_all() but we would like to check if + # configuration file has been changed, if so, clear all jobs and restart + for job in schedule.get_jobs(): + job.run() + self.handle_pause() + # if configuration file has been changed, clear all scheduled jobs and restart + new_file_hash = calculate_file_hash(self.config_files) + assert self.config_hash is not None + if new_file_hash != self.config_hash: + if self.logger: + self.logger.info( + f"""{hilight("[Config]", "info")} Config file changed, restarting monitor.""" + ) + schedule.clear() + break + if not schedule.get_jobs(): + continue + # subsequent runs will be scheduled runs + while True: + next_job: schedule.Job | None = None + for job in schedule.jobs: + if job.next_run is None: + continue + if next_job is None or ( + next_job.next_run and next_job.next_run > job.next_run + ): + next_job = job + + if next_job is None: + # no more job + if self.logger: + self.logger.warning( + f"""{hilight("[Schedule]", "fail")} No more active search job.""" + ) + sys.exit(0) + # assert next_job is not None + assert next_job.next_run is not None + idle_seconds = schedule.idle_seconds() or 0 + if idle_seconds > 60: + # the sleep time might not be enough, causing this message + # to be sent repeatedly. Having a idle_seconds > 60 helps + # to reduce the frequency of this message. + if self.logger: + self.logger.info( + f"""{hilight("[Schedule]", "info")} Next job to search {hilight(str(next(iter(next_job.tags))))} scheduled to run in {humanize.naturaldelta(idle_seconds)} at {next_job.next_run.strftime("%Y-%m-%d %H:%M:%S")}""" + ) + + # sleep at most 1 hr, and print updated "next job" message + res = doze( + min(max(5, int(idle_seconds)), 60 * 60), + self.config_files, + self.keyboard_monitor, + ) + if res == SleepStatus.BY_FILE_CHANGE: + # if configuration file has been changed, clear all scheduled jobs and restart + new_file_hash = calculate_file_hash(self.config_files) + assert self.config_hash is not None + if new_file_hash != self.config_hash: + if self.logger: + self.logger.info( + f"""{hilight("[Config]", "info")} Config file changed, restarting monitor.""" + ) + schedule.clear() + break + elif res == SleepStatus.BY_KEYBOARD: + self.keyboard_monitor.set_paused(True) + + self.handle_pause() + schedule.run_pending() + + def stop_monitor(self: "MarketplaceMonitor") -> None: + """Stop the monitor.""" + for marketplace in self.active_marketplaces.values(): + marketplace.stop() + self.playwright.stop() + if self.keyboard_monitor: + self.keyboard_monitor.stop() + cache.close() + + def check_items( + self: "MarketplaceMonitor", items: List[str] | None = None, for_item: str | None = None + ) -> None: + """Main function to monitor the marketplace.""" + # we reload the config file each time when a scan action is completed + # this allows users to add/remove products dynamically. + self.load_config_file() + + if for_item is not None: + assert self.config is not None + if for_item not in self.config.item: + raise ValueError( + f"Item {for_item} not found in config, available items are {', '.join(self.config.item.keys())}." + ) + + self.load_ai_agents() + + post_urls = [] + for post_url in items or []: + if post_url.isnumeric(): + post_url = f"https://www.facebook.com/marketplace/item/{post_url}/" + + if not post_url.startswith("https://www.facebook.com/marketplace/item"): + raise ValueError(f"URL {post_url} is not a valid Facebook Marketplace URL.") + post_urls.append(post_url) + + if not post_urls: + raise ValueError("No URLs to check.") + + # Open a new browser page. + for post_url in post_urls or []: + # check if item in config + assert self.config is not None + + # which marketplace to check it? + for marketplace_config in self.config.marketplace.values(): + if marketplace_config.enabled is False: + continue + marketplace_class = supported_marketplaces[marketplace_config.name] + if marketplace_config.name in self.active_marketplaces: + marketplace = self.active_marketplaces[marketplace_config.name] + else: + marketplace = marketplace_class( + marketplace_config.name, None, None, self.logger + ) + self.active_marketplaces[marketplace_config.name] = marketplace + + # Configure might have been changed + marketplace.configure( + marketplace_config, + translator=self._select_translator(marketplace_config.language), + ) + + # do we need a browser? + if Listing.from_cache(post_url) is None: + if self.browser is None: + if self.logger: + self.logger.info( + f"""{hilight("[Search]", "info")} Starting a browser because the item was not checked before.""" + ) + self.browser = self.playwright.chromium.launch( + headless=self.headless, proxy=self.config.monitor.get_proxy_options() + ) + marketplace.set_browser(self.browser) + + # ignore enabled + if for_item is None: + # get by asking user + name = None + item_names = list(self.config.item.keys()) + if len(item_names) > 1: + name = Prompt.ask( + f"""Enter name of {hilight("search item")}""", choices=item_names + ) + item_config = self.config.item[name or item_names[0]] + else: + item_config = self.config.item[for_item] + + # do not search, get the item details directly + listing: Listing = marketplace.get_listing_details(post_url, item_config) + + if self.logger: + self.logger.info( + f"""{hilight("[Retrieve]", "succ")} Details of the item is found: {pretty_repr(listing)}""" + ) + + if self.logger: + self.logger.info( + f"""{hilight("[Search]", "succ")} Checking {post_url} for item {item_config.name} with configuration {pretty_repr(item_config)}""" + ) + marketplace.check_listing(listing, item_config) + rating = self.evaluate_by_ai( + listing, item_config=item_config, marketplace_config=marketplace_config + ) + if self.logger: + if rating.comment == AIResponse.NOT_EVALUATED: + if rating.name: + self.logger.info( + f"""{hilight("[AI]", rating.style)} {rating.name or "AI"} did not evaluate {hilight(listing.title)}.""" + ) + else: + self.logger.info( + f"""{hilight("[AI]", rating.style)} No AI available to evaluate {hilight(listing.title)}.""" + ) + else: + self.logger.info( + f"""{hilight("[AI]", rating.style)} {rating.name or "AI"} concludes {hilight(f"{rating.conclusion} ({rating.score}): {rating.comment}", rating.style)} for listing {hilight(listing.title)}.""" + ) + # notification status? + users_to_notify = ( + item_config.notify + or marketplace_config.notify + or list(self.config.user.keys()) + ) + # for notification usages + listing.name = item_config.name + for user in users_to_notify: + ns = User(self.config.user[user], self.logger).notification_status(listing) + if self.logger: + if ns == NotificationStatus.NOTIFIED: + self.logger.info( + f"""{hilight("[Notify]", "succ")} Notified {user} about {post_url}.""" + ) + elif ns == NotificationStatus.EXPIRED: + self.logger.info( + f"""{hilight("[Notify]", "info")} Already notified {user} about {post_url}. The notification is ow expired.""" + ) + elif ns == NotificationStatus.LISTING_CHANGED: + self.logger.info( + f"""{hilight("[Notify]", "info")} Already notified {user} about {post_url}, but the listing is now changed.""" + ) + elif ns == NotificationStatus.LISTING_DISCOUNTED: + self.logger.info( + f"""{hilight("[Notify]", "info")} Already notified {user} about {post_url}, but the listing is now discounted.""" + ) + else: + self.logger.info( + f"""{hilight("[Notify]", "info")} Not notified {user} about {post_url} yet.""" + ) + + # testing notification + # User(self.config.user[user], logger=self.logger).notify( + # [listing], [rating], item_config, force=True + # ) + + def evaluate_by_ai( + self: "MarketplaceMonitor", + item: Listing, + item_config: TItemConfig, + marketplace_config: TMarketplaceConfig, + ) -> AIResponse: + if item_config.ai is not None: + ai_agents = item_config.ai + elif marketplace_config.ai is not None: + ai_agents = marketplace_config.ai + else: + ai_agents = None + # + for agent in self.ai_agents: + if ai_agents is not None and agent.config.name not in ai_agents: + continue + try: + return agent.evaluate(item, item_config, marketplace_config) + except KeyboardInterrupt: + raise + except Exception as e: + if self.logger: + self.logger.error( + f"""{hilight("[AI]", "fail")} Failed to get an answer from {agent.config.name}: {e}""" + ) + continue + return AIResponse(5, AIResponse.NOT_EVALUATED) diff --git a/src/ai_marketplace_monitor/notification.py b/src/ai_marketplace_monitor/notification.py new file mode 100644 index 0000000..55d011e --- /dev/null +++ b/src/ai_marketplace_monitor/notification.py @@ -0,0 +1,200 @@ +import time +from collections import defaultdict +from dataclasses import dataclass, fields +from enum import Enum +from logging import Logger +from typing import Any, ClassVar, DefaultDict, List, Optional, Tuple, Type + +import inflect + +from .ai import AIResponse # type: ignore +from .listing import Listing +from .utils import BaseConfig, hilight + + +class NotificationStatus(Enum): + NOT_NOTIFIED = 0 + EXPIRED = 1 + NOTIFIED = 2 + LISTING_CHANGED = 3 + LISTING_DISCOUNTED = 4 + + +@dataclass +class NotificationConfig(BaseConfig): + required_fields: ClassVar[List[str]] = [] + + max_retries: int = 5 + retry_delay: int = 60 + + def handle_max_retries(self: "NotificationConfig") -> None: + if not isinstance(self.max_retries, int): + raise ValueError("max_retries must be an integer.") + + def handle_retry_delay(self: "NotificationConfig") -> None: + if not isinstance(self.retry_delay, int): + raise ValueError("retry_delay must be an integer.") + + def _has_required_fields(self: "NotificationConfig") -> bool: + return all(getattr(self, field, None) is not None for field in self.required_fields) + + @classmethod + def get_config( + cls: Type["NotificationConfig"], **kwargs: Any + ) -> Optional["NotificationConfig"]: + """Get the specific subclass name from the specified keys, for validation purposes""" + for subclass in cls.__subclasses__(): + acceptable_keys = {field.name for field in fields(subclass)} + if all(name in acceptable_keys for name in kwargs.keys()): + return subclass(**{k: v for k, v in kwargs.items() if k != "type"}) + res = subclass.get_config(**kwargs) + if res is not None: + return res + return None + + @classmethod + def notify_all( + cls: type["NotificationConfig"], config: "NotificationConfig", *args, **kwargs: Any + ) -> bool: + """Call the notify method of all subclasses""" + succ = [] + for subclass in cls.__subclasses__(): + if hasattr(subclass, "notify") and subclass.__name__ not in [ + "UserConfig", + "PushNotificationConfig", + ]: + succ.append(subclass.notify(config, *args, **kwargs)) + # subclases + succ.append(subclass.notify_all(config, *args, **kwargs)) + return any(succ) + + def send_message_with_retry( + self: "NotificationConfig", + title: str, + message: str, + logger: Logger | None = None, + ) -> bool: + if not self._has_required_fields(): + return False + + for attempt in range(self.max_retries): + try: + res = self.send_message(title=title, message=message, logger=logger) + if logger: + logger.info( + f"""{hilight("[Notify]", "succ")} Sent {self.name} a message with title {hilight(title)}""" + ) + return res + except KeyboardInterrupt: + raise + except Exception as e: + if logger: + logger.debug( + f"""{hilight("[Notify]", "fail")} Attempt {attempt + 1} failed: {e}""" + ) + if attempt < self.max_retries - 1: + if logger: + logger.debug( + f"""{hilight("[Notify]", "fail")} Retrying in {self.retry_delay} seconds...""" + ) + time.sleep(self.retry_delay) + else: + if logger: + logger.error( + f"""{hilight("[Notify]", "fail")} Max retries reached. Failed to push note to {self.name}.""" + ) + return False + return False + + def send_message( + self: "NotificationConfig", + title: str, + message: str, + logger: Logger | None = None, + ) -> bool: + raise NotImplementedError("send_message needs to be defined.") + + +@dataclass +class PushNotificationConfig(NotificationConfig): + message_format: str | None = None + + def handle_message_format(self: "PushNotificationConfig") -> None: + if self.message_format is None: + self.message_format = "plain_text" + + if self.message_format not in ["plain_text", "markdown"]: + raise ValueError("message_format must be 'plain_text' or 'markdown'.") + + def notify( + self: "PushNotificationConfig", + listings: List[Listing], + ratings: List[AIResponse], + notification_status: List[NotificationStatus], + force: bool = False, + logger: Logger | None = None, + ) -> bool: + if not self._has_required_fields(): + return False + # + # we send listings with different status with different messages + msgs: DefaultDict[NotificationStatus, List[Tuple[Listing, str]]] = defaultdict(list) + p = inflect.engine() + for listing, rating, ns in zip(listings, ratings, notification_status): + if ns == NotificationStatus.NOTIFIED and not force: + continue + msg = ( + ( + ( + f"{listing.title}\n{listing.price}, {listing.location}\n" + f"{listing.post_url.split('?')[0]}" + ) + if rating.comment == AIResponse.NOT_EVALUATED + else ( + f"[{rating.conclusion} ({rating.score})] {listing.title}\n" + f"{listing.price}, {listing.location}\n" + f"{listing.post_url.split('?')[0]}\n" + f"AI: {rating.comment}" + ) + ) + if self.message_format == "plain_text" + else ( + ( + f"[**{listing.title}**]({listing.post_url.split('?')[0]})\n" + f"{listing.price}, {listing.location}\n" + f"{listing.description}" + ) + if rating.comment == AIResponse.NOT_EVALUATED + else ( + f"[{rating.conclusion} ({rating.score})] " + f"[**{listing.title}**]({listing.post_url.split('?')[0]})\n" + f"{listing.price}, {listing.location}\n" + f"{listing.description}\n" + f"**AI**: {rating.comment}" + ) + ) + ) + msgs[ns].append((listing, msg)) + + if not msgs: + if logger: + logger.debug("No new listings to notify.") + return False + + for ns, listing_msg in msgs.items(): + if ns == NotificationStatus.NOT_NOTIFIED: + title = f"Found {len(listing_msg)} new {p.plural_noun(listing.name, len(listing_msg))} from {listing.marketplace}" + elif ns == NotificationStatus.EXPIRED: + title = f"Another look at {len(listing_msg)} {p.plural_noun(listing.name, len(listing_msg))} from {listing.marketplace}" + elif ns == NotificationStatus.LISTING_CHANGED: + title = f"Found {len(listing_msg)} updated {p.plural_noun(listing.name, len(listing_msg))} from {listing.marketplace}" + elif ns == NotificationStatus.LISTING_DISCOUNTED: + title = f"Found {len(listing_msg)} discounted {p.plural_noun(listing.name, len(listing_msg))} from {listing.marketplace}" + else: + title = f"Resend {len(listing_msg)} {p.plural_noun(listing.name, len(listing_msg))} from {listing.marketplace}" + + message = "\n\n".join([x[1] for x in listing_msg]) + # + if not self.send_message_with_retry(title, message, logger=logger): + return False + return True diff --git a/src/ai_marketplace_monitor/ntfy.py b/src/ai_marketplace_monitor/ntfy.py new file mode 100644 index 0000000..60464c3 --- /dev/null +++ b/src/ai_marketplace_monitor/ntfy.py @@ -0,0 +1,62 @@ +from dataclasses import dataclass +from logging import Logger +from typing import ClassVar, List + +import requests # type: ignore + +from .notification import PushNotificationConfig +from .utils import hilight + + +@dataclass +class NtfyNotificationConfig(PushNotificationConfig): + required_fields: ClassVar[List[str]] = ["ntfy_server", "ntfy_topic"] + + message_format: str | None = None + ntfy_server: str | None = None + ntfy_topic: str | None = None + + def handle_ntfy_server(self: "NtfyNotificationConfig") -> None: + if self.ntfy_server is None: + return + if not isinstance(self.ntfy_server, str) or not self.ntfy_server: + raise ValueError("An non-empty ntfy_server is needed.") + + if not self.ntfy_server.startswith("https://") and not self.ntfy_server.startswith( + "http://" + ): + raise ValueError("ntfy_server must start with https:// or http://") + + def handle_ntfy_topic(self: "NtfyNotificationConfig") -> None: + if self.ntfy_topic is None: + return + + if not isinstance(self.ntfy_topic, str) or not self.ntfy_topic: + raise ValueError("user requires an non-empty ntfy_topic.") + + self.ntfy_topic = self.ntfy_topic.strip() + + def send_message( + self: "NtfyNotificationConfig", + title: str, + message: str, + logger: Logger | None = None, + ) -> bool: + msg = f"{message}\n\nSent by https://github.com/BoPeng/ai-marketplace-monitor" + assert self.ntfy_server is not None + assert self.ntfy_topic is not None + requests.post( + f'{self.ntfy_server.rstrip("/")}/{self.ntfy_topic}', + msg, + headers={ + "Title": title, + "Markdown": "yes" if self.message_format == "markdown" else "no", + }, + timeout=10, + ) + + if logger: + logger.info( + f"""{hilight("[Notify]", "succ")} Sent {self.name} a message {hilight(msg)}""" + ) + return True diff --git a/src/ai_marketplace_monitor/pushbullet.py b/src/ai_marketplace_monitor/pushbullet.py new file mode 100644 index 0000000..42b8506 --- /dev/null +++ b/src/ai_marketplace_monitor/pushbullet.py @@ -0,0 +1,74 @@ +from dataclasses import dataclass +from logging import Logger +from typing import ClassVar, List + +from pushbullet import Pushbullet # type: ignore + +from .notification import PushNotificationConfig +from .utils import hilight + + +@dataclass +class PushbulletNotificationConfig(PushNotificationConfig): + required_fields: ClassVar[List[str]] = ["pushbullet_token"] + + pushbullet_token: str | None = None + pushbullet_proxy_type: str | None = None + pushbullet_proxy_server: str | None = None + + def handle_pushbullet_token(self: "PushbulletNotificationConfig") -> None: + if self.pushbullet_token is None: + return + + if not isinstance(self.pushbullet_token, str) or not self.pushbullet_token: + raise ValueError("An non-empty pushbullet_token is needed.") + self.pushbullet_token = self.pushbullet_token.strip() + + def handle_pushbullet_proxy_type(self: "PushbulletNotificationConfig") -> None: + if self.pushbullet_proxy_type is None: + return + if not isinstance(self.pushbullet_proxy_type, str) or not self.pushbullet_proxy_type: + raise ValueError("user requires an non-empty pushbullet_proxy_type.") + self.pushbullet_proxy_type = self.pushbullet_proxy_type.strip() + + def handle_pushbullet_proxy_server(self: "PushbulletNotificationConfig") -> None: + # pushbullet_proxy_server and pushbullet_proxy_type are both required to be set + # if either of them is set, then both of them must be set + if self.pushbullet_proxy_type is None and self.pushbullet_proxy_server is not None: + raise ValueError( + "user requires an non-empty pushbullet_proxy_type when pushbullet_proxy_server is set." + ) + # if pushbullet_proxy_type is set, then pushbullet_proxy_server must be set + if self.pushbullet_proxy_type is not None and self.pushbullet_proxy_server is None: + raise ValueError( + "user requires an non-empty pushbullet_proxy_server when pushbullet_proxy_type is set." + ) + if self.pushbullet_proxy_server is None: + return + if not isinstance(self.pushbullet_proxy_server, str) or not self.pushbullet_proxy_server: + raise ValueError("user requires an non-empty pushbullet_proxy_server.") + self.pushbullet_proxy_server = self.pushbullet_proxy_server.strip() + + def send_message( + self: "PushbulletNotificationConfig", + title: str, + message: str, + logger: Logger | None = None, + ) -> bool: + pb = Pushbullet( + self.pushbullet_token, + proxy=( + {self.pushbullet_proxy_type: self.pushbullet_proxy_server} + if self.pushbullet_proxy_server and self.pushbullet_proxy_type + else None + ), + ) + + pb.push_note( + title, message + "\n\nSent by https://github.com/BoPeng/ai-marketplace-monitor" + ) + if logger: + logger.info( + f"""{hilight("[Notify]", "succ")} Sent {self.name} a message with title {hilight(title)}""" + ) + return True diff --git a/src/ai_marketplace_monitor/pushover.py b/src/ai_marketplace_monitor/pushover.py new file mode 100644 index 0000000..fd0a107 --- /dev/null +++ b/src/ai_marketplace_monitor/pushover.py @@ -0,0 +1,64 @@ +import http.client +import json +import urllib +from dataclasses import dataclass +from logging import Logger +from typing import ClassVar, List + +from .notification import PushNotificationConfig +from .utils import hilight + + +@dataclass +class PushoverNotificationConfig(PushNotificationConfig): + required_fields: ClassVar[List[str]] = ["pushover_user_id", "pushover_api_token"] + + pushover_user_id: str | None = None + pushover_api_token: str | None = None + + def handle_pushover_user_id(self: "PushoverNotificationConfig") -> None: + if self.pushover_user_id is None: + return + if not isinstance(self.pushover_user_id, str) or not self.pushover_user_id: + raise ValueError("An non-empty pushover_user_id is needed.") + self.pushover_user_id = self.pushover_user_id.strip() + + def handle_pushover_api_token(self: "PushoverNotificationConfig") -> None: + if self.pushover_api_token is None: + return + + if not isinstance(self.pushover_api_token, str) or not self.pushover_api_token: + raise ValueError("user requires an non-empty pushover_api_token.") + self.pushover_api_token = self.pushover_api_token.strip() + + def send_message( + self: "PushoverNotificationConfig", + title: str, + message: str, + logger: Logger | None = None, + ) -> bool: + msg = f"{title}\n\n{message}\n\nSent by https://github.com/BoPeng/ai-marketplace-monitor" + conn = http.client.HTTPSConnection("api.pushover.net:443") + conn.request( + "POST", + "/1/messages.json", + urllib.parse.urlencode( + { + "token": self.pushover_api_token, + "user": self.pushover_user_id, + "message": msg, + } + ), + {"Content-type": "application/x-www-form-urlencoded"}, + ) + + output = conn.getresponse().read().decode("utf-8") + data = json.loads(output) + if data["status"] != 1: + raise RuntimeError(output) + else: + if logger: + logger.info( + f"""{hilight("[Notify]", "succ")} Sent {self.name} a message {hilight(msg)}""" + ) + return True diff --git a/src/ai_marketplace_monitor/py.typed b/src/ai_marketplace_monitor/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/ai_marketplace_monitor/region.py b/src/ai_marketplace_monitor/region.py new file mode 100644 index 0000000..f1cc08a --- /dev/null +++ b/src/ai_marketplace_monitor/region.py @@ -0,0 +1,57 @@ +from dataclasses import dataclass, field +from typing import List + +from .utils import BaseConfig + + +@dataclass +class RegionConfig(BaseConfig): + search_city: List[str] = field(default_factory=list) + full_name: str = "" + radius: List[int] = field(default_factory=list) + city_name: List[str] = field(default_factory=list) + + def handle_search_city(self: "RegionConfig") -> None: + if isinstance(self.search_city, str): + self.search_city = [self.search_city] + # check if search_city is a list of strings + if not isinstance(self.search_city, list) or not all( + isinstance(x, str) for x in self.search_city + ): + raise ValueError(f"Region {self.name} search_city must be a list of strings.") + + def handle_radius(self: "RegionConfig") -> None: + if isinstance(self.radius, int): + self.radius = [self.radius] + elif not self.radius: + self.radius = [500] * len(self.search_city) + elif len(self.radius) != len(self.search_city): + raise ValueError( + f"Region {self.name} radius {self.radius} must be an integer or a list of integers with the same length as search_city {self.search_city}." + ) + else: + for radius in self.radius: + if not isinstance(radius, int): + raise ValueError( + f"Region {self.name} radius must be an integer or a list of integers with the same length as search_city." + ) + + def handle_city_name(self: "RegionConfig") -> None: + if isinstance(self.city_name, str): + self.city_name = [self.city_name] + if not self.city_name: + if not self.search_city: + return + self.city_name = [x.capitalize() for x in self.search_city] + return + + # check if city_name is a list of strings + if not isinstance(self.city_name, list) or not all( + isinstance(x, str) for x in self.city_name + ): + raise ValueError(f"Region {self.name} city_name must be a list of strings.") + + if len(self.city_name) != len(self.search_city): + raise ValueError( + f"Region {self.name} city_name {self.city_name} must be the same length as search_city {self.search_city}." + ) diff --git a/src/ai_marketplace_monitor/user.py b/src/ai_marketplace_monitor/user.py new file mode 100644 index 0000000..dc2d73e --- /dev/null +++ b/src/ai_marketplace_monitor/user.py @@ -0,0 +1,193 @@ +import re +from dataclasses import dataclass +from datetime import datetime, timedelta +from logging import Logger +from typing import Any, List, Tuple, Type + +from diskcache import Cache # type: ignore + +from .ai import AIResponse # type: ignore +from .email_notify import EmailNotificationConfig +from .listing import Listing +from .marketplace import TItemConfig +from .notification import NotificationConfig, NotificationStatus +from .ntfy import NtfyNotificationConfig +from .pushbullet import PushbulletNotificationConfig +from .pushover import PushoverNotificationConfig +from .utils import CacheType, CounterItem, cache, convert_to_seconds, counter, hilight + + +@dataclass +class UserConfig( + EmailNotificationConfig, + PushbulletNotificationConfig, + PushoverNotificationConfig, + NtfyNotificationConfig, +): + """UserConfiguration + + Derive from EmailNotificationConfig, PushbulletNotificationConfig allows + the user config class to use settings from both classes. + + It is possible to dynamically added these classes as parent class + of UserConfig, but it is troublesome to make sure that these classes + are imported. + """ + + notify_with: List[str] | None = None + remind: int | None = None + + def handle_remind(self: "UserConfig") -> None: + if self.remind is None: + return + + if self.remind is False: + self.remind = None + return + + if self.remind is True: + # if set to true but no specific time, set to 1 day + self.remind = 60 * 60 * 24 + return + + if isinstance(self.remind, str): + try: + self.remind = convert_to_seconds(self.remind) + if self.remind < 60 * 60: + raise ValueError(f"Item {hilight(self.name)} remind must be at least 1 hour.") + except KeyboardInterrupt: + raise + except Exception as e: + raise ValueError( + f"Item {hilight(self.name)} remind {self.remind} is not recognized." + ) from e + + if not isinstance(self.remind, int): + raise ValueError( + f"Item {hilight(self.name)} remind must be an time (e.g. 1 day) or false." + ) + + def handle_notify_with(self: "UserConfig") -> None: + if self.notify_with is None: + return + + if isinstance(self.notify_with, str): + self.notify_with = [self.notify_with] + + if not isinstance(self.notify_with, list) or not all( + isinstance(x, str) for x in self.notify_with + ): + raise ValueError( + f"Item {hilight(self.name)} notify_with must be a list of notification section values." + ) + + +class User: + + def __init__(self: "User", config: UserConfig, logger: Logger | None = None) -> None: + self.name = config.name + self.config = config + self.logger = logger + + @classmethod + def get_config(cls: Type["User"], **kwargs: Any) -> UserConfig: + return UserConfig(**kwargs) + + def notified_key(self: "User", listing: Listing) -> Tuple[str, str, str, str]: + return (CacheType.USER_NOTIFIED.value, listing.marketplace, listing.id, self.name) + + def to_cache(self: "User", listing: Listing, local_cache: Cache | None = None) -> None: + (cache if local_cache is None else local_cache).set( + self.notified_key(listing), + (datetime.now().strftime("%Y-%m-%d %H:%M:%S"), listing.hash, listing.price), + tag=CacheType.USER_NOTIFIED.value, + ) + + def _is_discounted(self: "User", old_price: str | None, new_price: str | None) -> bool: + def to_price(price_str: str | None): + if not price_str or price_str == "**unspecified**": + # invalid price is "very expensive", the new one might be cheaper. + return 999999999 + matched = re.match(r"(\D*)\d+", price_str) + if matched: + currency = matched.group(1).strip() + price_str = price_str.replace(currency, "") + try: + return float(price_str.replace(",", "").replace(" ", "")) + except: + return 999999999 + + return to_price(old_price) > to_price(new_price) + + def notification_status( + self: "User", listing: Listing, local_cache: Cache | None = None + ) -> NotificationStatus: + notified = (cache if local_cache is None else local_cache).get(self.notified_key(listing)) + # not notified before, or saved information is of old type + if notified is None: + return NotificationStatus.NOT_NOTIFIED + + if isinstance(notified, str): + # old style cache + notification_date, listing_hash, listing_price = notified, None, None + else: + assert isinstance(notified, tuple) + if len(notified) == 2: + notification_date, listing_hash, listing_price = (*notified, None) + else: + notification_date, listing_hash, listing_price = notified + + if listing_price is not None and self._is_discounted(listing_price, listing.price): + return NotificationStatus.LISTING_DISCOUNTED + + # if listing_hash is not None, we need to check if the listing is still valid + if listing_hash is not None and listing_hash != listing.hash: + return NotificationStatus.LISTING_CHANGED + + # notified before and remind is None, so one notification will remain valid forever + if self.config.remind is None: + return NotificationStatus.NOTIFIED + + # if remind is not None, we need to check the time + expired = datetime.strptime(notification_date, "%Y-%m-%d %H:%M:%S") + timedelta( + seconds=self.config.remind + ) + # if expired is in the future, user is already notified. + return ( + NotificationStatus.NOTIFIED if expired > datetime.now() else NotificationStatus.EXPIRED + ) + + def time_since_notification( + self: "User", listing: Listing, local_cache: Cache | None = None + ) -> int: + key = self.notified_key(listing) + notified = (cache if local_cache is None else local_cache).get(key) + if notified is None: + return -1 + + notification_date = notified if isinstance(notified, str) else notified[0] + return (datetime.now() - datetime.strptime(notification_date, "%Y-%m-%d %H:%M:%S")).seconds + + def notify( + self: "User", + listings: List[Listing], + ratings: List[AIResponse], + item_config: TItemConfig, + local_cache: Cache | None = None, + force: bool = False, + ) -> None: + if self.config.enabled is False: + if self.logger: + self.logger.info( + f"""{hilight("[Notify]", "skip")} User {hilight(self.name)} is disabled.""" + ) + return + statuses = [self.notification_status(listing, local_cache) for listing in listings] + + if NotificationConfig.notify_all( + self.config, listings, ratings, statuses, force=force, logger=self.logger + ): + counter.increment(CounterItem.NOTIFICATIONS_SENT, item_config.name) + for listing, ns in zip(listings, statuses): + if force or ns != NotificationStatus.NOTIFIED: + self.to_cache(listing, local_cache=local_cache) diff --git a/src/ai_marketplace_monitor/utils.py b/src/ai_marketplace_monitor/utils.py new file mode 100644 index 0000000..13254a6 --- /dev/null +++ b/src/ai_marketplace_monitor/utils.py @@ -0,0 +1,609 @@ +import copy +import hashlib +import json +import os +import random +import re +import time +from dataclasses import asdict, dataclass, fields +from enum import Enum +from logging import Logger +from pathlib import Path +from typing import Any, Dict, List, Tuple, TypeVar + +import parsedatetime # type: ignore +import requests # type: ignore +import rich +from diskcache import Cache # type: ignore +from playwright.sync_api import ProxySettings +from pyparsing import ( + CharsNotIn, + Keyword, + ParserElement, + ParseResults, + Word, + alphanums, + infix_notation, + opAssoc, +) +from requests.exceptions import RequestException, Timeout # type: ignore +from rich.pretty import pretty_repr + +try: + from pynput import keyboard # type: ignore + + pynput_installed = True +except ImportError: + # some platforms are not supported + pynput_installed = False + +import io + +import rich.pretty +from PIL import Image +from watchdog.events import FileSystemEvent, FileSystemEventHandler +from watchdog.observers import Observer + +# home directory for all settings and caches +amm_home = Path.home() / ".ai-marketplace-monitor" +amm_home.mkdir(parents=True, exist_ok=True) + +cache = Cache(amm_home) + + +TConfigType = TypeVar("TConfigType", bound="BaseConfig") + + +class SleepStatus(Enum): + NOT_DISRUPTED = 0 + BY_KEYBOARD = 1 + BY_FILE_CHANGE = 2 + + +class CacheType(Enum): + LISTING_DETAILS = "listing-details" + AI_INQUIRY = "ai-inquiries" + USER_NOTIFIED = "user-notifications" + COUNTERS = "counters" + + +class CounterItem(Enum): + SEARCH_PERFORMED = "Search performed" + LISTING_EXAMINED = "Total listing examined" + LISTING_QUERY = "New listing fetched" + EXCLUDED_LISTING = "Listing excluded" + NEW_VALIDATED_LISTING = "New validated listing" + AI_QUERY = "Total AI Queries" + NEW_AI_QUERY = "New AI Queries" + FAILED_AI_QUERY = "Failed AI Queries)" + NOTIFICATIONS_SENT = "Notifications sent" + REMINDERS_SENT = "Reminders sent" + + +class KeyboardMonitor: + confirm_character = "c" + + def __init__(self: "KeyboardMonitor") -> None: + self._paused: bool = False + self._listener: keyboard.Listener | None = None + self._sleeping: bool = False + self._confirmed: bool | None = None + + def start(self: "KeyboardMonitor") -> None: + if pynput_installed: + self._listener = keyboard.Listener(on_press=self.handle_key_press) + self._listener.start() # start to listen on a separate thread + + def stop(self: "KeyboardMonitor") -> None: + if self._listener: + self._listener.stop() # stop the listener + + def start_sleeping(self: "KeyboardMonitor") -> None: + self._sleeping = True + + def confirm(self: "KeyboardMonitor", msg: str | None = None) -> bool: + self._confirmed = False + rich.print( + msg + or f"Press {hilight(self.confirm_character)} to enter interactive mode in 10 seconds: ", + end="", + flush=True, + ) + try: + count = 0 + while self._confirmed is False: + time.sleep(0.1) + if self._confirmed: + return True + count += 1 + # wait a total of 10s + if count > 100: + break + return self._confirmed + finally: + # whether or not confirm is successful, reset paused and confirmed flag + self._paused = False + self._confirmed = None + + def is_sleeping(self: "KeyboardMonitor") -> bool: + return self._sleeping + + def is_paused(self: "KeyboardMonitor") -> bool: + return self._paused + + def is_confirmed(self: "KeyboardMonitor") -> bool: + return self._confirmed is True + + def set_paused(self: "KeyboardMonitor", paused: bool = True) -> None: + self._paused = paused + + if pynput_installed: + + def handle_key_press( + self: "KeyboardMonitor", key: keyboard.Key | keyboard.KeyCode | None + ) -> None: + # is sleeping, wake up + if self._sleeping: + if key == keyboard.Key.esc: + self._sleeping = False + return + # if waiting for confirmation, set confirm + if self._confirmed is False: + if getattr(key, "char", "") == self.confirm_character: + self._confirmed = True + return + # if being paused + if self.is_paused(): + if key == keyboard.Key.esc: + print("Still searching ... will pause as soon as I am done.") + return + if key == keyboard.Key.esc: + print("Pausing search ...") + self._paused = True + + +class Counter: + + def increment(self: "Counter", counter_key: CounterItem, item_name: str, by: int = 1) -> None: + key = (CacheType.COUNTERS.value, counter_key.value, item_name) + try: + cache.incr(key, by, default=None) + except KeyError: + # if key does not exist, set it to by, and set tag + cache.set(key, by, tag=CacheType.COUNTERS.value) + + def __str__(self: "Counter") -> str: + """Return pretty form of all non-zero counters""" + # this is super inefficient. Thankfully we are not calling this often. + # See https://github.com/grantjenks/python-diskcache/issues/341 + # for details + counters = { + key: cache.get(key) for key in cache.iterkeys() if key[0] == CacheType.COUNTERS.value + } + item_names = {x[2] for x in counters.keys()} + cnts = {} + for item_name in item_names: + # per-item statistics + cnts[item_name] = { + x.value: counters.get((CacheType.COUNTERS.value, x.value, item_name), 0) + for x in CounterItem + if counters.get((CacheType.COUNTERS.value, x.value, item_name), 0) + } + # total statistics + cnts["Total"] = { + x.value: sum( + counters.get((CacheType.COUNTERS.value, x.value, item_name), 0) + for item_name in item_names + ) + for x in CounterItem + if sum( + counters.get((CacheType.COUNTERS.value, x.value, item_name), 0) + for item_name in item_names + ) + } + return pretty_repr(cnts) + + +counter = Counter() + + +def hash_dict(obj: Dict[str, Any]) -> str: + """Hash a dictionary to a string.""" + dict_string = json.dumps(obj).encode("utf-8") + return hashlib.sha256(dict_string).hexdigest() + + +@dataclass +class BaseConfig: + name: str + enabled: bool | None = None + + def __post_init__(self: "BaseConfig") -> None: + """Handle all methods that start with 'handle_' in the dataclass.""" + for f in fields(self): + # test the type of field f, if it is a string or a list of string + # try to expand the string with environment variables + fvalue = getattr(self, f.name) + if isinstance(fvalue, str): + setattr(self, f.name, self._value_from_environ(fvalue)) + elif isinstance(fvalue, list) and all(isinstance(x, str) for x in fvalue): + setattr(self, f.name, [self._value_from_environ(x) for x in fvalue]) + + handle_method = getattr(self, f"handle_{f.name}", None) + if handle_method: + handle_method() + + def _value_from_environ(self: "BaseConfig", key: str) -> str: + """Replace key with value from an environment variable if it has a format of ${KEY}""" + if not isinstance(key, str) or not key.startswith("${") or not key.endswith("}"): + return key + if key[2:-1] not in os.environ: + raise ValueError(f"Environment variable {key[2:-1]} not set") + return os.environ[key[2:-1]] + + def handle_enabled(self: "BaseConfig") -> None: + if self.enabled is None: + return + if not isinstance(self.enabled, bool): + raise ValueError(f"Item {hilight(self.name)} enabled must be a boolean.") + + @property + def hash(self: "BaseConfig") -> str: + return hash_dict(asdict(self)) + + +@dataclass +class MonitorConfig(BaseConfig): + proxy_server: List[str] | None = None + proxy_bypass: str | None = None + proxy_username: str | None = None + proxy_password: str | None = None + + def handle_proxy_server(self: "MonitorConfig") -> None: + if self.proxy_server is None: + return + + if isinstance(self.proxy_server, str): + self.proxy_server = [self.proxy_server] + + if not all(isinstance(x, str) for x in self.proxy_server): + raise ValueError(f"Item {hilight(self.name)} proxy_server must be a string.") + if not all(x.startswith("http://") or x.startswith("https://") for x in self.proxy_server): + raise ValueError( + f"Item {hilight(self.name)} proxy_server must start with http:// or https://" + ) + + def handle_proxy_bypass(self: "MonitorConfig") -> None: + if self.proxy_bypass is None: + return + if not isinstance(self.proxy_bypass, str): + raise ValueError(f"Item {hilight(self.name)} proxy_bypass must be a string.") + + def handle_proxy_username(self: "MonitorConfig") -> None: + if self.proxy_username is None: + return + + if not isinstance(self.proxy_username, str): + raise ValueError(f"Item {hilight(self.name)} proxy_username must be a string.") + + def handle_proxy_password(self: "MonitorConfig") -> None: + if self.proxy_password is None: + return + + if not isinstance(self.proxy_password, str): + raise ValueError(f"Item {hilight(self.name)} proxy_password must be a string.") + + def get_proxy_options(self: "MonitorConfig") -> ProxySettings | None: + if not self.proxy_server: + return None + res = ProxySettings(server=random.choice(self.proxy_server)) + if self.proxy_username and self.proxy_password: + res["username"] = self.proxy_username + res["password"] = self.proxy_password + if self.proxy_bypass: + res["bypass"] = self.proxy_bypass + return res + + +def calculate_file_hash(file_paths: List[Path]) -> str: + """Calculate the SHA-256 hash of the file content.""" + hasher = hashlib.sha256() + # they should exist, just to make sure + for file_path in file_paths: + if not file_path.exists(): + raise FileNotFoundError(f"File not found: {file_path}") + # + with open(file_path, "rb") as file: + while chunk := file.read(8192): + hasher.update(chunk) + return hasher.hexdigest() + + +def merge_dicts(dicts: list) -> dict: + """Merge a list of dictionaries into a single dictionary, including nested dictionaries. + + :param dicts: A list of dictionaries to merge. + :return: A single merged dictionary. + """ + + def merge(d1: dict, d2: dict) -> dict: + for key, value in d2.items(): + if key in d1: + if isinstance(d1[key], dict) and isinstance(value, dict): + d1[key] = merge(d1[key], value) + elif isinstance(d1[key], list) and isinstance(value, list): + d1[key].extend(value) + else: + d1[key] = value + else: + d1[key] = value + return d1 + + result: Dict[str, Any] = {} + for dictionary in dicts: + result = merge(result, dictionary) + return result + + +def normalize_string(string: str) -> str: + """Normalize a string by replacing multiple spaces (including space, tab, and newline) with a single space.""" + return re.sub(r"\s+", " ", string).lower() + + +ParserElement.enable_packrat() +double_quoted_string = ('"' + CharsNotIn('"').leaveWhitespace() + '"').setParseAction( + lambda t: t[1] +) # removes quotes, keeps only the content +single_quoted_string = ("'" + CharsNotIn("'").leaveWhitespace() + "'").setParseAction( + lambda t: t[1] +) # removes quotes, keeps only the content + +special_chars = "!@#$%^&*-_=+[]{}|;:'\",.<>?/\\`~" +unquoted_string = Word(alphanums + special_chars) + +operand = double_quoted_string | single_quoted_string | unquoted_string +and_op = Keyword("AND") +or_op = Keyword("OR") +not_op = Keyword("NOT") + +# Define the grammar for parsing +expr = infix_notation( + operand, + [ + (not_op, 1, opAssoc.RIGHT), + (and_op, 2, opAssoc.LEFT), + (or_op, 2, opAssoc.LEFT), + ], +) + + +def is_substring( + var1: str | List[str], var2: str | List[str], logger: Logger | None = None +) -> bool: + """Check if var1 is a substring of var2, after normalizing both strings. One of them can be a list of strings. + + var1: can be a single string, or a list of string, for which a condition of OR is assumed. + this program will parse var11 for "AND", "OR" and "NOT", and return the results of the + logical expression. + + var2: one or more strings for testing if strings in "var1" is a substring. + """ + if isinstance(var1, list): + return any(is_substring(x, var2, logger) for x in var1) + + # parse the expression + parsed = "" + try: + parsed = expr.parseString(var1, parseAll=True)[0] + except Exception: + # treat var1 as literal string for searching. + if any(x in var1 for x in (" AND ", " OR ", " NOT ", "(NOT ")) or var1.startswith("NOT "): + if logger: + logger.warning( + f"Failed to parse {var1} as a logical expression. Treating it as literal string." + ) + if isinstance(var2, str): + return normalize_string(var1) in normalize_string(var2) + return any(normalize_string(var1) in normalize_string(s2) for s2 in var2) + + def evaluate_expression(parsed_expression: str | ParseResults) -> bool: + if isinstance(parsed_expression, str): + if isinstance(var2, str): + return normalize_string(parsed_expression) in normalize_string(var2) + return any(normalize_string(parsed_expression) in normalize_string(s) for s in var2) + + if len(parsed_expression) == 1: + return evaluate_expression(parsed_expression[0]) + + if parsed_expression[0] == "NOT": + return not evaluate_expression(parsed_expression[1]) + + if parsed_expression[-2] == "AND": + return evaluate_expression(parsed_expression[:-2]) and evaluate_expression( + parsed_expression[-1] + ) + + if parsed_expression[-2] == "OR": + return evaluate_expression(parsed_expression[:-2]) or evaluate_expression( + parsed_expression[-1] + ) + if logger: + logger.error(f"Invalid expression: {parsed_expression}") + return False + + return evaluate_expression(parsed) + + +class ChangeHandler(FileSystemEventHandler): + def __init__(self: "ChangeHandler", files: List[str]) -> None: + self.changed = False + self.files = files + + def on_modified(self: "ChangeHandler", event: FileSystemEvent) -> None: + if not event.is_directory and event.src_path in self.files: + self.changed = True + + +def doze( + duration: int, files: List[Path] | None = None, keyboard_monitor: KeyboardMonitor | None = None +) -> SleepStatus: + """Sleep for a specified duration while monitoring the change of files. + + Return: + 0: if doze was done naturally. + 1: if doze was disrupted by keyboard + 2: if doze was disrupted by file change + """ + event_handler = ChangeHandler([str(x) for x in (files or [])]) + observers = [] + if keyboard_monitor: + keyboard_monitor.start_sleeping() + + for filename in files or []: + if not filename.exists(): + raise FileNotFoundError(f"File not found: {filename}") + observer = Observer() + # we can only monitor a directory + observer.schedule(event_handler, str(filename.parent), recursive=False) + observer.start() + observers.append(observer) + + start_time = time.time() + try: + while time.time() - start_time < duration: + if event_handler.changed: + return SleepStatus.BY_FILE_CHANGE + time.sleep(1) + if keyboard_monitor and not keyboard_monitor.is_sleeping(): + return SleepStatus.BY_KEYBOARD + return SleepStatus.NOT_DISRUPTED + finally: + for observer in observers: + observer.stop() + observer.join() + + +def extract_price(price: str) -> str: + if not price or price == "**unspecified**": + return price + + # extract leading non-numeric characters as currency symbol + matched = re.match(r"(\D*)\d+", price) + if matched: + currency = matched.group(1).strip() + else: + currency = "$" + + matches = re.findall(currency.replace("$", r"\$") + r"[\d,]+(?:\.\d+)?", price) + if matches: + return " | ".join(matches[:2]) + return price + + +def convert_to_seconds(time_str: str) -> int: + cal = parsedatetime.Calendar(version=parsedatetime.VERSION_CONTEXT_STYLE) + time_struct, _ = cal.parse(time_str) + return int(time.mktime(time_struct) - time.mktime(time.localtime())) + + +def hilight(text: str, style: str = "name") -> str: + """Highlight the keywords in the text with the specified color.""" + color = { + "name": "cyan", + "fail": "red", + "info": "blue", + "succ": "green", + "dim": "gray", + }.get(style, "blue") + return f"[{color}]{text}[/{color}]" + + +def fetch_with_retry( + url: str, + timeout: int = 10, + max_retries: int = 3, + backoff_factor: float = 1.5, + logger: Logger | None = None, +) -> Tuple[bytes, str] | None: + """Fetch URL content with retry logic + + Args: + url: URL to fetch + timeout: Timeout in seconds + max_retries: Maximum number of retry attempts + backoff_factor: Multiplier for exponential backoff + logger: logger object + + Returns: + Tuple of (content, content_type) if successful, None if failed + """ + if logger: + logger.debug(f"Fetching {url} with timeout {timeout}s") + for attempt in range(max_retries): + try: + response = requests.get( + url, timeout=timeout, stream=True # Good practice for downloading files + ) + response.raise_for_status() # Raises exception for 4XX/5XX status codes + + return response.content, response.headers["Content-Type"] + + except Timeout: + wait_time = backoff_factor**attempt + if logger: + logger.warning( + f"Timeout fetching {url} (attempt {attempt + 1}/{max_retries}). " + f"Waiting {wait_time:.1f}s before retry" + ) + + if attempt < max_retries - 1: + time.sleep(wait_time) + + except RequestException as e: + if logger: + logger.error(f"Error fetching {url}: {e!s}") + return None + + if logger: + logger.error(f"Failed to fetch {url} after {max_retries} attempts") + return None + + +def resize_image_data(image_data: bytes, max_width: int = 800, max_height: int = 600) -> bytes: + # Create image object from binary data + try: + image = Image.open(io.BytesIO(image_data)) + if image.format == "GIF": + return image_data + except Exception: + # if unacceptable file format, just return + return image_data + + # Calculate new dimensions maintaining aspect ratio + width, height = image.size + ratio = min(max_width / width, max_height / height) + if ratio >= 1: + return image_data + + new_width = int(width * ratio) + new_height = int(height * ratio) + + # Resize image + resized_image = image.resize((new_width, new_height), Image.Resampling.LANCZOS) + + # Convert back to bytes + buffer = io.BytesIO() + resized_image.save(buffer, format=image.format) + return buffer.getvalue() + + +class Translator: + def __init__( + self: "Translator", locale: str | None = None, dictionary: Dict[str, str] | None = None + ) -> None: + self.locale = locale + self._dictionary: Dict[str, str] = copy.deepcopy(dictionary or {}) + + def __call__(self: "Translator", word: str) -> str: + """Return translated version""" + return self._dictionary.get(word, word) diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..233642d --- /dev/null +++ b/tasks.py @@ -0,0 +1,172 @@ +"""Tasks for maintaining the project. + +Execute 'invoke --list' for guidance on using Invoke +""" + +import platform +import webbrowser +from pathlib import Path +from typing import Optional + +from invoke import call, task +from invoke.context import Context +from invoke.runners import Result + +ROOT_DIR = Path(__file__).parent +DOCS_DIR = ROOT_DIR.joinpath("docs") +DOCS_BUILD_DIR = DOCS_DIR.joinpath("_build") +DOCS_INDEX = DOCS_BUILD_DIR.joinpath("index.html") +COVERAGE_FILE = ROOT_DIR.joinpath(".coverage") +COVERAGE_DIR = ROOT_DIR.joinpath("htmlcov") +COVERAGE_REPORT = COVERAGE_DIR.joinpath("index.html") +SOURCE_DIR = ROOT_DIR.joinpath("src/ai_marketplace_monitor") +TEST_DIR = ROOT_DIR.joinpath("tests") +PYTHON_TARGETS = [ + SOURCE_DIR, + TEST_DIR, + DOCS_DIR.joinpath("conf.py"), + ROOT_DIR.joinpath("noxfile.py"), + Path(__file__), +] +PYTHON_TARGETS_STR = " ".join([str(p) for p in PYTHON_TARGETS]) + + +def _run(c: Context, command: str) -> Optional[Result]: + return c.run(command, pty=platform.system() != "Windows") + + +@task() +def clean_build(c: Context) -> None: + """Clean up files from package building.""" + _run(c, "rm -fr build/") + _run(c, "rm -fr dist/") + _run(c, "rm -fr .eggs/") + _run(c, "find . -name '*.egg-info' -exec rm -fr {} +") + _run(c, "find . -name '*.egg' -exec rm -f {} +") + + +@task() +def clean_python(c: Context) -> None: + """Clean up python file artifacts.""" + _run(c, "find . -name '*.pyc' -exec rm -f {} +") + _run(c, "find . -name '*.pyo' -exec rm -f {} +") + _run(c, "find . -name '*~' -exec rm -f {} +") + _run(c, "find . -name '__pycache__' -exec rm -fr {} +") + + +@task() +def clean_tests(c: Context) -> None: + """Clean up files from testing.""" + _run(c, f"rm -f {COVERAGE_FILE}") + _run(c, f"rm -fr {COVERAGE_DIR}") + _run(c, "rm -fr .pytest_cache") + + +@task() +def clean_docs(c: Context) -> None: + """Clean up files from documentation builds.""" + _run(c, f"rm -fr {DOCS_BUILD_DIR}") + + +@task(pre=[clean_build, clean_python, clean_tests, clean_docs]) +def clean(c: Context) -> None: + """Run all clean sub-tasks.""" + + +@task() +def install_hooks(c: Context) -> None: + """Install pre-commit hooks.""" + _run(c, "poetry run pre-commit install") + + +@task() +def hooks(c: Context) -> None: + """Run pre-commit hooks.""" + _run(c, "poetry run pre-commit run --all-files") + + +@task(name="format", help={"check": "Checks if source is formatted without applying changes"}) +def format_(c: Context, check: bool = False) -> None: + """Format code.""" + isort_options = ["--check-only", "--diff"] if check else [] + _run(c, f"poetry run isort {' '.join(isort_options)} {PYTHON_TARGETS_STR}") + black_options = ["--diff", "--check"] if check else ["--quiet"] + _run(c, f"poetry run black {' '.join(black_options)} {PYTHON_TARGETS_STR}") + + +@task() +def ruff(c: Context) -> None: + """Run ruff.""" + _run(c, f"poetry run ruff check {PYTHON_TARGETS_STR}") + + +@task() +def security(c: Context) -> None: + """Run security related checks.""" + _run( + c, + "poetry export --with dev --format=requirements.txt --without-hashes | " + "poetry run safety check --stdin --full-report", + ) + + +@task(pre=[ruff, security, call(format_, check=True)]) +def lint(c: Context) -> None: + """Run all linting.""" + + +@task() +def mypy(c: Context) -> None: + """Run mypy.""" + _run(c, f"poetry run mypy {PYTHON_TARGETS_STR}") + + +@task() +def tests(c: Context) -> None: + """Run tests.""" + pytest_options = ["--xdoctest", "--cov", "--cov-report=", "--cov-fail-under=0"] + _run(c, f"poetry run pytest {' '.join(pytest_options)} {TEST_DIR} {SOURCE_DIR}") + + +@task( + help={ + "fmt": "Build a local report: report, html, json, annotate, html, xml.", + "open_browser": "Open the coverage report in the web browser (requires --fmt html)", + } +) +def coverage(c: Context, fmt: str = "report", open_browser: bool = False) -> None: + """Create coverage report.""" + if any(Path().glob(".coverage.*")): + _run(c, "poetry run coverage combine") + _run(c, f"poetry run coverage {fmt} -i") + if fmt == "html" and open_browser: + webbrowser.open(COVERAGE_REPORT.as_uri()) + + +@task( + help={ + "serve": "Build the docs watching for changes", + "open_browser": "Open the docs in the web browser", + } +) +def docs(c: Context, serve: bool = False, open_browser: bool = False) -> None: + """Build documentation.""" + _run(c, f"sphinx-apidoc -o {DOCS_DIR} {SOURCE_DIR}") + build_docs = f"sphinx-build -b html {DOCS_DIR} {DOCS_BUILD_DIR}" + _run(c, build_docs) + if open_browser: + webbrowser.open(DOCS_INDEX.absolute().as_uri()) + if serve: + _run(c, f"poetry run watchmedo shell-command -p '*.rst;*.md' -c '{build_docs}' -R -D .") + + +@task( + help={ + "part": "Part of the version to be bumped.", + "dry_run": "Don't write any files, just pretend. (default: False)", + } +) +def version(c: Context, part: str, dry_run: bool = False) -> None: + """Bump version.""" + bump_options = ["--dry-run"] if dry_run else [] + _run(c, f"poetry run bump2version {' '.join(bump_options)} {part}") diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..616a659 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Unit test package for ai_marketplace_monitor.""" diff --git a/tests/auto_with_about_and_description_listing.html b/tests/auto_with_about_and_description_listing.html new file mode 100644 index 0000000..09453be --- /dev/null +++ b/tests/auto_with_about_and_description_listing.html @@ -0,0 +1,278 @@ + + +Marketplace - 2018 Honda Accord · EX Sedan 4D | Facebook + + + + + + + + + + + + + + + + + + + +
 

This listing is far from your current location.

Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D
Product photo of 2018 Honda Accord · EX Sedan 4D

Sold 2018 Honda accord EX Sedan 4D

$12,600
Listed
a week ago
in Houston, TX
Save
Share
Save
Share

About this vehicle

Driven 80,000 miles
Automatic transmission
Exterior color: Black · Interior color: Black
5/5 overall NHTSA safety rating
5/5 front safety rating
5/5 rollover safety rating
5/5 side safety rating
5/5 side barrier safety rating
Fuel type: Gasoline
30.0 MPG city · 38.0 MPG highway · 33.0 MPG combined
This vehicle is paid off

Seller's description

Honda accord 2018 +Con 80mil millas +Asientos de tela, titulo salvage Todo funciona muy bien. ...
See more
See translation
Houston, TX
Location is approximate

Seller information

Joined Facebook in 2017
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto_with_description_listing.html b/tests/auto_with_description_listing.html new file mode 100644 index 0000000..d65cd97 --- /dev/null +++ b/tests/auto_with_description_listing.html @@ -0,0 +1,295 @@ + + +Marketplace - Volkswagen Tiguan +1.4 TSI Sport&Style | Facebook + + + + + + + + + + + + + + + + + + +
 

This listing is far from your current location.

Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style
Product photo of Volkswagen Tiguan
+1.4 TSI Sport&Style

Volkswagen Tiguan +1.4 TSI Sport&Style

€6,695
Listed in Bergen op Zoom, NB
Send seller a message
Send
Message
Save
Share

Seller's description

  • Condition
    Used - Good
+Volkswagen Tiguan +1.4 TSI Sport&Style + +Algemene gegevens + +Tellerstand: 191182 km +Carrosserievorm: S...
See more
See translation
Bergen op Zoom, NB
Location is approximate

Seller information

Joined Facebook in 2013
Send seller a message
Send
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/tests/regular_listing.html b/tests/regular_listing.html new file mode 100644 index 0000000..86b6050 --- /dev/null +++ b/tests/regular_listing.html @@ -0,0 +1,241 @@ + + +Marketplace - Smoke Detector | Facebook + + + + + + + + + + + + + + + + + + + +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/rental_listing.html b/tests/rental_listing.html new file mode 100644 index 0000000..342633b --- /dev/null +++ b/tests/rental_listing.html @@ -0,0 +1,257 @@ + + +Marketplace - Motorola razor telephone 24 | Facebook + + + + + + + + + + + + + + + + + + + +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/search_result_1.html b/tests/search_result_1.html new file mode 100644 index 0000000..8d2652c --- /dev/null +++ b/tests/search_result_1.html @@ -0,0 +1,151 @@ +Facebook + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/tests/test_ai.py b/tests/test_ai.py new file mode 100644 index 0000000..979fdd7 --- /dev/null +++ b/tests/test_ai.py @@ -0,0 +1,65 @@ +import pytest + +from ai_marketplace_monitor.ai import OllamaBackend, OllamaConfig +from ai_marketplace_monitor.facebook import FacebookItemConfig, FacebookMarketplaceConfig +from ai_marketplace_monitor.listing import Listing + + +@pytest.mark.skipif(True, reason="Condition met, skipping this test") +def test_ai( + ollama_config: OllamaConfig, + item_config: FacebookItemConfig, + marketplace_config: FacebookMarketplaceConfig, + listing: Listing, +) -> None: + ai = OllamaBackend(ollama_config) + # ai.config = ollama_config + res = ai.evaluate(listing, item_config, marketplace_config) + assert res.score >= 1 and res.score <= 5 + + +def test_prompt( + ollama: OllamaBackend, + listing: Listing, + item_config: FacebookItemConfig, + marketplace_config: FacebookMarketplaceConfig, +) -> None: + prompt = ollama.get_prompt(listing, item_config, marketplace_config) + assert item_config.name in prompt + assert (item_config.description or "something weird") in prompt + assert str(item_config.min_price) in prompt + assert str(item_config.max_price) in prompt + + assert listing.title in prompt + assert listing.condition in prompt + assert listing.price in prompt + assert listing.post_url in prompt + + +def test_extra_prompt( + ollama: OllamaBackend, + listing: Listing, + item_config: FacebookItemConfig, + marketplace_config: FacebookMarketplaceConfig, +) -> None: + + marketplace_config.extra_prompt = "This is an extra prompt" + prompt = ollama.get_prompt(listing, item_config, marketplace_config) + assert "extra prompt" in prompt + # + item_config.extra_prompt = "This overrides marketplace prompt" + prompt = ollama.get_prompt(listing, item_config, marketplace_config) + assert "extra prompt" not in prompt + assert "overrides marketplace prompt" in prompt + # + assert "Great deal: Fully matches" in prompt + item_config.rating_prompt = "something else" + prompt = ollama.get_prompt(listing, item_config, marketplace_config) + assert "Great deal: Fully matches" not in prompt + assert "something else" in prompt + # + assert "Evaluate how well this listing" in prompt + marketplace_config.prompt = "myprompt" + prompt = ollama.get_prompt(listing, item_config, marketplace_config) + assert "Evaluate how well this listing" not in prompt + assert "myprompt" in prompt diff --git a/tests/test_aimm.py b/tests/test_aimm.py new file mode 100644 index 0000000..c9a9065 --- /dev/null +++ b/tests/test_aimm.py @@ -0,0 +1,69 @@ +"""Tests for `ai_marketplace_monitor` module.""" + +import time + +from diskcache import Cache # type: ignore + +from ai_marketplace_monitor.ai import AIResponse # type: ignore +from ai_marketplace_monitor.facebook import FacebookItemConfig +from ai_marketplace_monitor.listing import Listing +from ai_marketplace_monitor.notification import NotificationStatus +from ai_marketplace_monitor.user import User + + +def test_version(version: str) -> None: + """Sample pytest test function with the pytest fixture as an argument.""" + assert version == "0.9.1" + + +def test_listing_cache(temp_cache: Cache, listing: Listing) -> None: + listing.to_cache(post_url=listing.post_url, local_cache=temp_cache) + # + new_listing = Listing.from_cache(listing.post_url, local_cache=temp_cache) + + for attr in ( + "marketplace", + "name", + "id", + "title", + "image", + "price", + "location", + "seller", + "condition", + "description", + ): + assert getattr(listing, attr) == getattr(new_listing, attr) + + +def test_notification_cache(temp_cache: Cache, user: User, listing: Listing) -> None: + assert ( + user.notification_status(listing, local_cache=temp_cache) + == NotificationStatus.NOT_NOTIFIED + ) + assert user.time_since_notification(listing, local_cache=temp_cache) == -1 + user.to_cache(listing, local_cache=temp_cache) + + assert user.notified_key(listing) in temp_cache + assert user.notification_status(listing, local_cache=temp_cache) == NotificationStatus.NOTIFIED + assert user.time_since_notification(listing, local_cache=temp_cache) >= 0 + + # + user.config.remind = 1 + + time.sleep(2) + + assert user.notification_status(listing, local_cache=temp_cache) == NotificationStatus.EXPIRED + + # change listing + listing.price = "$30000" + assert ( + user.notification_status(listing, local_cache=temp_cache) + == NotificationStatus.LISTING_CHANGED + ) + + +def test_notify_all( + user: User, item_config: FacebookItemConfig, listing: Listing, ai_response: AIResponse +) -> None: + user.notify([listing], [ai_response], item_config) diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..a20ebbd --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,379 @@ +"""Tests for `ai_marketplace_monitor`.cli module.""" + +from dataclasses import asdict +from typing import Callable, List, Tuple, Type, Union + +import pytest +from pytest import TempPathFactory +from typer.testing import CliRunner + +import ai_marketplace_monitor +from ai_marketplace_monitor import cli +from ai_marketplace_monitor.config import Config + +runner = CliRunner() + + +@pytest.mark.parametrize( + "options,expected", + [ + # ([], "ai_marketplace_monitor.cli.main"), + (["--help"], "Usage: "), + ( + ["--version"], + f"AI Marketplace Monitor, version { ai_marketplace_monitor.__version__ }\n", + ), + ], +) +def test_command_line_interface(options: List[str], expected: str) -> None: + """Test the CLI.""" + result = runner.invoke(cli.app, options) + assert result.exit_code == 0 + assert expected in result.stdout + + +@pytest.fixture(scope="session") +def config_file(tmp_path_factory: TempPathFactory) -> Callable: + def generate_config_file(content: str) -> str: + fn = tmp_path_factory.mktemp("config") / "test.toml" + with open(fn, "w") as f: + f.write(content) + return str(fn) + + return generate_config_file + + +base_marketplace_cfg = """ +[marketplace.facebook] +search_city = 'dallas' +""" + +full_marketplace_cfg = """ +[marketplace.facebook] +login_wait_time = 50 +password = "password" +search_city = ['houston'] +username = "username" +# the following are common options +seller_locations = "city" +condition = ['new', 'used_good'] +date_listed = 7 +delivery_method = 'local_pick_up' +exclude_sellers = "seller" +ai = [] +max_price = 300 +min_price = 200 +rating = 4 +max_search_interval = 40 +notify = 'user1' +radius = 100 +search_interval = 10 +search_region = 'usa' +""" + +base_item_cfg = """ +[item.name] +search_phrases = 'search word one' +""" + +full_item_cfg = """ +[item.name] +antikeywords = ['exclude1', 'exclude2'] +description = 'long description' +enabled = true +keywords = ['exclude1', 'exclude2'] +search_phrases = 'search word one' +marketplace = 'facebook' +search_city = 'houston' +# the following are common options +seller_locations = "city" +condition = ['new', 'used_good'] +date_listed = 7 +ai = 'openai' +availability = ['out', 'all'] +delivery_method = 'local_pick_up' +exclude_sellers = "seller" +max_price = 300 +rating = 4 +max_search_interval = '1d' +search_interval = '12h' +min_price = 200 +notify = 'user1' +radius = 100 +search_region = 'usa' +""" + +base_user_cfg = """ +[user.user1] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +""" + +full_user_cfg = """ +[user.user1] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +remind = '1 day' + +[user.user2] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +""" + + +base_ai_cfg = """ +[ai.openai] +api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +""" + +full_ai_cfg = """ +[ai.openai] +api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +model = 'gpt' +""" + +base_pushbullet_cfg = """ +[notification.pushbullet1] +pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +""" + +base_pushover_cfg = """ +[notification.pushover] +pushover_user_id = "xxxxxx" +pushover_api_token = "dfafdafd" +""" + + +base_ntfy_cfg = """ +[notification.ntfy] +ntfy_server = "https://xxxxxx" +ntfy_topic = "dfafdafd" +""" + +base_email_cfg = """ +[notification.gmail] +smtp_password = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +""" + +notify_user_cfg = """ +[user.user1] +notify_with = ['pushbullet1', 'gmail'] +""" + +notify_user_pushover_cfg = """ +[user.user1] +notify_with = 'pushover' +""" + +notify_user_ntfy_cfg = """ +[user.user1] +notify_with = 'ntfy' +""" + +monitor_cfg = """ +[monitor] +proxy_server = 'https://fdaf.fadfd.com' +proxy_username = 'adfa' +proxy_password = 'fadfadf' +""" + +monitor_invalid_proxy_server_cfg = """ +[monitor] +proxy_server = 'fdaf.fadfd.com' +proxy_username = 'adfa' +proxy_password = 'fadfadf' +""" + +licensed_monitor_cfg = """ +[monitor] +proxy_server = 'https://fdaf.fadfd.com' +proxy_username = 'adfa' +proxy_password = 'fadfadf' +""" + + +@pytest.mark.parametrize( + "config_content,acceptable", + [ + (base_marketplace_cfg, False), + (base_item_cfg, False), + (base_user_cfg, False), + (base_marketplace_cfg + base_item_cfg + base_user_cfg, True), + (base_marketplace_cfg + base_item_cfg + base_user_cfg + base_ai_cfg, True), + (full_marketplace_cfg + full_item_cfg + full_user_cfg + full_ai_cfg, True), + (base_marketplace_cfg + full_item_cfg + base_user_cfg + base_ai_cfg, True), + # notification should match + ( + base_marketplace_cfg + full_item_cfg + notify_user_cfg, + False, + ), + # pushbullet + ( + base_marketplace_cfg + + base_item_cfg + + notify_user_cfg + + base_pushbullet_cfg + + base_email_cfg, + True, + ), + ( + base_marketplace_cfg + + base_item_cfg + + notify_user_cfg + + base_pushbullet_cfg.replace("pushbullet1", "somethingelse") + + base_email_cfg, + False, + ), + # pushover + ( + base_marketplace_cfg + base_item_cfg + notify_user_pushover_cfg + base_pushover_cfg, + True, + ), + ( + base_marketplace_cfg + + base_item_cfg + + notify_user_pushover_cfg + + base_pushover_cfg.replace("pushover", "somethingelse"), + False, + ), + # ntfy + ( + base_marketplace_cfg + base_item_cfg + notify_user_ntfy_cfg + base_ntfy_cfg, + True, + ), + ( + base_marketplace_cfg + + base_item_cfg + + notify_user_ntfy_cfg + + base_ntfy_cfg.replace("ntfy", "somethingelse"), + False, + ), + # user should match + ( + base_marketplace_cfg + full_item_cfg.replace("user1", "unknown_user") + base_user_cfg, + False, + ), + # no additional keys + (base_marketplace_cfg + "\na=1\n" + base_item_cfg + base_user_cfg, False), + (base_marketplace_cfg + base_item_cfg + "\na=1\n" + base_user_cfg, False), + (base_marketplace_cfg + base_item_cfg + base_user_cfg + "\na=1\n", False), + (base_marketplace_cfg + base_item_cfg + base_user_cfg + monitor_cfg, False), + (base_marketplace_cfg + base_item_cfg + base_user_cfg + licensed_monitor_cfg, True), + ( + base_marketplace_cfg + + base_item_cfg + + base_user_cfg + + monitor_invalid_proxy_server_cfg, + False, + ), + ], +) +def test_config(config_file: Callable, config_content: str, acceptable: bool) -> None: + """Test the config command.""" + cfg = config_file(config_content) + key_types: dict[str, Union[Type, Tuple[Type, ...]]] = { + "seller_locations": (list, type(None)), + "ai": (list, type(None)), + "availability": (list, type(None)), + "api_key": str, + "city_name": (list, type(None)), + "condition": (list, type(None)), + "date_listed": (list, type(None)), + "delivery_method": (list, type(None)), + "description": (str, type(None)), + "enabled": (bool, type(None)), + "antikeywords": (list, type(None)), + "exclude_sellers": (list, type(None)), + "keywords": (list, type(None)), + "language": (str, type(None)), + "login_wait_time": (int, type(None)), + "marketplace": (str, type(None)), + "max_price": (int, type(None)), + "max_search_interval": (int, type(None)), + "market_type": (str, type(None)), + "min_price": (int, type(None)), + "model": (str, type(None)), + "name": (str, type(None)), + "notify": (list, type(None)), + "password": (str, type(None)), + "prompt": (str, type(None)), + "extra_prompt": (str, type(None)), + "rating_prompt": (str, type(None)), + "pushbullet_token": str, + "radius": (list, type(None)), + "rating": (list, type(None)), + "remind": (int, type(None)), + "search_city": (list, type(None)), + "search_interval": (int, type(None)), + "search_phrases": list, + "search_region": (list, type(None)), + "searched_count": int, + "start_at": (list, type(None)), + "username": (str, type(None)), + } + if acceptable: + # print(config_content) + config = Config([cfg]) + # assert the types + for key, value in asdict(config.marketplace["facebook"]).items(): + assert isinstance(value, key_types[key]), f"{key} must be of type {key_types[key]}" + + for item_cfg in config.item.values(): + for key, value in asdict(item_cfg).items(): + assert isinstance(value, key_types[key]), f"{key} must be of type {key_types[key]}" + # test if all elements can be frozen + for attr in ("item", "ai", "user", "marketplae"): + for item_cfg in getattr(config, attr, {}).values(): + assert item_cfg.hash + else: + with pytest.raises(Exception): + Config([cfg]) + + +alt_marketplace_cfg = """ +[marketplace.houston] +search_city = 'houston' +""" + +alt_item_cfg = """ +[item.whatever] +marketplace = "houston" +search_phrases = "search word two" +""" + + +def test_support_multiple_marketplaces(config_file: Callable) -> None: + """Test the config command.""" + cfg = config_file( + base_marketplace_cfg + alt_marketplace_cfg + alt_item_cfg + base_item_cfg + base_user_cfg + ) + config = Config([cfg]) + + assert len(config.marketplace) == 2 + assert len(config.item) == 2 + assert len(config.user) == 1 + + assert config.item["name"].marketplace == "facebook" + assert config.item["whatever"].marketplace == "houston" + assert config.marketplace["facebook"].search_city == ["dallas"] + assert config.marketplace["houston"].search_city == ["houston"] + + +alt_ai_cfg = """ +[ai.some_ai] +provider = 'OpenAI' +api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +model = 'gpt_none' +base_url = 'http://someother.com' +""" + + +def test_multiplace_ai_agent(config_file: Callable) -> None: + """Test the config command.""" + cfg = config_file( + base_marketplace_cfg + base_ai_cfg + base_item_cfg + alt_ai_cfg + base_user_cfg + ) + config = Config([cfg]) + + assert len(config.marketplace) == 1 + assert len(config.ai) == 2 + + assert config.ai["openai"].api_key == "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + assert config.ai["some_ai"].model == "gpt_none" diff --git a/tests/test_facebook.py b/tests/test_facebook.py new file mode 100644 index 0000000..f506a70 --- /dev/null +++ b/tests/test_facebook.py @@ -0,0 +1,79 @@ +import time +from pathlib import Path + +import pytest +from pytest_playwright.pytest_playwright import CreateContextCallback # type: ignore + +from ai_marketplace_monitor.facebook import FacebookSearchResultPage, parse_listing + + +def test_search_page( + new_context: CreateContextCallback, filename: str = "search_result_1.html" +) -> None: + local_file_path = Path(__file__).parent / filename + page = new_context(java_script_enabled=False).new_page() + page.goto(f"file://{local_file_path}") + + for _ in range(10): + p = FacebookSearchResultPage(page) + page.wait_for_load_state("domcontentloaded") + listings = p.get_listings() + if len(listings) != 0: + break + time.sleep(1) + + for idx, listing in enumerate(listings): + assert listing.marketplace == "facebook" + assert listing.id.isnumeric(), f"wrong id for listing {idx+1} with title {listing.title}" + assert listing.title, f"No title is found {idx+1} with title " + assert listing.image, f"wrong image for listing {idx+1} with title {listing.title}" + assert listing.post_url, f"wrong post_url for listing {idx+1} with title {listing.title}" + assert listing.price, f"wrong price for listing {idx+1} with title {listing.title}" + if idx == 10: + assert ( + listing.location == "" + ), f"listing {idx+1} with title {listing.title} has empty location" + else: + assert ( + listing.location + ), f"wrong location for listing {idx+1} with title {listing.title}" + assert listing.seller == "", "Seller should be empty" + + assert len(listings) == 21 + + +@pytest.mark.parametrize( + "filename,price,seller,location", + [ + ("regular_listing.html", "$10", "Austin Ewing", "MS"), + ("rental_listing.html", "$150", "Perry Burton", "Houston, TX"), + ( + "auto_with_about_and_description_listing.html", + "**unspecified**", + "Lily Ortiz", + "Houston, TX", + ), + ("auto_with_description_listing.html", "€6,695", "Abdel Abdel", "Bergen op Zoom, NB"), + ], +) +def test_listing_page( + new_context: CreateContextCallback, + filename: str, + price: str, + seller: str, + location: str, +) -> None: + local_file_path = Path(__file__).parent / filename + + page = new_context(java_script_enabled=False).new_page() + page.goto(f"file://{local_file_path}") + page.wait_for_load_state("domcontentloaded") + listing = parse_listing(page, "post_url", None) + + assert listing is not None, f"Should be able to parse {filename}" + assert listing.title, f"Title of {filename} should be {listing.title}" + assert listing.price == price, f"Price of {filename} should be {listing.price}" + assert listing.location == location, f"Location of {filename} should be {listing.location}" + assert listing.seller == seller, f"Seller of {filename} should be {listing.seller}" + assert listing.image, f"Image of {filename} should not be empty" + assert listing.post_url, f"post_url of {filename} should not be empty" diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..c165e45 --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,44 @@ +from typing import List + +import pytest + +from ai_marketplace_monitor.utils import is_substring + + +@pytest.mark.parametrize( + "var1,var2,res", + [ + ["b1", "AB1", True], + (["go pro", "gopro"], "gopro hero", True), + ('"go pro" OR gopro', "gopro hero", True), + ('"go pro" AND gopro', "gopro hero", False), + (["go pro", "gopro"], "something", False), + (["go pro", "gopro"], "go pro", True), + (["go pro", "gopro"], "gopro", True), + (["go pro", "gopro"], "gopro hero", True), + # literal AND works + ("AND", " AND Camera", True), + ('AND OR "gopro', " AND Camera", True), + ('"gopro" OR "AND"', " AND Camera", True), + (['"go pro" AND 11', "gopro AND 12"], "gopro hero 12", True), + ("DJI AND Drone AND NOT Camera", "dji drone", True), + ("DJI AND Drone AND NOT Camera", "dji drone camera", False), + ("DJI AND Drone AND NOT Camera", "dji camera", False), + ("DJI AND Drone AND NOT Camera", "drone", False), + ("DJI AND Drone AND NOT Camera", "drone from somewhere else", False), + ("DJI AND (Drone OR Camera)", "dji drone", True), + ("DJI AND (Drone OR Camera)", "dji camera", True), + ("DJI AND (Drone OR Camera)", "dji drone camera", True), + ("DJI AND (Drone OR Camera)", "drone camera from somewhere else", False), + ("DJI AND (Drone)", "drone camera from somewhere else", False), + ("DJI AND (Drone)", "drone DJI from somewhere else", True), + ("DJI AND (NOT Drone)", "drone DJI from somewhere else", False), + ("DJI AND (Drone AND from)", "drone DJI from somewhere else", True), + ("DJI AND (Drone AND something)", "drone DJI from somewhere else", False), + ("DJI AND (Drone OR (camera AND bad))", "drone DJI from somewhere else", True), + ("DJI AND (Drone OR (camera AND bad))", " DJI camera from somewhere else", False), + ("DJI AND (Drone OR (camera AND bad))", " bad DJI camera from somewhere else", True), + ], +) +def test_is_substring(var1: List[str] | str, var2: str, res: bool) -> None: + assert is_substring(var1, var2) == res