{"id":15539058,"url":"https://github.com/patricklx/ar-orm","last_synced_at":"2025-06-27T15:07:12.163Z","repository":{"id":57411562,"uuid":"355165738","full_name":"patricklx/ar-orm","owner":"patricklx","description":"arango orm with identity pattern","archived":false,"fork":false,"pushed_at":"2022-06-22T11:22:38.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T15:06:20.926Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patricklx.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-04-06T11:35:14.000Z","updated_at":"2022-03-17T15:57:45.000Z","dependencies_parsed_at":"2022-09-09T22:23:14.312Z","dependency_job_id":null,"html_url":"https://github.com/patricklx/ar-orm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patricklx/ar-orm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricklx%2Far-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricklx%2Far-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricklx%2Far-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricklx%2Far-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patricklx","download_url":"https://codeload.github.com/patricklx/ar-orm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricklx%2Far-orm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262279119,"owners_count":23286549,"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":[],"created_at":"2024-10-02T12:08:59.896Z","updated_at":"2025-06-27T15:07:12.067Z","avatar_url":"https://github.com/patricklx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arorm\narango orm with identity pattern\n\n\n## examples\n\n```python\nimport typing\nfrom arorm import ListProperty, Field, ObjectProperty, PasswordField, Model, ReferenceId, Reference, ReferenceIdList, ReferenceList, Store, RemoteReferenceList\n\nclass UserAttributes(ObjectProperty):\n    class Settings(ObjectProperty):\n        notifications = Field(default=False)\n        html5Notifications = Field(default=False)\n    last_update: float = Field(default=0)\n    last_login: float = Field(default=0)\n    settings = Settings()\n    \nclass User(Model):\n    __collection__ = 'users'\n    name = Field()\n    password = PasswordField(hidden=True)\n    email = Field()\n    attributes = UserAttributes()\n    achievements: typing.List[str] = ListProperty(str)\n    books: typing.List['Book'] = RemoteReferenceList('author_id', 'Book')\n\nclass Book(Model):\n    __collection__ = 'books'\n    author_id = ReferenceId()\n    author = Reference(author_id, User)\n    co_authors_ids = ReferenceIdList()\n    co_authors: typing.List[User] = ReferenceList(co_authors_ids, User)\n\ndb = dict(host='127.0.01', user='root', password='root', port=8529, driver='arango')\nstore = Store(db)\nstore.setup_db()\nuser = store.create(User) # will create a user on commit\nbook = store.create(Book) # will create a book on commit\nbook.author = user\nbook.co_authors.append(user)\n\nstore.query(User).filter(User.name == 'admin').delete() # queued to be executed on commit\n\nstore.run_after_commit(lambda: print('did commit'))\n\nstore.commit()\n\nuser.to_json() # -\u003e will now have _id, _rev\nbook.to_json() # -\u003e will now have author_id set to same id as user\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricklx%2Far-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatricklx%2Far-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricklx%2Far-orm/lists"}