This release is a pre-release and may not be stable for production use.
#####################################
The **mdfmonitor** is Python module about monitoring files modification using timestamp and body.
The **mdfmonitor** contains:
+ **FileModificationMonitor**
+ **URLModificationMonitor**
FileModificationMonitor
=================
This FileModificationMonitor (call this *monitor* from now) can monitor to a **file** or files modification.
Monitor has the repository of file's **timestamp** data and **body** data.
And monitor appends each data, then monitor **compare** new data to old data.
If new data **differ** to old data, monitor **regard** this difference to **modification**.
Then monitor create instance of FileModificationObject, yield this.
How to Use
------------
It's simple.
1. Import this module.
2. Create `FileModificationMonitor` class's instance.
3. Append file or files to instance using add_file method.
4. using Python for sentence, You can write anything under for sentence.
::
#!/usr/bin/python
import os
from mdfmonitor import FileModificationMonitor
files = os.listdir(".") # >>> ['sample.txt', 'sample.py']
# create Watcher instnce
monitor = FileModificationMonitor()
# append file to mdfmonitor instance
monitor.add_file("sample.txt")
# or
# append files to mdfmonitor instance
monitor.add_files(os.listdir("."))
for mdf in monitor.monitor():
print mdf.file.center(30, "=")
print "Catch the Modification!!"
print "Old timestamp: %s" % mdf.old_mtime
print "New timestamp: %s" % mdf.new_mtime
print "manager: %s" % str(mdf.manager.o_repository)
print "Diff".center(30,"=")
print mdf.diff
URLModificationMonitor
=================
This URLModificationMonitor (call this *monitor* from now) can monitor to **body of url** or urls modification.
This monitor's structure **almost same** to FileModificationMonitor.
Both monitor just difference is to time data what compare.
FileModificationMonitor gets a file **timestamp**, URLModificationMonitor gets the `Date` header's **date** of server.
How to Use
-------------
It's simple too.
1. Import this module.
2. Create `URLModificationMonitor` class's instance.
3. Append url string or url string's list to instance using add_url method.
4. using Python for sentence, You can write anything under for sentence.
::
#!/usr/bin/python
import os
from mdfmonitor import URLModificationMonitor
files = os.listdir(".") # >>> ['sample.txt', 'sample.py']
# create Watcher instnce
monitor = URLModificationMonitor()
# append file to mdfmonitor instance
monitor.add_url("http://sampe.com/path/")
for mdf in monitor.monitor():
print mdf.url.center(30, "=")
print "Catch the Modification!!"
print "Old timestamp: %s" % mdf.old_dtime
print "New timestamp: %s" % mdf.new_dtime
print "manager: %s" % str(mdf.manager.o_repository)
print "Diff".center(30,"=")
print mdf.diff
Metadata
Release files for mdfmonitor 0.1.2b
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mdfmonitor-0.1.2b.tar.gz | 3.8 kB | Without provenance | Details for mdfmonitor-0.1.2b.tar.gz |
Release files / mdfmonitor-0.1.2b.tar.gz
| Download URL | mdfmonitor-0.1.2b.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05eb5463e3b1e21a6a6ccdf962c67dbd2b70095ce56251bef2bc5642375801b8
|
|
BLAKE2b-256 checksum How to use checksums |
198fae60ff0108e18478189885ab6c3e47b0b6ed87af9057ecb2f5844466b6ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mdfmonitor 0.1.2b
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.