semvec/pypi-packages huggingface dataset:
django_pythonic_menu 0.0.6
Python based menu for django
License: MIT
Keywords: django menu python

Django Pythonic Menu
--

This is a simple library to help with building and working with site menu in your way.

It solves one issue: list available menu items and toggle some of them active.
Then pass it to template. With menu levels if you wish. In readable way.

Usage is following:
```python
# 1. Define the menu
class AppMenu(Menu):
    first_menu_item = MenuItem('first_route')
    another_menu_item = MenuItem('another_route', title="Some title", and_other_value_passed_to_template='Yea!')

    class SubMenu(Menu):
        subitem = MenuItem('subitem_route')

        class Meta:
            visibility = lambda request, item: request.user.is_authenticated
            other_view_data = 'goes here'

# 2. Then activate it:
@AppMenu.first_menu_item.activate
def my_view(request):
    pass
```

```html
# 3. Then render it in view as you like it:
{% load pythonic_menu %}
{% render_menu 'path.to.AppMenu' menu %}

{% for item in menu.items %}
<a href="{{ item.url }}" {% if item.active %}class="active"{% endif %}>{{ item.title }}
{{ item.and_other_value_passed_to_template }}</a>
{% endfor %}
```
Extra abilities:
==
* Submenus (just define another Menu inside Menu).
* Visibility checking (provide `visibility=lambda request, item: request.user.is_staff` argument).
* Ability to provide callbacks for urls (just pass `callback(request, item)`).
* Ability to cache & validate routes (call `Menu.cache_routes()` in your `App.ready()` method.

Goals
==
Main goals are:
* This is static menu written in Python. So no models/DB.
* Simple way to be mark active items. Just add decorator to your views. Also it's bound to menu definition so existence of items is checked on app start.
* No restrictions on view: you have {url: , title: , active: ) from library. Everything other is yours: add icon=.., className=.. etc as you like.
* Rendering menu is project-specific so it's your responsibility to make template for it.

Feedback
==
If you have any ideas/questions post either issue or pull request.

If you use it and found useful then write me a message or make a pull request to change alter this page.
cubemx2cmake 1.2
Command line tool to generate CMakeLists.txt from STM32CubeMX projects.
License: MIT
Keywords: st stm32 cube cubemx stm32cubemx cmake code generator

=================
STM32CubeMX2CMake
=================

Installation
------------
From this repository:

*git clone https://github.com/eugene-babichenko/cubemx2cmake.git*

*cd cubemx2cmake*

*pip install .*

Or you can install it from PyPI:

*pip install cubemx2cmake*

Usage
-----

Generate your initialization code from STM32CubeMX with the following Code Generation Options:

* Toolchain: SW4STM32
* [X] Generate under root

Then open your project directory and run *cubemx2cmake <your_cube_mx_file>.ioc*. If your working directory contains only one CubeMX project file (*.ioc), you can simply run *cubemx2cmake* and it will find your project file automatically. This will generate CMakeLists.txt, STM32Toolchain.cmake, openocd_debug.cfg and openocd_flash.cfg files.

To get all the things done right use *-DCMAKE_TOOLCHAIN_FILE=STM32Toolchain.cmake* command line option with CMake.

CMakeLists contains the separate target called *flash*, which compiles your code and then flashes it to the target processor with OpenOCD. By default stlink-v2 is specified as the debugging interface. You can specify any other interface with *--interface* command line option. You can also specify flash memory start address with *--memory_start* option (0x08000000 by default). Telnet and GDB ports can be changed with *--telnet-port* and *--gdb-port* (4444 and 3333 are the defaults).

This scripts also generates a bunch of shell script files:
* openocd_flash.sh - flashes the target MCU;
* openocd_debug.sh - open debugging port for the target MCU;
* gdb.sh - connect to the target MCU after openocd_debug.sh was started.
keyfree 1.0.0
An authentication proxy for Amazon Elasticsearch Service
License: MIT

keyfree - An authentication proxy for Amazon Elasticsearch Service
==================================================================

Keyfree automatically discovers your access keys using Python's boto3.
If the environment you are running keyfree in has already been
configured for boto3 then you are good to go!

Recommeded configuration is to run keyfree on an EC2 instance, with an
instance role profile that grants at least the ``es:ESHttpGet``
permission, in which case keyfree will automatically discover your role
credentials.

Installing
----------

keyfree is available on pypi:

::

    pip install keyfree

or on the docker hub:

::

    docker pull nickrw/keyfree

Configuring
-----------

When you run keyfree it will use boto to discover AWS access credentials
and region configuration. The easiest way to create a configuration file
which boto will discover is by using awscli's "aws configure" command,
and entering the information when prompted.

::

    pip install awscli
    aws configure

Alternatively, you can configure everything through environment
variables

::

    export AWS_ACCESS_KEY_ID=...
    export AWS_SECRET_ACCESS_KEY=...
    export AWS_DEFAULT_REGION=eu-west-1

Running
-------

The keyfree python package includes a bin script which will launch a
werkzeug server for testing purposes. If you run it in production you
should use a production-ready web server such as gunicorn. The docker
image does this for you, but you can do it yourself by pointing a WSGI
server at ``keyfree.proxy:app``

::

    keyfree-proxy-test --endpoint <your endpoint uri>

Or using docker

::

    # Only the region and endpoint are required if you are running on an EC2
    # instance which has role-based access to your ES domain.
    docker run -ti --rm \
      -e AWS_ACCESS_KEY_ID=your_access_key \
      -e AWS_SECRET_ACCESS_KEY=your_secret_key \
      -e AWS_DEFAULT_REGION=your_region \
      -e ENDPOINT=your_endpoint_url \
      -p 9200:9200 \
      nickrw/keyfree
django-language-field 0.0.3
A pluggable django app that provides a comprehensive language choices field
License: MIT
Keywords: django,language,languages,field

========================
django-language-field
========================

Language Field for Django apps. Includes all language choices from the IANA Language Subtag Registry.

Included is:

* ``LanguageField``, a model field
* ``LanguageField``, a form field (Not yet implemented)
* ``regenerate.py``, a script to parse the latest language list from IANA

Installation
============

::

    pip install django-language-field


Basic usage
===========

Add ``languages`` to the list of the installed apps in
your ``settings.py`` file::

    INSTALLED_APPS = [
        ...
        'languages',
        ...
    ]

Then, you can use it like any regular model field::

    from languages.fields import LanguageField

    class MyModel(models.Model):
        ..
        language = LanguageField()
        ..

Internally, LanguageField is based upon ``CharField`` and by default
represents the as a string.

As with ``CharField``'s, it is discouraged to use ``null=True`` use ``blank=True`` if you want to make it a non-required field.
dyeprint 1.0.5
Python package for color-print on terminal.
License: MIT

colorprint
=====
A Python package for color-print on terminal.

Example
-------
```python
>> import dyeprint as dp
>> foo = dp.ColorSheet('red', 'yellow', 'bold')
>> print(foo.dye('hello world'))
```
![](./pic/dyeprint.gif)


Installing
--------
```sh
[sudo] pip install dyeprint
```