semvec/pypi-packages huggingface dataset:
rtmidi2 1.4.1
Python wrapper for RtMidi written in Cython. Allows sending raw messages, multi-port input and sending multiple messages in one call.
License: MIT
Requires Python: >=3.8

=======
rtmidi2
=======

|sh-downloads|

.. |sh-downloads| image:: https://static.pepy.tech/badge/rtmidi2


Python wrapper for RtMidi_, the lightweight, cross-platform MIDI I/O library. For Linux, Mac OS X and Windows.

Based on rtmidi-python, uses rtmidi version 6.0

Installation
------------

    pip install rtmidi2

    
This module is compatible with Python 3 >= 3.9 

Documentation
-------------

https://rtmidi2.readthedocs.io


-----


Usage Examples
--------------

`rtmidi2` uses a very similar API as RtMidi

Print all in and out ports
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

   import rtmidi2
   print(rtmidi2.get_in_ports())
   print(rtmidi2.get_out_ports())


Send messages
~~~~~~~~~~~~~

.. code-block:: python

   import rtmidi2
  
   midi_out = rtmidi2.MidiOut()
   # open the first available port
   midi_out.open_port(0) 
   # send C3 with vel. 100 on channel 1
   midi_out.send_noteon(0, 48, 100)



Get incoming messages - blocking interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

    import time
    midi_in = rtmidi.MidiIn()
    midi_in.open_port(0)

    while True:
        message = midi_in.get_message()
        if message:
            print(message, delta_time)
        else:
            time.sleep(0.01)


Get incoming messages using a callback -- non blocking
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

    def callback(message, time_stamp):
        print(message, time_stamp)

    midi_in = rtmidi2.MidiIn()
    midi_in.callback = callback
    midi_in.open_port(0)


Open multiple ports at once
~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
.. code-block:: python

    # get messages from all available ports
    midi_in = MidiInMulti()
    midi_in.open_ports("*")

    def callback(msg, timestamp):
        msgtype, channel = splitchannel(msg[0])
        print(msgtype2str(msgtype), msg[1], msg[2])

    midi_in.callback = callback


You can also get the device which generated the event by changing your callback to:

.. code-block:: python

    def callback(src, msg, timestamp):
        # src will hold the name of the device
        print("got message from", src)

               
Send multiple notes at once
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

    # send a cluster of ALL notes with a duration of 1 second
    midi_out = MidiOut()
    midi_out.open_port()
    notes = range(127)
    velocities = [90] * len(notes)
    midi_out.send_noteon_many(0, notes, velocities)
    time.sleep(1)
    midi_out.send_noteon_many(0, notes, [0] * len(notes))


----


License
-------

`rtmidi2` is licensed under the MIT License, see `LICENSE`.

It uses RtMidi, licensed under a modified MIT License, see `RtMidi/RtMidi.h`.


.. _RtMidi: http://www.music.mcgill.ca/~gary/rtmidi/
.. _Cython: http://www.cython.org
fLZc 0.1.5
Python wrapper for fLZc complexity measure (based on https://github.com/lcbarnett/fLZc)
License: MIT
Requires Python: >=3.8

# fLZc_python — Fast Lempel–Ziv Complexity for Python

A Python wrapper around the [fLZc C library](https://github.com/lcbarnett/fLZc), implementing the original LZ76c<sup>1</sup> and LZ78c<sup>2</sup> versions of complexity measures (with optional normalisation) in optimized C, exposed via a clean Python API.

## Features

- **LZ76c & LZ78c**: exact implementations of the original Lempel–Ziv algorithms  
- **Running complexity**: compute the complexity profile along a sequence  
- **Dictionary output**: retrieve the phrase dictionary used by the algorithm  
- **Normalisation**: theoretical or empirical scaling factors (as in the original fLZc)  
- **Pure-Python API** built on C for maximum speed (via ctypes)  
- **Works out-of-the-box** on macOS & Linux; Windows support untested  



## Installation (Development Mode)

This project uses scikit-build-core + CMake under PEP 517.

### Prerequisites

- Python 3.8–3.13  
- pip, a C99-compatible compiler, and CMake ≥ 3.15  
- macOS or Linux (Windows support not yet tested)  

### Step by step

Clone and install in editable mode:

```bash
git clone https://github.com/romybeaute/fLZc_python.git
cd fLZc_python
python -m venv .flzcvenv
source .flzcvenv/bin/activate

# clean previous builds (optional)
rm -rf build/ dist/ _skbuild/ fLZc_python/liblzc.*

# install in editable mode (builds & places the shared library)
pip install -e .
```


### Examples & Testing
- Demo:\\
fLZc_python/examples/lzc_demo.py provides an end-to-end example (including plotting).

- Unit tests:\\
Run pytest tests/ to verify correctness on canonical sequences.



### Implementation Details
- **LZ76c** follows the algorithm of Kaspar & Schuster <sup>1</sup>, with optional dictionary retrieval and running-profile support.  
- **LZ78c** leverages the khashl hash-map for linear-time parsing and also supports dictionary & running outputs.  
- **Normalisation** factors are precomputed (via MATLAB data) for alphabets up to size 10; see the original MATLAB repo for details.


### Acknowledgements
Wraps the original **fLZc** library by Lionel Barnett (University of Sussex).



## License

Distributed under the MIT License. See `LICENSE` for details.



## References
1. A. Lempel & J. Ziv, “On the Complexity of Finite Sequences,” _IEEE Trans. Inf. Theory_ 22(1), 1976.  
2. A. Lempel & J. Ziv, “Compression of Individual Sequences via Variable-Rate Coding,” _IEEE Trans. Inf. Theory_ 24(5), 1978.  
3. F. Kaspar & H. G. Schuster, “Easily Calculable Measure for the Complexity of Spatiotemporal Patterns,” _Phys. Rev. A_ 36(2), 1987.
authors 0.5
Authors of your next scientific article
License: MIT
Requires Python: >=3.8
Keywords: science, journals, authors, astronomy

<div align="center">

<img src="https://raw.githubusercontent.com/j-faria/authors/master/authors/crowd.png" alt="crowd of authors" width="400">

 ## the [list](https://github.com/j-faria/authors/blob/main/authors/data/all_known_authors.yml) of known authors is **public!**

</div>

### Installation

```
pip install authors
```


### Simple use

```python
>>> from authors import Authors
>>> Authors('list.txt').AandA()
```
```
\author{
  J.~P.~Faria \inst{\ref{geneva}} \orcidlink{0000-0002-6728-244X}
}

\institute{
  Observatoire Astronomique de l'Université de Genève, Chemin Pegasi 51b, 1290 Versoix, Switzerland \label{geneva}
}
```