# QuickLog
QuickLog is a tiny Python3 library for logging experimental results. It uses JSON to serialize log records into human readable text files. Appending new records to a log file does not require parsing the current log data, making logging performance scallable. Parsing log results may however require some time, but complexity is $O(n)$ where n is the number of records in the log file.
QuickLog also features trace save to a traces database (which is a structured directory). Each trace is referenced in the log file via a unique random identifier. For this, the `TRACESDIR` environment variable should refer to the traces database directory. If this environment variable is not defined,
`./traces` directory is used.
This library is meant to be very simple to use.
## Logging example
```python
import quicklog
log = quicklog.Log()
for i in range(100):
# new_record creates a dict with session Id, record Id and timestamp.
record = quicklog.new_record()
# Add experiment data
record['result'] = do_experiment()
log.append(record)
```
## Parsing log example
```python
import quicklog
for record in quicklog.read_log():
rid = record['id']
result = record['result']
print(f'{rid}: {result}')
```
## Installation
Quicklog is available on pypi. You can install it with `pip3`:
```bash
pip3 install donjon-quicklog
```
If you want to install the latest version from the repository,
clone the repository then use `pip3` to install the package.
```bash
pip3 install ./quicklog
```
## Licensing
Quicklog is released under GNU Lesser General Public Licence version 3 (LGPLv3).
See [COPYING](COPYING) and [COPYING.LESSER](COPYING.LESSER) for license details.
Raw data
{
"_id": null,
"home_page": null,
"name": "donjon-quicklog",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Olivier H\u00e9riveaux",
"author_email": "olivier.heriveaux@ledger.fr",
"download_url": "https://files.pythonhosted.org/packages/bc/97/ca0f0b19d2cf289feb4648f46701c1977779927b38dba8034fd5c5d85b3d/donjon_quicklog-1.0.2.post1.tar.gz",
"platform": null,
"description": "# QuickLog\n\nQuickLog is a tiny Python3 library for logging experimental results. It uses JSON to serialize log records into human readable text files. Appending new records to a log file does not require parsing the current log data, making logging performance scallable. Parsing log results may however require some time, but complexity is $O(n)$ where n is the number of records in the log file.\n\nQuickLog also features trace save to a traces database (which is a structured directory). Each trace is referenced in the log file via a unique random identifier. For this, the `TRACESDIR` environment variable should refer to the traces database directory. If this environment variable is not defined,\n`./traces` directory is used.\n\nThis library is meant to be very simple to use.\n\n## Logging example\n\n```python\nimport quicklog\n\nlog = quicklog.Log()\nfor i in range(100):\n # new_record creates a dict with session Id, record Id and timestamp.\n record = quicklog.new_record()\n # Add experiment data\n record['result'] = do_experiment()\n log.append(record)\n```\n\n## Parsing log example\n\n```python\nimport quicklog\n\nfor record in quicklog.read_log():\n rid = record['id']\n result = record['result']\n print(f'{rid}: {result}')\n```\n\n## Installation\n\nQuicklog is available on pypi. You can install it with `pip3`:\n\n```bash\npip3 install donjon-quicklog\n```\n\nIf you want to install the latest version from the repository,\nclone the repository then use `pip3` to install the package.\n\n```bash\npip3 install ./quicklog\n```\n\n## Licensing\n\nQuicklog is released under GNU Lesser General Public Licence version 3 (LGPLv3).\nSee [COPYING](COPYING) and [COPYING.LESSER](COPYING.LESSER) for license details.\n",
"bugtrack_url": null,
"license": "LGPL-3.0-or-later",
"summary": "Python3 library for logging experimental results",
"version": "1.0.2.post1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5a47be30988de080326e7adb9ac00cd27cec87ebaac009e0535b74aa4efa706b",
"md5": "c1b3d4f1a4c649102f02b6edbf6ce621",
"sha256": "0c2cbef3c85a6f8da33eff03690205ca76d53b7157ce5034a5026705a53be59b"
},
"downloads": -1,
"filename": "donjon_quicklog-1.0.2.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c1b3d4f1a4c649102f02b6edbf6ce621",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 22074,
"upload_time": "2025-01-31T11:42:45",
"upload_time_iso_8601": "2025-01-31T11:42:45.733253Z",
"url": "https://files.pythonhosted.org/packages/5a/47/be30988de080326e7adb9ac00cd27cec87ebaac009e0535b74aa4efa706b/donjon_quicklog-1.0.2.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc97ca0f0b19d2cf289feb4648f46701c1977779927b38dba8034fd5c5d85b3d",
"md5": "b6e0812f6f656527fc1e6b654e90ca5b",
"sha256": "15c5cfbbe9063961b4f5d1160f71ea52b191337a1c5384ee70cc6f46d9b44b25"
},
"downloads": -1,
"filename": "donjon_quicklog-1.0.2.post1.tar.gz",
"has_sig": false,
"md5_digest": "b6e0812f6f656527fc1e6b654e90ca5b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 18886,
"upload_time": "2025-01-31T11:42:47",
"upload_time_iso_8601": "2025-01-31T11:42:47.924249Z",
"url": "https://files.pythonhosted.org/packages/bc/97/ca0f0b19d2cf289feb4648f46701c1977779927b38dba8034fd5c5d85b3d/donjon_quicklog-1.0.2.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-31 11:42:47",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "donjon-quicklog"
}