{"library":"smmap2","title":"smmap2 - Shared Memory Map","type":"library","description":"smmap2 is a mirror package on PyPI for the `smmap` library, specifically distributing version 3.0.1 of `smmap` under the name `smmap2`. It provides an efficient way to memory-map data, particularly for large files, and is primarily intended as an internal dependency for specific versions of `GitPython` or projects requiring this exact older version. The upstream `smmap` project (at `gitpython-developers/smmap`) has since progressed to version 5.x.x.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install smmap2"],"cli":null},"imports":["from smmap import SlidingWindowMap"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/gitpython-developers/smmap","docs":null,"changelog":null,"pypi":"https://pypi.org/project/smmap2/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nimport mmap\nimport tempfile\nfrom smmap import SlidingWindowMap\n\n# Create a dummy file for memory mapping\ndata_to_map = b\"This is some test data that will be memory-mapped.\" * 10 # make it a bit larger\nfile_size = len(data_to_map)\n\n# Use tempfile to create a temporary file\nwith tempfile.NamedTemporaryFile(delete=False) as tmp_file:\n    tmp_file.write(data_to_map)\n    tmp_file_path = tmp_file.name\n\ntry:\n    # Open the file for reading\n    with open(tmp_file_path, \"rb\") as f:\n        # Create an mmap object for the file\n        m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)\n\n        # Create a SlidingWindowMap instance\n        # For this example, we'll map the entire file into a single window\n        window_size = file_size\n        s = SlidingWindowMap(m, begin=0, size=file_size, window_size=window_size)\n\n        # Access data through the sliding window map\n        read_data = s[0:file_size]\n        print(f\"Read data length: {len(read_data)}\")\n        print(f\"First 50 bytes: {read_data[:50].decode()}\")\n\n        assert read_data == data_to_map\n        print(\"Data successfully read and verified.\")\n\n        s.close()\n        m.close()\n\nfinally:\n    # Clean up the temporary file\n    if os.path.exists(tmp_file_path):\n        os.remove(tmp_file_path)\n","lang":"python","description":"Demonstrates how to initialize and use `SlidingWindowMap` to read data from a memory-mapped file. It creates a temporary file, maps it into memory, and then accesses the data via `SlidingWindowMap`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"3.0.1","pypi_latest":"3.0.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.5,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"18.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"smmap2","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"18M"}]}}