HOTMARKUP
Synchronize data structure with markup file
Currently supported formats: YAML, JSON, Pickle
Main features:
- Work with Connection object as usual data structure. You can use features like array slices or methods of
dictandlist - JS-like accessing (foo.bar.buzz instead of foo['bar']['buzz'])
- Mutations logging via
loggingmodule. Example below - Reload on file change (pass
reload=Falseto connection constructor to disable) - Update file on every change (pass
save=Falseto connection constructor to disable) - Immutable connections (pass
mutable=Falseto connection constructor to enable)
Installation
pip install hotmarkup
Examples
Reload
from hotmarkup import JsonConnection
connection = JsonConnection('example.json', default={'changed': False})
print(connection.changed) # Out: False
with open('example.json', 'w') as f:
f.write('{"changed": true}')
print(connection.changed) # Out: True
Dump
from hotmarkup import JsonConnection
connection = JsonConnection('example.json', default={'changed': False})
print(open('example.json').read()) # Out: {"changed": false}
connection.changed = True
print(open('example.json').read()) # Out: {"changed": true}
Logging
import logging
from hotmarkup import YamlConnection
logging.basicConfig(level=logging.INFO)
connection = YamlConnection('example.yaml', default={'something_important': 'old_value'})
connection.something_important = 'new_value'
Output:
INFO:example.yaml:Mutation UPDATE example.yaml.something_important=new_value
Counter
from hotmarkup import YamlConnection
connection = YamlConnection('counter.yaml', default={'counter': 0})
connection.counter += 1
print(f'You run this program {connection.counter} times')
Metadata
Release files for hotmarkup 0.1.9
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 |
|---|---|---|---|---|
| hotmarkup-0.1.9.tar.gz | 6.3 kB | Without provenance | Details for hotmarkup-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hotmarkup-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for hotmarkup-0.1.9-py3-none-any.whl |
Total release size: 13.5 kB
Release files / hotmarkup-0.1.9.tar.gz
| Download URL | hotmarkup-0.1.9.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f97b741383feef34c2497934292d38304cb9003408cd56f1d04cfe676301226
|
|
BLAKE2b-256 checksum How to use checksums |
6b0cc9faa4a79a65e84e4eb21dde5b87713b3144f880927983f5fa2ca5e69254
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / hotmarkup-0.1.9-py3-none-any.whl
| Download URL | hotmarkup-0.1.9-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
010b536273b4fadb6dcc4d1bcd71e171e35680bbdbca4bf6dc2bdad8a51e5171
|
|
BLAKE2b-256 checksum How to use checksums |
a812c6d3e2cb1ce7a13a860e0e53f3c77507a344044cbeff8653b40389cde989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for hotmarkup 0.1.9
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.