{"id":43529270,"url":"https://github.com/factorysh/aio-sonic-rest","last_synced_at":"2026-02-03T15:37:57.379Z","repository":{"id":55516446,"uuid":"230665485","full_name":"factorysh/aio-sonic-rest","owner":"factorysh","description":"REST API for Sonic search daemon","archived":false,"fork":false,"pushed_at":"2020-12-24T13:01:44.000Z","size":74,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-21T00:58:32.935Z","etag":null,"topics":["aio","sonic"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/factorysh.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":"2019-12-28T20:49:57.000Z","updated_at":"2024-04-21T00:58:32.936Z","dependencies_parsed_at":"2022-08-15T02:10:49.318Z","dependency_job_id":null,"html_url":"https://github.com/factorysh/aio-sonic-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/factorysh/aio-sonic-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factorysh%2Faio-sonic-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factorysh%2Faio-sonic-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factorysh%2Faio-sonic-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factorysh%2Faio-sonic-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/factorysh","download_url":"https://codeload.github.com/factorysh/aio-sonic-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factorysh%2Faio-sonic-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29048022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:19:55.533Z","status":"ssl_error","status_checked_at":"2026-02-03T15:13:09.723Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["aio","sonic"],"created_at":"2026-02-03T15:37:56.672Z","updated_at":"2026-02-03T15:37:57.368Z","avatar_url":"https://github.com/factorysh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"AIO Sonic REST\n==============\n\nREST API for [Sonic](https://github.com/valeriansaliou/sonic) daemon.\n\nIt uses aiohttp, and documents are stored raw, read with mmap.\nIt's fast and doesn't eat all your memory.\n\nUsage\n-----\n\nIndex\n\n```python\ni = Ingestor(\n    dict(\n        name=dict(stored=True),\n        body=dict(indexed=True),\n        tags=dict(stored=True, indexed=True,),\n    ),\n    password=\"iuNg5Ri6daik2fe2Phoo6aig\",\n    path=\"./data/store/collection\",\n)\ni.reset()\ndocuments = [\n    dict(name=\"alice\", body=\"Elle a mangé des carottes.\", tags=[\"carotte\"]),\n    dict(name=\"bob\", body=\"Il fait du Django.\", tags=[\"python\", \"django\"]),\n    dict(name=\"charly\", body=\"Il a un python dans son vivarium.\", tags=[]),\n]\ni.ingest(documents)\n```\n\nSearch\n\n```python\ns = Search(\"./data/store/collection\", password=\"iuNg5Ri6daik2fe2Phoo6aig\")\nsize, results = await s.search(\"python\", [\"tags\", \"body\"])\n```\n\nRest it\n```python\napp = web.Application()\nsonic_rest(app, s)\n```\n\nQuery it\n```python\nresp = await client.get(\"/query?q=python\")\nresp = await client.get(\"/suggest?s=car\")\n```\n\nAll this code are in test files.\n\nTests\n-----\n\nStart the sonic daemon\n\n    docker-compose up -d\n\nRun tests\n\n    pytest\n\n\nOr, simpler:\n\n    make test\n\nLicence\n-------\n\n3 terms BSD licence, ©2019 Mathieu Lecarme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffactorysh%2Faio-sonic-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffactorysh%2Faio-sonic-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffactorysh%2Faio-sonic-rest/lists"}