Skip to main content

pydiary

MatLab style commands logger for the Python interpreter, with added features.

Usage

Import the Diary class from the package and create a new instance. The commands you type in from now on will be logged into a file. Call diary.off() to disable logging.

from pydiary import Diary

Diary()                 # Turns diary on, saving commands to the default file diary.py

...

# The current active diary is automatically assigned to a variable called "diary"
diary.off()             # Turns diary off

You can pass a custom path for the diary file and save the instance to re-enable it afterwards:

# Turns diary on, saving commands to a file called mydiary.py in the current directory
my_diary = Diary('mydiary.py')      # You can save a reference to the Diary instance to use it later

...

my_diary.off()

...

my_diary.on()           # Turns on the previously created diary

Advanced usage

Buffered mode

By default pydiary uses an internal string buffer to keep the diary file free for manual changes, and only writes to it when you turn off the diary. You can force pydiary to flush commands to the file by calling diary.flush().

Call diary.discard() if you want to discard all commands not yet written to the diary file.

Direct mode

You can force pydiary to operate in direct mode by setting the buffered parameter to False when creating an instance.

Diary(buffered=False)

In this mode pydiary will write commands directly to the diary file. Note that due to the way Python handles writing to files, the commands may not be written immediately and you may still need to call diary.off() to see them in the file.

Improvement, Issues report

Suggest improvements or features, report bugs at https://github.com/nathanlepori/pydiary/issues

Authors

  • Nathan Lepori

Metadata

Release files for pydiary 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydiary 1.1.0
File Size Uploaded Provenance Actions
pydiary-1.1.0.tar.gz 3.5 kB Without provenance Details for pydiary-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydiary 1.1.0
File Interpreter ABI Platform Actions
pydiary-1.1.0-py3-none-any.whl Python 3 none any Details for pydiary-1.1.0-py3-none-any.whl

Total release size: 8.3 kB

Release files / pydiary-1.1.0.tar.gz

Download URL pydiary-1.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5cfba62a7827128ed04872c65f63b119aa7355b678fb0f3898c790a03848e30c
BLAKE2b-256 checksum
How to use checksums
832401e767904e88b92919850d3d1733756a90e660ec5295c1b2ea0a1b474754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / pydiary-1.1.0-py3-none-any.whl

Download URL pydiary-1.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e255e17639c4fa56dc77bec96391a1040996e2d762b30200e48ee3368f09a8cd
BLAKE2b-256 checksum
How to use checksums
66f84be48922c5db18a0e64f88210361634c747fdc3bebe767a8c5e72b973e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Security for pydiary 1.1.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page