semvec/pypi-packages huggingface dataset:
django-bot-faq 0.2.1
FAQ module
Requires Python: >=3.6

# django-bot-faq  
#### _FAQ module_  

## Installation:
```sh
pip install django-bot-faq
```

## Setting up
`YourProject/tbot/storage.py`
```python
from os import getenv

from bot_storage.storage import RedisStorage

storage = RedisStorage(
    host=getenv('REDIS_HOST', 'localhost'),
    username=getenv('REDIS_USER', None),
    password=getenv('REDIS_PASSWORD', None)
)
```
`YourProject/settings.py`
```python
# import your storage
from tbot.storage import storage

# Define your storage for user states & data
BOT_STORAGE = storage


# Add this application definition to INSTALLED_APPS
INSTALLED_APPS = [
    'mptt',
    'django_cleanup',
    'faq.faq_admin',
    'django.contrib.postgres',
    ...
]


# Specify the ELASTICSEARCH host if you want use ElasticSearch, otherwise 
# the search will be done by default using PostgreSQL TrigramSimilarity
ELASTICSEARCH = getenv('ELASTIC_DB', 'http://localhost:9200')
```

## Install and run Redis
More information about installing and running Redis on your system on [this page](https://redis.io/topics/quickstart).

## Install and run ElasticSearch
More information about installing and running ElasticSearch on your system on [this page](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html).

## Create and apply migrations
```sh
python manage.py makemigrations faq_admin tbot_base
python manage.py migrate
```

## Usage
### Handlers
`YourProject/tbot/handlers.py`

```python
from telebot import types
from telebot.apihelper import ApiTelegramException

from tbot_base.bot import tbot  # install faq_tbot-base lib or make your own faq_tbot instance
from faq.faq_tbot.dispatcher import FAQDispatcher

from .storage import storage as st  # your storage for users data

dp = FAQDispatcher(tbot=tbot, storage=st)


@tbot.message_handler(func=lambda msg: msg.text in (dp.FAQ_BTN.text, '/start'))
def send_faq(msg: types.Message):
    dp.send_faq(user_id=msg.from_user.id)


@tbot.message_handler(
    func=lambda msg: st.get_user_state(msg.from_user.id) == 'faq_search#'
)
def send_faq_search(msg: types.Message):
    dp.send_faq_search(user_id=msg.from_user.id, text=msg.text)


@tbot.callback_query_handler(func=lambda call: True)
def callback_inline(call: types.CallbackQuery):
    key, article_id = call.data.split('#')

    if key == 'tree_article':
        dp.send_faq(user_id=call.from_user.id, article_id=article_id)

    elif key == 'show_article':
        dp.send_article(user_id=call.from_user.id, article_id=article_id)

    elif key == 'faq_search':
        dp.send_faq_search(user_id=call.from_user.id)

    # remove the "clock" on the inline button
    try:
        tbot.answer_callback_query(callback_query_id=call.id, text='')
    except ApiTelegramException:
        pass
```
heapy 0.7
A priority queue built with an in-place modifiable binary heap
Keywords: heap,priority queue,decrease-key,increase-key,dijkstra,rolling median,remove

An priority queue built with an in-place modifiable binary heap (decrease-key,increase-key).

Operations have the following algorithmic complexities:

* `pop` - `O(log(n))`
* `push` - `O(log(n))` (average: `O(1)`)
* `peek` - `O(1)`
* `remove` - `O(log(n))`

Useful for:

* Dijkstra's shortest path algorithm
* A*
* Rolling median

## Install
`pip install heapy`

## Examples
The following is an example implementation of Dijkstra's algorithm, a method
for finding the shortest path in a weighted graph. The heap-based
priority queue reduces the complexity of the basic algorithm from `O(n^2)`
to `O(m*log(n))`, for `n` nodes and `m` edges.


```python
from heapy import pqueue

def dijkstra(G, r):
	'''
	Find the shortest paths from a given node in a weighted graph
	to every other (connected) node.
	'''

    todo = pqueue() # this is the heap-based priority queue

    distance = {} # distances to all nodes on shortest paths
    parents = { r: None } # parent pointers for all items on known shortest paths

    todo.push((r, 0)) # alternate syntax: todo[r] = 0

    while todo: # automatically checks len(todo) > 0
        (n, d) = todo.pop() # get the minimum element; O(log(n))

        distance[n] = d # save shortest distance

        # update position of children in priority queue, if less
        children = G.get(n, {})
        for (c, w) in children.items():
            if c not in distance and (c not in todo or d + w < todo[c]):

                todo[c] = d + w # add or update distance ~ O(1)
                parents[c] = n # update parent in minimum path distance spanning tree

    return distance
```

Note that `G` is a dictionary of dictionaries.
```python
	{
		'a' : {'b' : 2, 'c' : 1},
		'b' : {'a' : 2, 'd' : 3},
		'c' : {'a' : 1},
		'd' : {'b' : 3}
	}
```
mineid 0.0.1
A small Python library for getting Minecraft UUIDs.

# mineid

MineID is an easy-to-use Minecraft UUID (universally unique identifier) module written in Python.

## Installing

To install mineid, you need to have a distribution of Python 3.6 or higher.

To install the library, you can install it from PyPi
```shell
pip install mineid
```
or you can install from source
```shell
pip install git+https://github.com/SomeHybrid/mineid
```

## Quickstart
```py
import mineid

player = mineid.Player("SomeHybrid")
print(player.uuid)
print(player.username)
```