semvec/pypi-packages huggingface dataset:
Rest-Framework-Auth-Toolkit 0.14
Simple + flexible signup and login for Django APIs
Requires Python: >= 3.11

```
                     __                   __  __         __              ____   _ __
     ________  _____/ /_     ____ ___  __/ /_/ /_       / /_____  ____  / / /__(_) /_
    / ___/ _ \/ ___/ __/ ___/ __ `/ / / / __/ __ \  ___/ __/ __ \/ __ \/ / //_/ / __/
   / /  /  __(__  ) /_  /__/ /_/ / /_/ / /_/ / / / /__/ /_/ /_/ / /_/ / / ,< / / /_
  /_/   \___/____/\__/     \__,_/\__,_/\__/_/ /_/     \__/\____/\____/_/_/|_/_/\__/

```

This libary provides mixins and views to handle signup, login and
logout in an API built with django-rest-framework.  After login,
client applications get a token for the API requests.

Email-based signups are supported out of the box.
Other methods require you to specify an extra in your requirements;
for example, to use Facebook login you need to depend on
`rest-framework-auth-toolkit[facebook]`.

Contrary to other similar modules, rest-auth-toolkit doess not provide
a set of Django apps to include and configure in your settings, but a
collection of mixins, base classes, base views and simple templates
that you can integrate and customize in your own apps.

See the [demo](demo/) app for example usage.

⚠️ This library is in beta stage, make sure to pin your dependencies.
Recommended form: `rest-framework-auth-toolkit == 0.12.*`

See the [changelog](CHANGELOG.md) for breaking changes.


## Contributing

To run tests:

```
export DATABASE_URL=postgres://ratk:ktar@localhost:5432/ratk
tox
```

You will have to create the `ratk` role first, for example using psql:

```
create role ratk login createdb;
alter role rath with password encrypted 'ktar';
```
nomad-camels-driver-cam-control-pylablib 0.1.4
This packes allows you to communicate with Cam-Control by pylablibs.
Requires Python: >=3.9.6

# NOMAD-CAMELS Driver for PyLabLibs Cam-Control 

Connects to the server of Cam-Control to save, snap and request frames. Written for the measurement software [NOMAD-CAMELS](https://fau-lap.github.io/NOMAD-CAMELS/).

More information on how to use it can be found [here](https://fau-lap.github.io/NOMAD-CAMELS/doc/instruments/cam_control_pylablib/cam_control_pylablib.html)

## Changelog

### 0.1.4

- Improved frame acquisition. Increased speed and made it more stable.

### 0.1.3

- Changed `grab_background` to wait for the background to be grabbed before continuing.
- Changed `get_single_frame` and `get_background_frame` to wait for the frames to actually be available and then read them.
- Added device setting that allows you to choose if you want to overwrite the exposure time set in the GUI.

### 0.1.2

- Removed `read_wait` as it is no longer needed.
- Changed the end of the file name when using suffixes to be `time.time()` and not `datetime.date.today()`

### 0.1.1

Optimized reading of frames into python. Drastically increased reading speed.

### 0.1.0

Core functions. Not optimized.

## Documentation

The backbone of this driver is the cam-control software by [PyLabLib](https://pylablib-cam-control.readthedocs.io/). The software must be running and set up to [allow server communication](https://pylablib-cam-control.readthedocs.io/en/latest/expanding.html#control-server).
CAMELS then connects to the server and sends requests to the server. You must set up cam-control via its own GUI and you can then use CAMELS to actually save images with the exact settings from the GUI.
Currently you can set the exposure time, save snapshots locally and save continuous frames locally as well as save frames into the HDF5 files of CAMELS. You can also save the background image which is currently being subtracted. The direct saving of frames to HDF5 files is quite slow as the server takes some time to answer (about 1 second per frame even for low exposure times of < 100 ms).

For more information and documentation visit our [GitHub.io](https://fau-lap.github.io/NOMAD-CAMELS/doc/instruments/instruments.html) page.
lenvert 0.1.0
A package for converting imperial lengths and weights

# Impyrial 

A package for converting between imperial unit lengths and weights.

This package was created for the [DataCamp] (https://www.datacamp.com) course "Developing Python Packages".

### Features

- Convert lengths between miles, yards, feet and inches.
- Convert weights between hundredweight, stone, pounds and ounces.

### Usage

```
import impyrial

# Convert 500 miles to feet
impyrial.length.convert_unit(500, from_unit='yd', to_unit='ft')  # returns 1500.0

# Convert 100 ounces to pounds
impyrial.weight.convert_unit(100, from_unit='oz', to_unit='lb')  # returns 6.25
```
testax 0.2.0
Jit-able runtime assertions for jax in numpy style.

🧪 testax
=========

.. image:: https://img.shields.io/pypi/v/testax
    :target: https://pypi.org/project/testax
.. image:: https://github.com/tillahoffmann/testax/actions/workflows/build.yml/badge.svg
    :target: https://github.com/tillahoffmann/testax/actions/workflows/build.yml
.. image:: https://readthedocs.org/projects/testax/badge/?version=latest
    :target: https://testax.readthedocs.io/en/latest/?badge=latest

testax provides runtime assertions for JAX through the testing interface familiar to NumPy users.

>>> import jax
>>> from jax import numpy as jnp
>>> import testax
>>>
>>> def safe_log(x):
...     testax.assert_array_less(0, x)
...     return jnp.log(x)
>>>
>>> safe_log(jnp.arange(2))
Traceback (most recent call last):
    ...
jax._src.checkify.JaxRuntimeError:
Arrays are not less-ordered
<BLANKLINE>
Mismatched elements: 1 / 2 (50%)
Max absolute difference: 1
Max relative difference: 1
 x: Array(0, dtype=int32, weak_type=True)
 y: Array([0, 1], dtype=int32)

testax assertions are :code:`jit`-able, although errors need to be functionalized to conform to JAX's requirement that functions are pure and do not have side effects (see the :code:`checkify` `guide <https://jax.readthedocs.io/en/latest/debugging/checkify_guide.html>`__ for details). In short, a :code:`checkify`-d function returns a tuple :code:`(error, value)`. The first element is an error that *may* have occurred, and the second is the return value of the original function.

>>> jitted = jax.jit(safe_log)
>>> checkified = testax.checkify(jitted)
>>> error, y = checkified(jnp.arange(2))
>>> error.throw()
Traceback (most recent call last):
    ...
jax._src.checkify.JaxRuntimeError:
Arrays are not less-ordered
<BLANKLINE>
Mismatched elements: 1 / 2 (50%)
Max absolute difference: 1
Max relative difference: 1
 x: Array(0, dtype=int32, weak_type=True)
 y: Array([0, 1], dtype=int32)
>>> y
Array([-inf,   0.], dtype=float32)

Installation
------------

testax is pip-installable and can be installed by running

.. code-block:: bash

    pip install testax

Interface
---------

testax mirrors the `testing <https://numpy.org/doc/stable/reference/routines.testing.html>`__ interface familiar to NumPy users, such as :code:`assert_allclose`.
glanscan-sprokkel78 1.0.2
A graphical user interface in PyGTK4 for use with the nmap binary for scanning your lan and performing portscans on Ubuntu and other Linux distro's.
Requires Python: >=3.10

glanscan-sprokkel78

A graphical user interface in PyGTK4 for use with the nmap binary for scanning your lan and performing portscans on Ubuntu and other Linux distro's. 
It requires Python3.10 or higher and the PyGTK apps, it also relies on gnome-terminal for performing portscans.
Developed and tested on Ubuntu 23.10. 

Installation on Ubuntu 23.10

1. $sudo apt install python3 python3-dev python3-pip python3-venv
2. $sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0 gir1.2-adw-1
3. $sudo apt install gnome-terminal
4. $python3 ./glanscan.py

Added 'install.sh' script for system-wide installation.
- The startup shell script will be /usr/bin/glanscan
- The application is installed in /usr/share/glanscan-sprokkel78
- The .desktop file is placed in /usr/share/applications/com.sprokkel78.glanscan.desktop

Added 'uninstall.sh' script for system-wide uninstallation.
- This will delete /usr/bin/glanscan and /usr/share/glanscan-sprokkel78,
  This will also remove /usr/share/applications/com.sprokkel78.glanscan.desktop
  
Check https://www.github.com/sprokkel78/glanscan for contributing, development features and pre-releases.

Funding: Paypal email: sprokkel78.bart@gmail.com
crx-settings-override 1.0.0b0
Overrides of default Wagtail CRX settings, eg. navbars, footers, etc.
Requires Python: >=3.7

# Wagtail CRX (CodeRed) Settings Override

Overrides of default Wagtail CRX settings, eg. navbars, footers, etc.

## Quick start

1. Install the package from PyPi:
   ```
   pip install crx-settings-override
   ```
   
2. Add "crx_settings_override" to your INSTALLED_APPS setting like this::

   <pre>
   INSTALLED_APPS = [
      ...,
      <b>"crx_settings_override",</b>
   ]
   </pre>

3. Add "crx_settings_override.context_processors.navbars" and "crx_settings_override.context_processors.footers" to your TEMPLATES settings like this::

   <pre>
   TEMPLATES = [
      {
         ...,
         "OPTIONS": {
               "context_processors": [
                  ...,
                  <b>"crx_settings_override.context_processors.navbars",</b>
                  <b>"crx_settings_override.context_processors.footers"</b>
               ],
               "loaders": [...]
         },
      },
   ]
   </pre>

4. To make translations work for navbars, override navbar template of CodeRed by creating /templates/coderedcms/snippets/navbar.html and change

   ```
   {% if settings.coderedcms.LayoutSettings.site_navbar %}
      {% get_navbars as navbars %}
         {% for navbar in navbars %}
         <ul class="navbar-nav {{navbar.custom_css_class}}" {% if navbar.custom_id %}id="{{navbar.custom_id}}" {% endif %}>
            {% for item in navbar.menu_items %}
               {% include_block item with liclass="nav-item" aclass="nav-link" ga_event_category="Navbar" %}
            {% endfor %}
         </ul>
      {% endfor %}
   {% endif %}
   ```

   so it doesn't use site_navbar and get_navbars method (this is overriden by the [context_processor](https://github.com/LESPROJEKT/crx-settings-override/blob/main/crx_settings_override/context_processors.py)), eg. simply erase those lines like this

   ```
   {% for navbar in navbars %}
      <div>
         <ul class="navbar-nav flex-wrap justify-content-around">
            {% for item in navbar.menu_items %}
              {% include_block item with liclass="nav-item fs-5" aclass="nav-link" ga_event_category="Navbar" %}
            {% endfor %}
         </ul>
      </div>
   {% endfor %}
   ```

5. Run `python manage.py migrate` to create the models.

6. Start the development server and visit the admin to:

   - create localized navbars under Snippets > Translatable Navigation Bars
   - set one of the localized navbar as a site navigation in **CRX Settings Overrides**.

7. Navigation switches automatically based on current site localization.


## Development
Update semantic version of the package

Run test update without commiting
```
$ bumpver update --patch(--minor|--major) --dry
```

Run update and commit the changes to the repo
```
$ bumpver update --patch(--minor|--major)
```
colordithering 0.7
Color strings using ANSI escape codes. Uses "dithering" to attempt to match the specified RGB value as close as possible.

A package to color text with ANSI escape codes, but takes in an RGB value and uses dithering to try match it.

The colorize_text function accepts a string and a RGB tuple. It returns the colorized string.
To see the package in use you can try the run_example function.

Example usage:
```python
import colordithering

text = '''
███████████████████████████████████
██████████ Hello World! ███████████
███████████████████████████████████
'''

color = (255, 125, 0) # orange color
print(colordithering.colorize_text(text, color))

```


The `return_array` parameter of colorize_text will return a 2D array of each character rather than a string. The values in each cell will be a dict, with the keys `text` and `color`. 
Text will be the character. Color will be the ANSI escape code.

Example usage with return_array:
```python
import colordithering

text = '''
███████████████████████████████████
██████████ Hello World! ███████████
███████████████████████████████████
'''

color = (255, 125, 0) # orange color

colorized = colordithering.colorize_text(text, color, True) # set return_array to True

for y in range(len(colorized)):
    for x in range(len(colorized[y])):
        character_at_cell = colorized[y][x]["text"]
        color_at_cell = colorized[y][x]["color"]

        print(color_at_cell + character_at_cell, end="") 
        # print the ANSI escape code first to set the color, then the character.
        # the end="" makes it so python doesn't print a new line automatically
    
    print() # new line

```