{"id":17267978,"url":"https://github.com/arjunsk/movector","last_synced_at":"2025-06-14T15:05:21.092Z","repository":{"id":185367714,"uuid":"673430090","full_name":"arjunsk/movector","owner":"arjunsk","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-19T04:36:25.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T11:14:59.471Z","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/arjunsk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-01T15:49:44.000Z","updated_at":"2024-03-06T02:42:58.000Z","dependencies_parsed_at":"2024-03-06T04:45:44.686Z","dependency_job_id":null,"html_url":"https://github.com/arjunsk/movector","commit_stats":null,"previous_names":["arjunsk/movector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arjunsk/movector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunsk%2Fmovector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunsk%2Fmovector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunsk%2Fmovector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunsk%2Fmovector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjunsk","download_url":"https://codeload.github.com/arjunsk/movector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunsk%2Fmovector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259835390,"owners_count":22918979,"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-15T08:12:09.400Z","updated_at":"2025-06-14T15:05:21.068Z","avatar_url":"https://github.com/arjunsk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### MO Vector Python Client\n\nWork in progress.\n\n### Sample code:\n```python\nimport implicit\nfrom implicit.datasets.movielens import get_movielens\n\nfrom sqlalchemy import create_engine, insert, select, text, Integer, String\nfrom sqlalchemy.orm import declarative_base, mapped_column, Session\n\nfrom movector.sqlalchemy import VectorF32\n\nengine = create_engine(\"mysql+pymysql://root:111@127.0.0.1:6001/a\")\nwith engine.connect() as conn:\n    results = conn.execute(text(\"SELECT 42;\"))\n\nBase = declarative_base()\n\n\nclass User(Base):\n    __tablename__ = 'user'\n\n    id = mapped_column(Integer, primary_key=True)\n    factors = mapped_column(VectorF32(20))\n\n\nBase.metadata.drop_all(engine)\nBase.metadata.create_all(engine)\n\ntitles, ratings = get_movielens('100k')\nmodel = implicit.als.AlternatingLeastSquares(factors=20)\nmodel.fit(ratings)\n\nusers = [dict(factors=factors) for i, factors in enumerate(model.user_factors)]\n\nsession = Session(engine)\nsession.execute(insert(User), users)\n\nuser = session.get(User, 70)\nprint('user-based recs:', [user.id, user.factors])\n\n# Prints:\n# user-based recs: [70, array([ 7.8333974 ,  8.490529  ,  8.774695  ,  9.268776  ,  6.0036736 ,\n#         6.134292  ,  0.19642895,  7.596437  ,  2.9758034 ,  7.9472003 ,\n#         4.068931  ,  0.58703905,  1.5298995 ,  5.9633737 ,  2.553488  ,\n#         4.9483128 , 10.799758  ,  0.6393655 ,  7.034949  ,  6.145868  ],\n#       dtype=float32)]\n```\n\nAsync Support: https://github.com/sqlalchemy/sqlalchemy/blob/main/examples/asyncio/basic.py\n\nDerived From: https://github.com/pgvector/pgvector-python/blob/master/pgvector/sqlalchemy/__init__.py\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunsk%2Fmovector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjunsk%2Fmovector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunsk%2Fmovector/lists"}