semvec/pypi-packages huggingface dataset:
wampproto 0.4.0
https://github.com/xconnio/wampproto-python
Requires Python: >=3.10

# wampproto-python
Sans-IO implementation of the WAMP protocol in Python

This is a library that could be used to build a [WAMP](https://wamp-proto.org/index.html) client or server. It operates
on strings and bytes. A WAMP client can be split into two parts.

* Session establishment
* Session management.

Assuming we have a websocket connection established to a WAMP server using sub protocol `wamp.2.json`. The first
"message" is going to be sent by the client as HELLO
```python
from wampproto.joiner import Joiner

j = Joiner("realm1")
# this doesn't actually send the message, it just returns the
# payload that needs to be sent over websocket.
hello = j.send_hello()

ws.send_str(hello)
response = ws.receive_str()

to_send = j.receive(response)
if to_send is None:
    # if there is nothing to send, this means
    # the server returned WELCOME.
    print(j.get_session_details())
```

Now that the session is established, we could instantiate a `WAMPSession` instance
to handle further messages.
```python
from wampproto.session import WAMPSession
from wampproto.messages import Call
from wampproto.idgen import SessionScopeIDGenerator

session = WAMPSession()
idgen = SessionScopeIDGenerator()

call = Call(idgen.next(), "foo.bar")
to_send = session.send_message(call)

ws.send_str(to_send)

incoming_payload = ws.receive_str()
result = session.receive(incoming_payload)
print(result)
```
gsffile 0.5.4
Read and write Gwyddion Simple Field files
Requires Python: >=3.10
Keywords: Gwyddion, Gwyddion Simple Field, gsf

# Read and write Gwyddion Simple Field files

[![pypi](https://img.shields.io/pypi/v/gsffile)](https://pypi.org/project/gsffile/)
[![conda-forge](https://img.shields.io/conda/vn/conda-forge/gsffile)](https://anaconda.org/conda-forge/gsffile)
[![pypi downloads](https://img.shields.io/pypi/dm/gsffile)](https://pypistats.org/packages/gsffile)
[![license](https://img.shields.io/github/license/angelo-peronio/gsffile?color=4CC71E)](https://github.com/angelo-peronio/gsffile/blob/master/LICENSE)
[![python](https://img.shields.io/pypi/pyversions/gsffile)](https://pypi.org/project/gsffile/)
[![ci](https://github.com/angelo-peronio/gsffile/actions/workflows/ci.yaml/badge.svg)](https://github.com/angelo-peronio/gsffile/actions/workflows/ci.yaml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/angelo-peronio/gsffile/master.svg)](https://results.pre-commit.ci/latest/github/angelo-peronio/gsffile/master)
[![codecov](https://codecov.io/github/angelo-peronio/gsffile/graph/badge.svg)](https://codecov.io/github/angelo-peronio/gsffile)
[![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json)](https://docs.astral.sh/ruff/)
[![DOI](https://zenodo.org/badge/821387178.svg)](https://doi.org/10.5281/zenodo.16998022)

`gsffile` is a Python module to:

* read image and metadata from [Gwyddion Simple Field](http://gwyddion.net/documentation/user-guide-en/gsf.html) (.gsf) files, and
* store NumPy arrays in Gwyddion Simple Field files.

It features type annotations, minimal logging, and an overgrown test suite.

## Setup

Install with `pip`

```bash
python -m pip install gsffile
```

or with `conda`

```bash
conda install gsffile
```

## Quickstart

```python
>>> from gsffile import read_gsf, write_gsf
>>> import numpy as np

# The Gwyddion Simple Field format supports only 32-bit floating point data.
>>> data = np.eye(100, dtype=np.float32)

# Optional metadata.
>>> metadata = {
...    "XReal": 5e-05,
...    "YReal": 5e-05,
...    "XYUnits": "m",
...    "ZUnits": "V",
...    "CustomKey": 33,
...    }

>>> write_gsf("example.gsf", data, metadata)

>>> data, metadata = read_gsf("example.gsf")

```

## Documentation

`gsffile` is documented via docstrings:

```bash
python -c "import gsffile; help(gsffile)"
```

## How to cite

Cite `gsffile` in your published work using the version-specific metadata in [`CITATION.cff`](CITATION.cff), or this general BibTeX entry:

```bibtex
@misc{Dri_gsffile_2024,
title = {gsffile},
author = {Dri, Carlo and Peronio, Angelo},
url = {https://github.com/angelo-peronio/gsffile},
doi = {10.5281/zenodo.16998022},
year = {2024},
month = {7}
}

```

Specific DOIs for each released version are listed on [Zenodo](https://doi.org/10.5281/zenodo.16998022), but are not included in `CITATION.cff`
due to a [limitation](https://github.com/zenodo/zenodo-rdm/issues/831) of Zenodo itself.