mappy-python


Namemappy-python JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryPython bindings for the Reynard mappy maplet data structures
upload_time2025-10-23 11:40:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords mappy maplet data-structures python rust
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Reynard Mappy Python Bindings

Python bindings for the Reynard mappy maplet data structures, providing space-efficient approximate key-value mappings with one-sided error guarantees.

## Features

- **Space-Efficient**: Approximate key-value mappings with minimal memory overhead
- **One-Sided Error**: Guarantees that M[k] ≺ m[k] for application-specific ordering relations
- **High Performance**: Built on Rust for maximum speed and efficiency
- **Python Integration**: Seamless Python API with async support
- **Quotient Filter**: Advanced quotient filter implementation for precise slot management

## Installation

```bash
pip install reynard-mappy
```

## Quick Start

```python
import mappy_python

# Create a maplet
maplet = mappy_python.PyMaplet(capacity=1000, false_positive_rate=0.01)

# Insert data
maplet.insert("key1", 42)
maplet.insert("key2", 100)

# Query data
value = maplet.query("key1")  # Returns 42
contains = maplet.contains("key2")  # Returns True

# Get statistics
print(f"Length: {maplet.len()}")
print(f"Load factor: {maplet.load_factor()}")
print(f"Error rate: {maplet.error_rate()}")
```

## Engine Usage

```python
import mappy_python

# Create engine configuration
config = mappy_python.PyEngineConfig(
    capacity=1000,
    false_positive_rate=0.01,
    persistence_mode="memory"
)

# Create engine
engine = mappy_python.PyEngine(config)

# Set data
engine.set("key", b"value")

# Get data
value = engine.get("key")

# Cleanup
engine.close()
```

## Advanced Features

### Quotient Filter Support

The mappy-core library includes advanced quotient filter features for debugging and optimization:

- **Precise Slot Finding**: Locate exact storage slots
- **Run Detection**: Handle quotient filter runs with multiple fingerprints
- **Shifting Support**: Account for linear probing and slot shifting
- **Performance Analysis**: Understand memory access patterns

### Configuration Options

```python
config = mappy_python.PyEngineConfig(
    capacity=10000,                    # Maximum number of items
    false_positive_rate=0.001,        # Desired false positive rate
    persistence_mode="hybrid",         # Memory, disk, or hybrid
    data_dir="./data",                # Data directory for persistence
    memory_capacity=1024*1024*1024,   # Maximum memory usage (1GB)
    ttl_enabled=True,                 # Enable TTL support
    ttl_cleanup_interval_secs=60      # TTL cleanup interval
)
```

## Performance

- **Insert Performance**: 10-17 million operations/second
- **Query Performance**: 16-45 million operations/second
- **Memory Efficiency**: Linear scaling with 8 bytes/item overhead
- **Cache Performance**: Optimized for sequential access patterns

## Documentation

For detailed documentation, see:

- [API Reference](https://docs.rs/mappy-core)
- [Technical Documentation](https://github.com/entropy-tamer/mappy)
- [Research Paper](https://github.com/entropy-tamer/mappy/blob/main/RESEARCH.md)

## License

MIT License - see LICENSE file for details.

## Contributing

Contributions are welcome! Please see the main repository for contribution guidelines.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mappy-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "mappy, maplet, data-structures, python, rust",
    "author": null,
    "author_email": "Reynard Team <team@reynard.dev>",
    "download_url": "https://files.pythonhosted.org/packages/04/22/752843875aea1f28aff47dd5059a434aa94db6a85d33bfda3879ac87ddbd/mappy_python-0.2.1.tar.gz",
    "platform": null,
    "description": "# Reynard Mappy Python Bindings\n\nPython bindings for the Reynard mappy maplet data structures, providing space-efficient approximate key-value mappings with one-sided error guarantees.\n\n## Features\n\n- **Space-Efficient**: Approximate key-value mappings with minimal memory overhead\n- **One-Sided Error**: Guarantees that M[k] \u227a m[k] for application-specific ordering relations\n- **High Performance**: Built on Rust for maximum speed and efficiency\n- **Python Integration**: Seamless Python API with async support\n- **Quotient Filter**: Advanced quotient filter implementation for precise slot management\n\n## Installation\n\n```bash\npip install reynard-mappy\n```\n\n## Quick Start\n\n```python\nimport mappy_python\n\n# Create a maplet\nmaplet = mappy_python.PyMaplet(capacity=1000, false_positive_rate=0.01)\n\n# Insert data\nmaplet.insert(\"key1\", 42)\nmaplet.insert(\"key2\", 100)\n\n# Query data\nvalue = maplet.query(\"key1\")  # Returns 42\ncontains = maplet.contains(\"key2\")  # Returns True\n\n# Get statistics\nprint(f\"Length: {maplet.len()}\")\nprint(f\"Load factor: {maplet.load_factor()}\")\nprint(f\"Error rate: {maplet.error_rate()}\")\n```\n\n## Engine Usage\n\n```python\nimport mappy_python\n\n# Create engine configuration\nconfig = mappy_python.PyEngineConfig(\n    capacity=1000,\n    false_positive_rate=0.01,\n    persistence_mode=\"memory\"\n)\n\n# Create engine\nengine = mappy_python.PyEngine(config)\n\n# Set data\nengine.set(\"key\", b\"value\")\n\n# Get data\nvalue = engine.get(\"key\")\n\n# Cleanup\nengine.close()\n```\n\n## Advanced Features\n\n### Quotient Filter Support\n\nThe mappy-core library includes advanced quotient filter features for debugging and optimization:\n\n- **Precise Slot Finding**: Locate exact storage slots\n- **Run Detection**: Handle quotient filter runs with multiple fingerprints\n- **Shifting Support**: Account for linear probing and slot shifting\n- **Performance Analysis**: Understand memory access patterns\n\n### Configuration Options\n\n```python\nconfig = mappy_python.PyEngineConfig(\n    capacity=10000,                    # Maximum number of items\n    false_positive_rate=0.001,        # Desired false positive rate\n    persistence_mode=\"hybrid\",         # Memory, disk, or hybrid\n    data_dir=\"./data\",                # Data directory for persistence\n    memory_capacity=1024*1024*1024,   # Maximum memory usage (1GB)\n    ttl_enabled=True,                 # Enable TTL support\n    ttl_cleanup_interval_secs=60      # TTL cleanup interval\n)\n```\n\n## Performance\n\n- **Insert Performance**: 10-17 million operations/second\n- **Query Performance**: 16-45 million operations/second\n- **Memory Efficiency**: Linear scaling with 8 bytes/item overhead\n- **Cache Performance**: Optimized for sequential access patterns\n\n## Documentation\n\nFor detailed documentation, see:\n\n- [API Reference](https://docs.rs/mappy-core)\n- [Technical Documentation](https://github.com/entropy-tamer/mappy)\n- [Research Paper](https://github.com/entropy-tamer/mappy/blob/main/RESEARCH.md)\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please see the main repository for contribution guidelines.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python bindings for the Reynard mappy maplet data structures",
    "version": "0.2.1",
    "project_urls": null,
    "split_keywords": [
        "mappy",
        " maplet",
        " data-structures",
        " python",
        " rust"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "13462ea5178df55def835fdeb545c9729c7ec51ee0ec497ae7500d2706537c60",
                "md5": "dce41bd06a1dad0ba9fd705051db9515",
                "sha256": "0e2b04be219dc09bbc581cd9769ccbd12ad19fa38e8ce30784e4bdb6eb9f683c"
            },
            "downloads": -1,
            "filename": "mappy_python-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "dce41bd06a1dad0ba9fd705051db9515",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=3.8",
            "size": 1075057,
            "upload_time": "2025-10-23T11:40:48",
            "upload_time_iso_8601": "2025-10-23T11:40:48.544108Z",
            "url": "https://files.pythonhosted.org/packages/13/46/2ea5178df55def835fdeb545c9729c7ec51ee0ec497ae7500d2706537c60/mappy_python-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0422752843875aea1f28aff47dd5059a434aa94db6a85d33bfda3879ac87ddbd",
                "md5": "015fe78504ed07a56be1131aef308d78",
                "sha256": "1971373ca51edad28063db491ac5b51648980972c31807eb1d747c701e22d661"
            },
            "downloads": -1,
            "filename": "mappy_python-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "015fe78504ed07a56be1131aef308d78",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 81758,
            "upload_time": "2025-10-23T11:40:52",
            "upload_time_iso_8601": "2025-10-23T11:40:52.861162Z",
            "url": "https://files.pythonhosted.org/packages/04/22/752843875aea1f28aff47dd5059a434aa94db6a85d33bfda3879ac87ddbd/mappy_python-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-23 11:40:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mappy-python"
}
        
Elapsed time: 1.21994s