{"id":23537513,"url":"https://github.com/py-package/masonite-audit","last_synced_at":"2025-04-23T14:14:28.622Z","repository":{"id":37667694,"uuid":"483942582","full_name":"py-package/masonite-audit","owner":"py-package","description":"Keep track of all your model changes with ease.","archived":false,"fork":false,"pushed_at":"2023-04-03T11:59:43.000Z","size":110,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T14:14:26.868Z","etag":null,"topics":["masonite","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/py-package.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-21T07:03:31.000Z","updated_at":"2024-12-03T13:53:18.000Z","dependencies_parsed_at":"2022-08-08T21:15:38.498Z","dependency_job_id":"047bb1eb-2133-4efd-a40f-32f158680243","html_url":"https://github.com/py-package/masonite-audit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-package%2Fmasonite-audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-package%2Fmasonite-audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-package%2Fmasonite-audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-package%2Fmasonite-audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/py-package","download_url":"https://codeload.github.com/py-package/masonite-audit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250447979,"owners_count":21432165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["masonite","python"],"created_at":"2024-12-26T03:16:12.467Z","updated_at":"2025-04-23T14:14:28.603Z","avatar_url":"https://github.com/py-package.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Masonite Audit\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://banners.beyondco.de/Masonite%20Audit.png?theme=light\u0026packageManager=pip+install\u0026packageName=masonite-audit\u0026pattern=charlieBrown\u0026style=style_2\u0026description=Keep+track+of+all+your+model+changes+with+ease.\u0026md=1\u0026showWatermark=1\u0026fontSize=100px\u0026images=adjustments\u0026widths=50\u0026heights=50\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GitHub Workflow Status\" src=\"https://github.com/py-package/masonite-audit/actions/workflows/pythonapp.yml/badge.svg\"\u003e\n  \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/masonite-audit\"\u003e\n  \u003cimg alt=\"issues\" src=\"https://img.shields.io/github/issues/py-package/masonite-audit\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.7+-blue.svg\" alt=\"Python Version\"\u003e\n  \u003cimg alt=\"GitHub release (latest by date including pre-releases)\" src=\"https://img.shields.io/github/v/release/py-package/masonite-audit\"\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/py-package/masonite-audit\"\u003e\n  \u003ca href=\"https://github.com/py-package/masonite-audit/stargazers\"\u003e\u003cimg alt=\"star\" src=\"https://img.shields.io/github/stars/py-package/masonite-audit\" /\u003e\u003c/a\u003e\n  \u003cimg alt=\"downloads\" src=\"https://img.shields.io/pypi/dm/masonite-audit?style=flat\" /\u003e\n  \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nKeep track of all your model changes with ease.\n\n## Getting Started\n\nInstall the package using pip:\n\n```bash\npip install masonite-audit\n```\n\nAdd AuditProvider to your project in `config/providers.py`:\n\n```python\n# config/providers.py\n# ...\nfrom masonite_audit import AuditProvider\n\n# ...\nPROVIDERS = [\n    # ...\n    # Third Party Providers\n    AuditProvider,\n    # ...\n]\n```\n\nPublish the package configuration files.\n\n```bash\npython craft package:publish masonite-audit\n```\n\nThis will add migrations and other `masonite-audit` related configuration to your project. Run your migrations to create the related database tables.\n\n```bash\npython craft migrate\n```\n\nFinally, inherit `Audit` mixin into all the models for which you need audit logging.\n\n```python\nfrom masonite_audit.mixins import Audit\nclass YourModel(Audit):\n    pass\n```\n\nIf you want to get the audit history for a model, you can use the `history` method:\n\n```python\nuser = User.find(1)\nuser.history()\n```\n\nIn order to rollback to previous versions of a model, you can use the `rollback` method:\n\n```python\nuser = User.find(1)\nuser.rollback() # to rollback to previous version\n# or\nuser.rollback(step=4) # to rollback to version 4\n```\n\n\n\n## License\n\nMasonite Audit is open-sourced software licensed under the [MIT license](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-package%2Fmasonite-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpy-package%2Fmasonite-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-package%2Fmasonite-audit/lists"}