Metadata-Version: 2.4
Name: frozen-odict
Version: 0.1.0a0
Summary: An immutable, hashable, and ordered mapping.
Author-email: Jifeng Wu <jifengwu2k@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/jifengwu2k/frozen-odict
Project-URL: Bug Tracker, https://github.com/jifengwu2k/frozen-odict/issues
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=2
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing; python_version < "3.5"
Dynamic: license-file

# `frozen-odict`

An immutable, hashable, and ordered mapping.

`FrozenOdict` behaves similarly to an `OrderedDict` but is immutable and hashable, making it suitable for use as dictionary keys or set members.

## Installation

```bash
pip install frozen-odict
```

## Usage

```python
from frozen_odict import FrozenOdict

# Create from a mapping
fod1 = FrozenOdict({'a': 1, 'b': 2})

# Create from sequence of pairs
fod2 = FrozenOdict([('x', 100), ('y', 200)])

# Create with keyword arguments
fod3 = FrozenOdict({'foo': 42}, bar=43)

# Hashable and set-usable
s = {fod1, fod2}
if fod1 in s:
    print("Found!")

# Works as dictionary keys!
d = {fod1: "first", fod2: "second"}

print(fod1)  # FrozenOdict([('a', 1), ('b', 2)])
```

## Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

## License

This project is licensed under the [MIT License](LICENSE).
