Skip to main content

py_simple_history 0.0.1

A super basic python History Tracking object



About^

In this instance "History" means the state of an object at any given time. This module aims to provide a simple interface for tracking and moving through histories.

Installation^

Available on pip - pip install py_simple_history

Usage^

history_mixin^

Abstract mixin to add simple history-tracking to an object.

class history_mixin(object):
	def __init__(self, start_data):
		...
	def add_history(self, data):
		"""Add a history point. Clears any undone data history points."""
	def clear_history(self, data=None):
		"""Clears history. Sets a new history point, if no data specified uses the current data point."""
	def redo(self):
		"""Redoes history one step if possible."""
	def undo(self):
		"""Undoes history one step if possible."""

Example^

from py_simple_history import history_mixin

class demo_object(history_mixin):
    def __init__(self, initial_data):
        history_mixin.__init__(self, initial_data)
        self.load(self.data:=initial_data)
        ...

    def on_update(self, new_data):
        self.add_history(new_data)
        self.load(data)

    def load(self, data):
        self.data = data

    def step_back(self):
        self.load(self.undo())

    def step_forward(self):
        self.load(self.redo())

Metadata

Release files for py-simple-history 0.0.1

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

Built distribution (wheel)

Table of built distributions (wheels) for py-simple-history 0.0.1
File Interpreter ABI Platform Actions
py_simple_history-0.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for py_simple_history-0.0.1-py2.py3-none-any.whl

Release files / py_simple_history-0.0.1-py2.py3-none-any.whl

Download URL py_simple_history-0.0.1-py2.py3-none-any.whl
Size 15.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
46d27c15edfe7c8e4d9e55f928e97575783f80ded0d9708d74ec5b43ba324b9d
BLAKE2b-256 checksum
How to use checksums
a928523245be7ff6d605391975edcd69d33638e5a85db059239ad2ba111caf69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Security for py-simple-history 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

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