<commit_before># pylibui

Python wrapper for [libui](https://github.com/andlabs/libui/).


## Some instructions

Clone pylibui:

    $ git clone https://github.com/joaoventura/pylibui

Clone libui inside pylibui:

    $ cd pylibui
    $ git clone https://github.com/andlabs/libui/

Make the libui shared library:

    $ cd pylibui/libui
    $ make

The shared library will be in pylibui/libui/out. Now you can build pylibui:

    $ cd pylibui
    $ python3 setup.py build

The pylibui shared library will be in pylibui/build/libxxx. Cd into that
directory and try to import it:

    $ cd pylibui/build/libxxx
    $ python3
    >>> import pylibui
    Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
    ImportError: dlopen(...)
        Reason: image not found

You have to explicitely say where libui's shared library is:

    $ cd pylibui/build/libxxx
    $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../libui/out/
    $ python3
    >>> import pylibui
    >>> pylibui.test()<commit_msg>Update directories in readme<commit_after># pylibui

Python wrapper for [libui](https://github.com/andlabs/libui/).


## Some instructions

Clone pylibui:

    $ git clone https://github.com/joaoventura/pylibui

Clone libui inside pylibui:

    $ cd pylibui
    $ git clone https://github.com/andlabs/libui/

Make the libui shared library:

    $ cd libui
    $ make

The shared library will be in pylibui/libui/out. Now you can build pylibui:

    $ cd ..
    $ python3 setup.py build

The pylibui shared library will be in pylibui/build/libxxx. Cd into that
directory and try to import it:

    $ cd build/libxxx
    $ python3
    >>> import pylibui
    Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
    ImportError: dlopen(...)
        Reason: image not found

You have to explicitely say where libui's shared library is:

    $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../libui/out/
    $ python3
    >>> import pylibui
    >>> pylibui.test()
{'fraction_non_alphanumeric': 0.1016016016016016, 'fraction_numerical': 0.004004004004004004, 'mean_word_length': 2.8815533980582524, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3760871', 'n_tokens_mistral': 708, 'n_tokens_neox': 656, 'n_words': 207}