semvec/pypi-packages huggingface dataset:
streamlit-chat-foto 0.0.2.7
A streamlit component, to make chatbots
Requires Python: >=3.8
Keywords: chat streamlit streamlit-component

# st-chat

Streamlit Component, for a Chat-bot UI, [example app](https://share.streamlit.io/ai-yash/st-chat/main/examples/chatbot.py)

authors - [@yashppawar](https://github.com/yashppawar) & [@YashVardhan-AI](https://github.com/yashvardhan-ai)

## Installation

Install `streamlit-chat-foto` with pip
```bash
pip install streamlit-chat-foto 
```

usage, import the `message` function from `streamlit_chat_foto`
```py
import streamlit as st
from streamlit_chat_foto import message

message("My message") 
message("Hello bot!", is_user=True)  # align's the message to the right
```
   
### Screenshot

![chatbot-og](https://user-images.githubusercontent.com/90775147/210397700-5ab9e00d-a61b-4bc9-a34a-b5bd4454b084.png)
frosty-dag 0.0.2
Implementation of the FROSTY algorithm
Requires Python: >=3.6, <3.10
Keywords: bayesian network structure learning

# FROSTY

Python Package for the FROSTY algorithm by Joshua Bang and Sang-Yun Oh

Bang, J., Oh, S.-Y. (2023). FROSTY: A High-Dimensional Scale-Free Bayesian Network Learning Method. Journal of Data Science. \[[JDS](https://jds-online.org/journal/JDS/article/1329/info)\]

## Installation

Installation of `scikit-sparse` depends on `suite-sparse` library, which can be installed via:
```bash
# mac
brew install suite-sparse

# debian
sudo apt-get install libsuitesparse-dev
```

Then install FROSTY from PyPI:
```bash
pip install frosty-dag
```

## Example (scale-free graph, p=50, n=1000)

 - True and estimated graphs

![estimation](https://github.com/joshuaybang/frosty/raw/main/examples/images/frosty-estimation.png)

 - Confusion matrix

![confusion matrix](https://github.com/joshuaybang/frosty/raw/main/examples/images/confusion-matrix.png)
GPT-Funcs 1.0.0
Automatically pass your funcions defined in Python to ChatGPT have it call them back seemlessly.
Requires Python: >=3.6

# GPT-Funcs
Automatically pass your funcions defined in Python to ChatGPT have it call them back seemlessly.

You can do all that in a single line:
```python
gptfuncs.add_function_hooks("funcs.py", lambda funcs: openai_api("Say hi", funcs))
````

### Under the hood
`gptfuncs.add_function_hooks()`:
 * Loads a python file specified as the parameter and encodes the function signatures to JSON
 * Calls back the functions dynamically after ChatGPT responds

Use PEP-8 style to document your function signatures (see `funcs.py` for an example.)

### Example

```python
def chat_completion_request(messages, functions=None, model=None):
    # post request to OpenAI api
    # ...

# Our functions are defined in funcs.py so we just pass that in to gptfuncs.add_function_hooks
# and in handles everything
res = gptfuncs.add_function_hooks("funcs.py", lambda funcs: chat_completion_request(
  model="gpt-3.5-turbo-0613",
  messages=[{"role": "user", "content": "Sing me a poem about Hackernews."}],
  functions=funcs
))

# normal api result after all the functions have been called
print(res)
```


`funcs.py`:
```python
import os
import subprocess


def play_music(audio_data_hex):
    """
    Play music to user.

    Args:
        audio_data_hex (string): Hex representation of the raw audio binary data with 44100 sample rate.
    """
    bin_data = base64.b64decode(audio_data_hex)
    file_path = "/tmp/a.mp3"
    with open(file_path, "wb") as file:
        file.write(bin_data)

    print(f"Binary file saved as: {file_path}")
    os.system("/usr/bin/afplay " + file_path)


def speak(sentence, spoken_speed=210):
    """
    Convert the sentence to spoken words and speak it to user.

    Args:
        sentence (string): English sentence that should be spoken.
        spoken_speed (number): A value from 100 to 300 determining how fast the sentence is spoken.
    """
    subprocess.Popen(['say', '-v', 'Karen', '-r', str(spoken_speed), sentence])
```
cloud-tts-tool 0.0.75
A tool for requesting text to speech from a variety of cloud APIs.
Requires Python: >=3.9

# Cloud TTS

This package is in development but will allow you to easily connect to a variety of text to speach apis.

Please set keyring items:

Google Cloud:
https://cloud.google.com/iam/docs/service-accounts-create
```python
#python console
import keyring
keyring.set_password("google_tts", "google_private_key_id", "<GOOGLE_PRIVATE_KEY_ID_FROM_JSON>")
keyring.set_password("google_tts", "google_private_key", "<GOOGLE_PRIVATE_KEY_FROM_JSON>")
keyring.set_password("google_tts", "google_client_email", "<GOOGLE_CLIENT_EMAIL>")
```
The other items don't appear to matter.

#AWS Polly:
in console, IAM, Users, Add user,
choose a username 
Attatch Policies Directly
select only "AmazonPollyReadOnlyAccess"
Create User, copy Access key ID and Secret access key and add them to your keychain

```python
#python console
import keyring

keyring.set_password("aws_tts", "aws_access_key_id", "<AWS_ACCESS_KEY_ID>")
keyring.set_password("aws_tts", "aws_secret_access_key", "<AWS_SECRET_ACCESS_KEY>")`
```
#Microsoft Azure:
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=script%2Cwindowsinstall&pivots=programming-language-python
Create Speech Services resource
Pay-as-you-go/DefaultResourceGroup-CUS
Choose region
Name resource (don't use spaces or underscores)
Chose pricing tier (free allows for about an hour of neural voice per month)
Network type: Selected Network
create new virtual network and subnet
put your ip address in the firewall  (https://www.google.com/search?q=what+is+my+ip)
Review and Create
Create

From home you should see the name of your resource, click on it
Click Manage Keys
Copy Key 1 and add it to your keychain
Copy Location/Region and add it to your keychain (not really a secret, but since 
your key is tied to a region, it's nice to have it in the same place)

```python
#python console
import keyring
keyring.set_password("azure_tts", "azure_key", "<AZURE_KEY_1>")
keyring.set_password("azure_tts", "azure_region", "<AZURE_REGION>")
```

# Usage

```python
import keyring
from cloud_tts import get_voices

platform = "google" # or "aws" or "azure"
voice_list = get_voices(platform)

# print out the voices
for voice in voice_list:
    print(f'{voice["id"]} {voice["name"]} {voice["language"]}')
```

Send text to cloud

```python
from cloud_tts import make_tts, example_text

audio_content = make_tts(text =example_text(), voice="en-US-Wavenet-A", platform="google", loc="en_US", gender="FEMALE")

#save audio
filename = "example.mp3"
with open("example.mp3", "wb") as f:
    f.write(audio_content)
```
txZMQ-ng 1.0.3
Twisted bindings for ZeroMQ

Twisted bindings for 0MQ
========================

.. image:: https://img.shields.io/pypi/pyversions/txZMQ-ng.svg

.. image:: https://img.shields.io/pypi/v/txZMQ-ng

.. image:: https://img.shields.io/pypi/l/txZMQ-ng

.. image:: https://img.shields.io/pypi/dw/txZMQ-ng

.. image:: https://img.shields.io/pypi/pyversions/txZMQ-ng.svg)

Introduction
------------

This is a fork of the original project at https://github.com/smira/txZMQ,
since it is no longer maintained.

txZMQ allows to integrate easily `ØMQ <http://zeromq.org>`_ sockets into
Twisted event loop (reactor).

txZMQ supports both CPython and PyPy and ØMQ library version 2.2.x or 3.2.x.

Documentation is available at `ReadTheDocs <http://txzmq.readthedocs.org>`_.


Requirements
------------

C library required:

* ØMQ library 2.2.x or 3.2.x

Python packages required:

* pyzmq >= 13 (for CPython & PyPy)
* Twisted


Details
-------

txZMQ introduces support for general 0MQ sockets by class ``ZmqConnection``
that can do basic event loop integration, sending-receiving messages in
non-blocking manner, scatter-gather for multipart messages.

txZMQ uses ØMQ APIs to get file descriptor that is used to signal pending
actions from ØMQ library IO thread running in separate thread. This is used in
a custom file descriptor reader, which is then added to the Twisted reactor.


Upgrading from 0.3.x
--------------------

If you're upgrading from version 0.3.1 and earlier, please apply following
changes to your code:

* root package name was changed from ``txZMQ`` to ``txzmq``, adjust your
  imports accordingly;
* ``ZmqEndpointType.Connect`` has been renamed to ``ZmqEndpointType.connect``;
* ``ZmqEndpointType.Bind`` has been renamed to ``ZmqEndpointType.bind``;
* ``ZmqConnection.__init__`` has been changed to accept keyword arguments
  instead of list of endpoints; if you were using one endpoint, no changes
  are required; if using multiple endpoints, please look for ``add_endpoints``
  method.

Hacking
-------

Source code for txZMQ is available at `github <https://github.com/smira/txZMQ>`_;
forks and pull requests are welcome.

To start hacking, fork at github and clone to your working directory. To use
the Makefile (for running unit tests, checking for PEP8 compliance and running
pyflakes), you will want to have ``virtualenv`` installed (it includes a
``pip`` installation).

Create a branch, add some unit tests, write your code, check it and test it!
Some useful make targets are:

* ``make env``
* ``make check``
* ``make test``

If you don't have an environment set up, a new one will be created for you in
``./env``. Additionally, txZMQ will be installed as well as required
development libs.
unitcell 0.1.0
Utility package to work and operate on periodic lattices an crystal structures
Keywords: crystal structure,unit cell,periodic lattice

# unitcell

Utility package to work and operate on periodic lattices and crystal structures

## About

`unitcell` is a utility package to work and operate on periodic lattices and
crystal structures.
It was developed in 2008 by Angel Yanguas-Gil as a helper
tool, and it has been recently updated to work with Python 3.0
and higher.

`unitcell` it is not intended to be a full-fledged crystallographic
package. For instance, it does not support CIF files. Its main purpose is to 
generate and operate in arbitrary lattice, to carry out common tasks such as:

- Create periodic lattices and export them as XYZ files for visualization.
- Customize the visible points to visualize features such as steps or vacancies.
- Compute pair distribution functions for each site and extract
  neightbor lists.
- Compute crystallographic directions and crystal plane orientations.
- Generate graph structures for kinetic Monte Carlo simulations.

## Status

`unitcell` is still in development and in process of being updated after a few
years in a drawer.

`unitcell` is licensed through the BSD licence.