{"id":15716528,"url":"https://github.com/cloudymax/orm-events","last_synced_at":"2026-02-21T10:01:14.185Z","repository":{"id":45926197,"uuid":"394652800","full_name":"cloudymax/orm-events","owner":"cloudymax","description":"File I/O helpers","archived":false,"fork":false,"pushed_at":"2022-04-17T14:51:08.000Z","size":42252,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T14:42:38.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudymax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-10T12:52:48.000Z","updated_at":"2022-04-17T14:50:26.000Z","dependencies_parsed_at":"2022-09-24T18:51:26.174Z","dependency_job_id":null,"html_url":"https://github.com/cloudymax/orm-events","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cloudymax/orm-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudymax%2Form-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudymax%2Form-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudymax%2Form-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudymax%2Form-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudymax","download_url":"https://codeload.github.com/cloudymax/orm-events/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudymax%2Form-events/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:45:56.373Z","updated_at":"2026-02-21T10:01:14.154Z","avatar_url":"https://github.com/cloudymax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ORM-Events\n\n___\nAttemptes to recreate C# getter/setter wich will generate events\ndocs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/using-properties\nhttps://docs.microsoft.com/en-us/dotnet/standard/events/\n\n## Usage\n\n- See demo.py for serialization, de-serialization, and format conversion examples.\n___\n\n\n__To Run the demo:__\n\n```bash\n# cd to the program folder\ncd io_tools\n\n# install dependencies\npip3 install -r requirements.txt\n\n# run the script\npython3 demo.py\n\n```\n\n__Step by step in:__\n\n```zsh\npython3\n```\n\n```python\n\nimport io_tools as io\nimport json\n\nsettings = {}\nvars = io.Variables(settings)\nvars.debug = True\nvars.go_steppy = False\nvars.yaml_input_file = \"pref_input_test.yaml\"\nvars.json_input_file = \"cache.json\"\n\n# reads a file of TYPE\nvars.yaml_file_contents = io.read_yaml_file(vars.yaml_input_file)\nvars.json_file_contents = io.read_json_file(vars.json_input_file)\n\n# print as pretty json\nio.print_pretty(vars.json_file_contents, vars.debug, \"json\")\nio.print_pretty(vars.yaml_file_contents, vars.debug, \"json\")\n\n# print as compact json\nprint(vars.__dict__)\n\n# Serialize\njson_string = print(vars.__dict__) \nio.write_file('cache.json', vars.__dict__, vars.debug)\n\n# Can write CSVs as well, but only working properly on non-nested files. WIP.\ncsv = io.json_to_csv('cache.json')\n```\n\n## Class Methods\n\n___\n### Datastore\n\n Datastore is a `\u003ckey\u003e:\u003cvalue\u003e` dict that accepts any  types and is used for portability. It achieves this  by storing all variables in a generic dictionary  with the `change()` method overriden to be an event system.\n\n### Variables\n\n Object that holds a list of `Datastore()`s,\n When eneabled, the built-in `go_steppy()` function  will pause script execution on any memory state  change to provide a json formatted diff. for example:\n\n ![go_steppy](go_steppy.png)\n\n  change_value:\n    Triggered when any variable within the `Datastore()`  is updated, or created.\n  get_current_value:\n    Returns the current value of a variable within the `Datastore()`, and triggers an event.\n  diff_values:\n    When enabled, deepdiffs the current and proposed change to the `Datastore()` object\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudymax%2Form-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudymax%2Form-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudymax%2Form-events/lists"}