{"id":41251795,"url":"https://github.com/ccooper1982/fcache","last_synced_at":"2026-01-23T01:40:17.257Z","repository":{"id":271145862,"uuid":"911327454","full_name":"ccooper1982/fcache","owner":"ccooper1982","description":"FlatBuffers cache over WebSockets. Written in C++ with a Python API","archived":false,"fork":false,"pushed_at":"2025-02-11T15:00:20.000Z","size":1306,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T15:44:58.885Z","etag":null,"topics":["cache","cpp","flatbuffers","key-value","keyvalue","kv"],"latest_commit_sha":null,"homepage":"https://ccooper1982.github.io/fcache/","language":"C++","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/ccooper1982.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":"2025-01-02T18:54:22.000Z","updated_at":"2025-02-11T14:59:25.000Z","dependencies_parsed_at":"2025-01-05T21:18:43.155Z","dependency_job_id":"1c1d1193-1c7d-4362-b5e0-b4ffe8721aeb","html_url":"https://github.com/ccooper1982/fcache","commit_stats":null,"previous_names":["ccooper1982/fcache"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ccooper1982/fcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccooper1982%2Ffcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccooper1982%2Ffcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccooper1982%2Ffcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccooper1982%2Ffcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccooper1982","download_url":"https://codeload.github.com/ccooper1982/fcache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccooper1982%2Ffcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: 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":["cache","cpp","flatbuffers","key-value","keyvalue","kv"],"created_at":"2026-01-23T01:40:17.184Z","updated_at":"2026-01-23T01:40:17.241Z","avatar_url":"https://github.com/ccooper1982.png","language":"C++","readme":"# fcache\n\nfcache is a FlatBuffers cache over WebSockets.\n\nThere is support for key-values, unsorted lists and sorted lists with more coming soon.\n\nFlatBuffers offer zero-copy deserialising: when the server receives data, it can deserialise without an intermediate step which requires allocating memory (as with ProtoBuf), and is considerably more compact than JSON.\n\nfcache docs available [here](https://ccooper1982.github.io/fcache/).\n\n\u003cbr/\u003e\n\n\u003e [!IMPORTANT]\n\u003e This is a new project, starting in late December 2024. It is in active development so \n\u003e breaking changes to the Python API are quite likely.\n\n\u003cbr/\u003e\n\n\n# Python API\nThe API hides the FlatBuffers details:\n\n```py\nimport fc\nfrom fc.kv import KV\nfrom fc.list import UnsortedList\n\n\nasync def connect() -\u003e fc.Client:\n  try:\n    client = await fc.fcache(uri='ws://127.0.0.1:1987')\n    # or: client = await fc.fcache(ip='127.0.0.1', port=1987)\n  except:\n    print ('Failed to connect')\n    client = None\n  return client\n\n\nasync def example():\n  if (client := await connect()) is None:\n    return\n  \n  # create API object for KV commands\n  kv = KV(client)\n\n  await kv.set({'player':'Monster',\n                'level':25,\n                'active':True,\n                'perks':['Armour','Kilt']})\n\n  # get single key, returns the value\n  level = await kv.get_key('level')\n  print(f'Age: {level}')\n\n  # get multiple keys, returns dict\n  rsp = await kv.get_keys(['player', 'active'])\n  print(f\"Player: {rsp['player']}, Active: {rsp['active']}\")\n  \n  # get list\n  print(await kv.get_key('perks'))\n\n  \n  # Unsorted list API. There's also SortedList\n  lst = UnsortedList(client)\n\n  await lst.create('scores', type='int')\n  await lst.add('scores', [1,2,3,5,5,6,8])\n  await lst.get_n('scores', start=3, count=2) # [5,5]\n  await lst.get_range('scores', start=1, stop=-2)  # [2,3,5,5]\n  await lst.remove_if_eq('scores', val=5)  # [1,2,3,6,8]\n\n\nif __name__ == \"__main__\":\n  asio.run(example())\n```\n\n\u003cbr/\u003e\n\n# KV\n\n- Keys must be a string\n- Values can be:\n  - string, int, unsigned int, float, bool\n  - list/array of the above\n\nKV also supports groups, which is a simple method to separate related keys. A group is identified by a unique string into which keys for that group are stored. For example, you could create a group per user using their email address as a group name.\n\n[Read more](https://ccooper1982.github.io/fcache/kv/).\n\n\u003cbr/\u003e\n\n# Lists\n\nSorted and unsorted lists of integers, string and floats are supported. Sorted lists can also be intersected.\n\n[Read more](https://ccooper1982.github.io/fcache/lists/).\n\n\u003cbr/\u003e\n\n# Build\n\n- GCC required\n- Tested on GCC 13.2 and 14.2\n\n```\ngit clone https://github.com/ccooper1982/fcache.git\ncd fcache\n./build.sh\n```\n\nBinary is in `server/release`.\n\n\u003cbr/\u003e\n\n# Run\n\n\n|Param|Default|Cmd Line|\n|---|---|---|\n|IP|127.0.0.1|`--ip`|\n|Port|1987|`--port / -p`|\n|Max Payload|16384 (bytes)|`--maxPayload`|\n\n\u003cbr/\u003e\n\nOverride IP and port:\n\n`./fcache --ip=192.168.0.10 -port=4321`\n\nOverride max payload:\n\n`./fcache --maxPayload=16384`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccooper1982%2Ffcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccooper1982%2Ffcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccooper1982%2Ffcache/lists"}