semvec/pypi-packages huggingface dataset:
Flask-MultiMQTT 0.3
Flask middleware for MQTT with threading support
License: MIT

# Flask-MultiMQTT

This is a piece of Flask middleware inspired by Flask-MQTT. It adds thread handling code so MQTT can safely
be used inside a multithreading uwsgi container. The MQTT connection is limited to running in the first
thread that calls `connect()` and other threads can still publish messages.

This extension also supports setting a global topic prefix that abstracts away a common prefix when using a
shared mosquitto server. To make dealing with permissions easier there is also helper functions for the
dynsec plugin that's included in Mosquitto 2.0

## Example

Connection configuration is done exactly in the way you'd expect from Flask:

```python
from flask import Flask
from flask_multimqtt import MultiMQTT

app = Flask(__name__)
# Specify the connection with an URI
app.config['MQTT_URI'] = 'mqtt://username:password@127.0.0.1/myprefix'

# or with the equivalent seperate fields
app.config['MQTT_HOST'] = '127.0.0.1'
app.config['MQTT_USERNAME'] = 'username'
app.config['MQTT_PASSWORD'] = 'password'
app.config['MQTT_PREFIX'] = 'myprefix'

mqtt = MultiMQTT(app)
```

TLS is supported when specifying an `mqtts://` uri.

Subscribing to topics can be done in multiple ways. This extension will keep track of all the requested
subscriptions and will delay executing them until the connection is complete so it's safe to register them
early

```python
# Subscribe to a topic and link some functions to it
topic = mqtt.register_topic('home/sensor/#', qos=0)
topic.on_message(this_function_receives_messages)
topic.on_message(this_function_is_also_called)


# Use the decorator
@mqtt.topic('my_topic/#')
def my_topic(client, message):
    # The topic decorator is equivalent to running mqtt.register_topic and hooking up the function
    print('my_topic', message.topic, message.payload)


@mqtt.topic('number/<int:number>')
def number_topic(client, message, number):
    # topic routes support the int, float, str, path and uuid placeholders
    print(f"The number is {number}")
```

Publishing messages can be done with the `MultiMQTT.publish()` method. This can be done from any thread.

```python
# Publishing a message works from any thread
mqtt.publish('my-thread', thread.name)

# If the payload is a list or dict it will automatically be jsonified
mqtt.publish('example', {
    'hello': 'world'
})

# Messages can be sent to a topic without the global prefix, for system topics
mqtt.publish('$CONTROL/something', {'example': True}, no_prefix=True)
```

To get a topic path for a subscribed topic there is the `topic_for(name, absolute=False, **kwargs)` function.

```python
@mqtt.topic('number/<int:number>')
def number_topic(client, message, number):
    # topic routes support the int, float, str, path and uuid placeholders
    print(f"The number is {number}")

    
@app.route('/demo')
def demo():
    # This returns number/42
    return mqtt.topic_for('number_topic', number=42)
```

With `absolute=True` the returned topic includes the global topic prefix, this can be used for sending topics
to external services that connect to the MQTT server.
crypton-tool 1.0.0
Crypton Tool simple way to cryptography files and content
License: MIT
Requires Python: >=3.10,<4.0

# Crypton Tool

Crypton Tool é baseado no pacote <a href="https://cryptography.io/" target="_blank">cryptography.io</a> e tem por objetivo disponibilizar métodos para cryptar arquivos e conteúdos, além de disponibilizar comandos CLI. 

**Documentação:** <a href="https://msbar.github.io/crypton-tool" target="_blank">https://msbar.github.io/crypton-tool</a>

**Source code:** <a href="https://github.com/msbar/crypton-tool" target="_blank">https://github.com/msbar/crypton-tool</a>

## Instalação:

```
pip install crypton-tool
```

## Exemplos:

### Criptando um arquivo ou arquivos em uma pasta.
```Python linenums="1"
from crypton_tool.crypton import Crypton

Crypton.generate_key(to_file='seu/caminho')
token = Crypton.read_token_file("seu/caminho/token.crypton")
```

### Criptando um arquivo ou arquivos em uma pasta.
```Python linenums="1"
crypt.encrypt_file('caminho/para/arquivo_ou_pasta')
```

### Decriptando um arquivo ou arquivos em uma pasta.
```Python linenums="1"
crypt.decrypt_file('caminho/para/arquivo_ou_pasta')
```
YaDiskClient 1.0.1
Clent for Yandex.Disk
License: MIT
Keywords: Yandex.Disk,webdav,client,python,Yandex

YaDiskClient
============

.. image:: https://github.com/TyVik/YaDiskClient/actions/workflows/test.yaml/badge.svg?branch=master
    :target: https://github.com/TyVik/YaDiskClient/actions/workflows/test.yaml?branch=master
.. image:: https://coveralls.io/repos/github/TyVik/YaDiskClient/badge.svg?branch=master
    :target: https://coveralls.io/github/TyVik/YaDiskClient?branch=master
.. image:: https://img.shields.io/pypi/pyversions/YaDiskClient.svg
    :target: https://pypi.python.org/pypi/YaDiskClient/
.. image:: https://img.shields.io/pypi/v/YaDiskClient.svg
    :target: https://pypi.python.org/pypi/YaDiskClient/
.. image:: https://img.shields.io/pypi/status/YaDiskClient.svg
    :target: https://pypi.python.org/pypi/YaDiskClient/
.. image:: https://img.shields.io/pypi/l/YaDiskClient.svg
    :target: https://pypi.python.org/pypi/YaDiskClient/

Client for Yandex.Disk based on WebDav.

Install
=======

    pip install YaDiskClient

Source code
===========

    `github <https://github.com/TyVik/YaDiskClient>`_

    `explanatory article <https://tyvik.ru/posts/yandex-disk-python/>`_

Passwords and tokens
====================

You must use application password, not account password! Details - https://yandex.ru/support/id/authorization/app-passwords.html

Also, you can create OAuth-token for your application. Details - https://yandex.ru/dev/disk/doc/dg/concepts/quickstart.html

Both methods are supported. You should use method `set_login` or `set_token` before start.

Using API
=========

::

    from YaDiskClient.YaDiskClient import YaDisk
    disk = YaDisk()
    disk.set_auth(login, password)

    """
    Library also supports token authorization via:
    disk.set_token(token)
    """

    disk.df() # show used and available space

    disk.ls(path) # list of files/folder with attributes
    disk.mkdir(path) # create directory

    disk.rm(path) # remove file or directory
    disk.cp(src, dst) # copy from src to dst
    disk.mv(src, dst) # move from src to dst

    disk.upload(src, dst) # upload local file src to remote file dst
    disk.download(src, dst) # download remote file src to local file dst

    disk.publish_doc(path) # return public url
    disk.hide_doc(path) # remove public url form Yandex Disk

Tests
=====

For run tests:
    1. Set Yandex username and password in file tests/test_YaDiskClient.py
    2. python -m unittest discover -s tests -t tests