{"id":23326231,"url":"https://github.com/hlpdev/smem","last_synced_at":"2025-10-28T11:31:12.693Z","repository":{"id":268159862,"uuid":"899718281","full_name":"hlpdev/SMem","owner":"hlpdev","description":"A Python library that is used to handle interprocess communication platform independently in Python.","archived":false,"fork":false,"pushed_at":"2024-12-06T22:18:25.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T19:46:22.826Z","etag":null,"topics":[],"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/hlpdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-06T21:29:09.000Z","updated_at":"2024-12-06T22:19:41.000Z","dependencies_parsed_at":"2024-12-14T19:54:43.921Z","dependency_job_id":"60ba4ca7-b25f-4a92-92c9-afa9e5a7a425","html_url":"https://github.com/hlpdev/SMem","commit_stats":null,"previous_names":["hlpdev/smem"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlpdev%2FSMem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlpdev%2FSMem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlpdev%2FSMem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlpdev%2FSMem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlpdev","download_url":"https://codeload.github.com/hlpdev/SMem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238642376,"owners_count":19506194,"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-12-20T19:15:16.842Z","updated_at":"2025-10-28T11:31:07.244Z","avatar_url":"https://github.com/hlpdev.png","language":"Python","readme":"# SMem\n\u003cimg src=\"https://img.shields.io/github/v/release/hlpdev/SMem\" alt=\"\"\u003e \u003cimg src=\"https://img.shields.io/badge/3.6-%2330648e?label=python\" alt=\"\"\u003e\n\nThe SMem library is used to handle **interprocess communication** ***(IPC)*** \nplatform independently in Python.\n\n## Usage\n\u003e [!NOTE]\n\u003e You must provide a name for the shared memory instance.\n\u003e \n\u003e The size of the shared memory defaults to 1024\n\u003e \n\u003e The create flag on the shared memory instance defaults to false, \n\u003e so make sure you ensure that an instance of the shared memory exists!\n\n#### Creating a shared memory instance:\n```python\nfrom smem.smem import SMem\n\n# Create the SMem instance with the \"create\" flag \n# enabled and a specified \"size\" of 1024\nshared_memory = SMem(\"my_shared_memory\", create=True, size=1024)\n```\n\n#### Attaching to a shared memory instance:\nUseful for reading an existing shared memory instance.\n```python\nfrom smem.smem import SMem\n\n# Create the SMem instance with the \"size\" flag set to 1024\n# (the same as when we created it)\nshared_memory = SMem(\"my_shared_memory\", size=1024)\n```\n\n#### Writing to shared memory\nWriting to shared memory will overwrite the existing value.\n```python\n# Assume \"shared_memory\" contains an active instance of SMem\ndata = b\"This is my data to write!\"\nshared_memory.write(data)\n```\n\n#### Reading shared memory\n```python\n# Assume \"shared_memory\" contains an active instance of SMem\ndata = shared_memory.read()\n```\n\n#### Closing an instance\nClosing an instance that created the shared memory file:\n```python\n# Assume \"shared_memory\" contains an active instance of SMem\n# that created the shared memory file\nshared_memory.close()\nshared_memory.unlink()\n```\nClosing an instance that did not create the shared memory file:\n```python\n# Assume \"shared_memory\" contains an active instance of SMem\n# that did not create the shared memory file\nshared_memory.close()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlpdev%2Fsmem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlpdev%2Fsmem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlpdev%2Fsmem/lists"}