Registry / data / smmap2

smmap2

JSON →
library3.0.1pypypi✓ verified 27d ago

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.

pip install smmap2
INSTALL
IMPORT
SIG · SMMAP2
S
smmap2
datapythonv3.0.1
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SlidingWindowMap
✓ from smmap import SlidingWindowMap
✗ from smmap2 import SlidingWindowMap
Despite the package being named `smmap2` on PyPI, the Python import path for its modules is `smmap`.

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`.

import os import mmap import tempfile from smmap import SlidingWindowMap # Create a dummy file for memory mapping data_to_map = b"This is some test data that will be memory-mapped." * 10 # make it a bit larger file_size = len(data_to_map) # Use tempfile to create a temporary file with tempfile.NamedTemporaryFile(delete=False) as tmp_file: tmp_file.write(data_to_map) tmp_file_path = tmp_file.name try: # Open the file for reading with open(tmp_file_path, "rb") as f: # Create an mmap object for the file m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) # Create a SlidingWindowMap instance # For this example, we'll map the entire file into a single window window_size = file_size s = SlidingWindowMap(m, begin=0, size=file_size, window_size=window_size) # Access data through the sliding window map read_data = s[0:file_size] print(f"Read data length: {len(read_data)}") print(f"First 50 bytes: {read_data[:50].decode()}") assert read_data == data_to_map print("Data successfully read and verified.") s.close() m.close() finally: # Clean up the temporary file if os.path.exists(tmp_file_path): os.remove(tmp_file_path)
Debug
Known issues
gotchaThe PyPI package is named `smmap2`, but the Python import statement uses `from smmap import ...`. Attempting `from smmap2 import ...` will result in an `ImportError`.
fix
Always use `from smmap import ...` for importing modules and classes from the `smmap2` package.
affects: 3.0.1
gotchaThe `smmap2` package (v3.0.1) is an older, specific version of the `smmap` library. It does not track the latest developments of the upstream `smmap` project (which is currently at v5.x.x at `gitpython-developers/smmap`). Users expecting the latest `smmap` features or fixes will be disappointed.
fix
If you need the latest `smmap` functionality or broad Python compatibility, install `smmap` directly via `pip install smmap`. Be aware of potential API differences between v3.x and v5.x.
affects: 3.0.1
deprecatedThe `smmap2` package (v3.0.1) specifies very old Python compatibility requirements (`>=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*`). While it might still run on modern Python versions (3.6+), it is not actively tested or guaranteed to be fully compatible. For modern Python applications, the newer `smmap` v5.x.x is recommended.
fix
For new projects or modern Python environments, prefer `pip install smmap`. If you must use `smmap2`, thoroughly test its compatibility with your specific Python version.
affects: 3.0.1
gotchaThis package is primarily intended as an internal dependency for specific versions of `GitPython` and similar projects. It is not typically designed for direct, standalone application development, and its API documentation might be sparse or outdated.
fix
Consider if you truly need this low-level memory mapping functionality directly, or if a higher-level library that depends on `smmap` (like `GitPython`) would be more appropriate for your use case.
affects: 3.0.1
breakingThe `smmap` library underwent significant changes between versions 3.x (as mirrored by `smmap2`) and 5.x. Code written for `smmap` v3.0.1 will likely not be directly compatible with `smmap` v5.x.x without modification due to API changes.
fix
If migrating from `smmap2` to `smmap` (v5.x.x), review the `smmap` changelog and update your code to reflect the new API and usage patterns.
affects: 3.0.1
Upgrade
Version history
3.0.1latest on PyPI · released Feb 23, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
1
Resources
smmap2 — pip install smmap2 · libregistry