semvec/pypi-packages huggingface dataset:
napari-mri 0.1.0
A simple plugin to use with napari for 3D-viewing of                  Magnetic Resonance Imaging file formats
Requires Python: >=3.7

# napari-mri

[![License](https://img.shields.io/pypi/l/napari-mri.svg?color=green)](https://github.com/sahas111/napari-mri/raw/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-mri.svg?color=green)](https://pypi.org/project/napari-mri)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-mri.svg?color=green)](https://python.org)
[![tests](https://github.com/sahas111/napari-mri/workflows/tests/badge.svg)](https://github.com/sahas111/napari-mri/actions)
[![codecov](https://codecov.io/gh/sahas111/napari-mri/branch/master/graph/badge.svg)](https://codecov.io/gh/sahas111/napari-mri)

A simple plugin to use with napari for 3D-viewing of Magnetic Resonance Imaging file formats

----------------------------------

This [napari] plugin was generated with [Cookiecutter] using with [@napari]'s [cookiecutter-napari-plugin] template.

<!--
Don't miss the full getting started guide to set up your new package:
https://github.com/napari/cookiecutter-napari-plugin#getting-started

and review the napari docs for plugin developers:
https://napari.org/docs/plugins/index.html
-->

## Installation

You can install `napari-mri` via [pip]:

    pip install napari-mri

## Contributing

Contributions are very welcome. Tests can be run with [tox], please ensure
the coverage at least stays the same before you submit a pull request.

## License

Distributed under the terms of the [BSD-3] license,
"napari-mri" is free and open source software

## Issues

If you encounter any problems, please [file an issue] along with a detailed description.

[napari]: https://github.com/napari/napari
[Cookiecutter]: https://github.com/audreyr/cookiecutter
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
[file an issue]: https://github.com/sahas111/napari-mri/issues
[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
[pip]: https://pypi.org/project/pip/
[PyPI]: https://pypi.org/
socpipe 0.0.6
very simple way of inter-process communication
Requires Python: >=3.6, <4
Keywords: inter-process,multi process,communication,マルチプロセス,プロセス間通信,rpc

# overview
`soctype` provides very simple ways of inter-process communication.  
This only uses `socket`,`json`, and `threading` internally, which are standard modules.  
# installation
`pip install socpipe` or `pip3 install socpipe`  
# usage
First, please define some functions like below:  
```
# in process1

def add(a,b):
  return a+b
```
Then, please create `ApiServer` instance and make your APIs visible to other processes.  
```
# in process1

from socpipe import *
api=ApiServer(apis=[add])
api.publish(port=50007)

while True:
  pass
```
where `port` is the port number that will be used by `socket` internally, and you can set whatever number you like.  
After `api.publish` is executed, a new thread will be generated and wait for connections.  
So you need to prevent process1 from exiting by `while True` or setting `run_forever` parameter of `publish` True.  

Let's move on to process2.  
All you have to do is to connect process1 by creating `ApiClient` instance.
```
# in process2

from socpipe import *
api=ApiCient(port=50007)
print(api.add(1,2))
# 3 will be displayed
```
By the way, `publish` and `ApiClient` also has a parameter `host`, so you can communicate with remote hosts by setting this parameter.  
I haven't tested this function, though.
# 概要
`socpipe`はプロセス間通信のための大変シンプルな関数を提供します。  
このモジュールは内部で標準モジュールである`socket`,`json`,`threading`のみを使用しています。  
# インストール
`pip install socpipe` または `pip3 install socpipe`  
# 使い方
まず、次のように適当な関数を定義して下さい。  
```
# in process1

def add(a,b):
  return a+b
```
そして、`ApiServer`インスタンスを作り、あなたのAPIを他のプロセスに公開します。  
```
# in process1

from socpipe import *
api=ApiServer(apis=[add])
api.publish(port=50007)

while True:
  pass
```
ここで、`port`は内部で`socket`によって使われるポート番号であり、好きな番号をセットして構いません。  
`api.publish`が実行されると、新しいスレッドが生成され他のプロセスからの接続を待つようになります。  
よって、process1が終了してしまわないように、`while True`を付け足すか、または`publish`の`run_forever`引数をTrueにセットする必要があります。  

process2に移りましょう。
`ApiClient`インスタンスを作ってprocess1に接続するだけです。  
```
# in process2

from socpipe import *
api=ApiCient(port=50007)
print(api.add(1,2))
# 3 will be displayed
```
ところで、`publish`と`ApiClient`は`host`という引数も持っており、これをセットすることでリモートホストと通信することが出来ます。  
ただ、この機能は未テストです。
structsock 1.2.0
A simple module to encapsulate the built-in socket with struct.pack.
Requires Python: >=3

# Structured Socket

A simple module to encapsulate the built-in socket with struct.pack so that the amount of data received can be forseen by the receiver to prevent sticking packets.

Repository: https://github.com/origamizyt/StructuredSocket
(I believe that you can understand the mechanisms without the source code.)

## Installation

This module is available on PyPI.
```
pip install structsock
```

Or you can install from source .tar.gz either.
```
python setup.py install
```

## Usage

The exposed interfaces in this module is pretty the same as the built-in module `socket`, only replacing `socket.socket` with `StructuredSocket`:
```py
# server side
from structsock import StructuredSocket

s = StructuredSocket()
s.bind(('0.0.0.0', 5000))
s.listen(5)
c, addr = s.accept()
c.send(b'data')
c.close()
s.close()
```

Note that the client socket returned is also a instance of `StructuredSocket`.
```py
# client side
from structsock import StructuredSocket

c = StructuredSocket()
c.connect(('127.0.0.1', 5000))
data = c.recv() # different, no bufsize
print(data.decode())
c.close()
```