Skip to main content

monotiring exact data (urlTag) and alert on changes by email/telegram (threading)

Reason this release was yanked:

while not used anywhere use new vertion!

Project description

monitor_utils

INSPIRATION

Suppose you wish to give blood to the Center. So nowadays you need to make an appointment by website, BUT you can't do this while the Center actually don't need your group. Group necessity shown on Center website and called DonorSvetofor. And as result you need monitoring it manually, because there are no news, email notifications, subscriptions. It's not difficult but if you do it as day routine (even once a day) its quite distracting.

So I created it first as Monitor_DonorSvetofor

Features

  1. Threading each monitor
  2. monitor
    • website data changes
      • tag text
      • tag attribute
    • email received with subject (by regexp) in exact folder
  3. Email/Telegram alert if
    • monitored data changed (from last state)
    • html structure was changed so parsing can't be finished
    • url became unreachable

IMPORTANT

as for Monitor_DonorSvetofor Now it works as DonorSvetofor for GBUZ "O.K. Gavrilov DZM Blood Center".
For each new monitor (URL) you need to create new instance and change settings.

What do you need to use it as Monitor_DonorSvetofor

  1. install python
  2. download project
  3. apply project requirements
  4. add ENVIRONS on your OS for your email account (log/pwd)
  5. add script to OS autostart
  6. correct your BloodGroup and RH directly in code
  7. start script
  8. wait email notification

License

See the LICENSE file for license rights and limitations (MIT).

Release history

See the HISTORY.md file for release history.

Installation

pip install monitor-utils

Import

from monitor_utils import *

GUIDE

See tests and source for other examples.

1. change or apply auth private data (see private_values)

2. create new desired class for your purpose

See monitor_url_tag__implements.py for examples.

MonitorUrlTag

from monitor_utils import *

class Monitor_CbrKeyRate(MonitorUrlTag):
    """
    MONITOR CentralBankRussia KeyRate

    # STRUCTURE to find -------------------------------------
<div class="table-wrapper">
  <div class="table-caption gray">% годовых</div>
  <div class="table">
    <table class="data">
      <tr>
        <th>Дата</th>
        <th>Ставка</th>
      </tr>
      <tr>
        <td>17.08.2023</td>
        <td>12,00</td>
      </tr>
      <tr>
        <td>16.08.2023</td>
        <td>12,00</td>
      </tr>
      <tr>
        <td>15.08.2023</td>
        <td>12,00</td>
      </tr>
      <tr>
        <td>14.08.2023</td>
        <td>8,50</td>
      </tr>
      <tr>
        <td>11.08.2023</td>
        <td>8,50</td>
      </tr>
      <tr>
        <td>10.08.2023</td>
        <td>8,50</td>
      </tr>
    </table>
  </div>
  <div class="table-caption">
    <p>
	  Данные доступны с  17.09.2013 по 17.08.2023.
	  </p>
  </div>
</div>
    """
    URL = "https://cbr.ru/hd_base/KeyRate/"
    TAG_CHAINS = [
        TagAddressChain("div", {"class": "table-wrapper"}, None, 0),
        TagAddressChain("td", {}, None, 1),
    ]
    TAG_GET_ATTR = None
    value_last = "12,00"

MonitorImap

see source

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monitor_utils-0.0.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

monitor_utils-0.0.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file monitor_utils-0.0.2.tar.gz.

File metadata

  • Download URL: monitor_utils-0.0.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for monitor_utils-0.0.2.tar.gz
Algorithm Hash digest
SHA256 41f53372495dbe563d262820ad5d33706d0098decffdb336126cf0d9c7cf62c4
MD5 9de3e459a48a4aaaec27c69996a2c986
BLAKE2b-256 1b5859d2c0a7ac618e83d2561cbb0b61c7b34b1cbf6e437eaff11b66e83986e2

See more details on using hashes here.

Provenance

File details

Details for the file monitor_utils-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for monitor_utils-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9106e9262cfa6ccf689ea1d968a27648c0785edafd11f6385a50a9281c2c942
MD5 8ab2e1532d084d6442ff62bb4d4164db
BLAKE2b-256 c23f0ea70b64b169abe4ac1c77e69b23afda054b0367b78f4abbfffc1ffc17d7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page