{"id":17161545,"url":"https://github.com/gnubyte/gitmixin","last_synced_at":"2025-03-24T15:43:42.601Z","repository":{"id":49256543,"uuid":"379013345","full_name":"gnubyte/gitmixin","owner":"gnubyte","description":"An SQL-Alchemy mixin to give records per row a git version tracked text","archived":false,"fork":false,"pushed_at":"2021-06-22T18:59:45.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T20:23:49.865Z","etag":null,"topics":["git","python","sql","sqlalchemy"],"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/gnubyte.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}},"created_at":"2021-06-21T17:34:29.000Z","updated_at":"2023-07-11T20:26:07.000Z","dependencies_parsed_at":"2022-08-20T07:01:33.354Z","dependency_job_id":null,"html_url":"https://github.com/gnubyte/gitmixin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnubyte%2Fgitmixin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnubyte%2Fgitmixin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnubyte%2Fgitmixin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnubyte%2Fgitmixin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnubyte","download_url":"https://codeload.github.com/gnubyte/gitmixin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245301922,"owners_count":20593275,"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":["git","python","sql","sqlalchemy"],"created_at":"2024-10-14T22:43:19.619Z","updated_at":"2025-03-24T15:43:42.572Z","avatar_url":"https://github.com/gnubyte.png","language":"Python","readme":"# Gitmixin\n\nAn SQLALchemy mixin that can track individual fields and turn them into git repos with simple advance forward, rewind back mechanisms.\n\n[![Docs](https://img.shields.io/badge/gitmixin-docs-blue)](https://gitmixin.readthedocs.io/en/latest/?)\n[![PyPI Version](https://img.shields.io/badge/gitmixin-PyPI-green)](https://pypi.org/project/gitmixin/)\n[![Github](https://img.shields.io/github/forks/gnubyte/gitmixin?style=social)](https://github.com/gnubyte/gitmixin)\n\n\n## Docs\n\nDocumentation on how to use the project as well as development for it can be found here. Check the projects section on Github speciifcally for the roadmap.\n\n[Checkout our read the docs!](https://gitmixin.readthedocs.io/en/latest/?)\n\n## Testing\n\nRun tests: \n\n`python3 tests/test_githandler.py`\n\n\n## Getting started with GitMixin\n\nA quick guide to using gitmixin\n\n## Installation\n\nFirst install gitmixin with pip\n\n`pip install gitmixin`\n\nor \n\n`pip3 install gitmixin`\n\n***\n\n## Adding Gitmixin to your project\n\nSQLALchemy projects typically have a database defined in models. In your models.py file or equivalent, import GitMixin near the top of the file.\n\n`from gitmixin import GitMixin`\n\n\nThen, in your SQLAlchemy class, inherit the GitMixin we just imported to give that model SQLAlchemy methods \u0026 allow it to access that models' event hooks.\n\n`class Notes(Base, GitMixin):`\n\n\nFinally in the model, add a new private attribute trackedfields, and let it equal a list of strings that you intend to track. The strings inside this list should be names of fields you want to track.\n\n```\nclass Notes(Base, GitMixin):\n    __tablename__ = 'notes'\n    __trackedfields__ = ['notes', 'links']\n    id = Column(Integer, primary_key=True)\n    notes =  Column(String(200))\n    links = Column(String(200))\n```\n\n\n\n\n\n### A finished example\n\n\n\n```\n# imports\nfrom gitmixin import GitMixin\n\n# SQLAlchemy\nfrom sqlalchemy import Column, Integer, String\nfrom sqlalchemy.ext.declarative import declarative_base\n\n# ...\n\nBase = declarative_base()\n\n\nclass Notes(Base, GitMixin):\n    __tablename__ = 'notes'\n    __trackedfields__ = ['notes', 'links']\n    id = Column(Integer, primary_key=True)\n    notes =  Column(String(200))\n    links = Column(String(200))\n\n\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnubyte%2Fgitmixin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnubyte%2Fgitmixin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnubyte%2Fgitmixin/lists"}