semvec/pypi-packages huggingface dataset:
hou-flask-psycopg2 0.0.7
Highly Opinionated Utils: Flask Psycopg2
Keywords: oss_auth

# Highly Opinionated Utils: Flask-Psycopg2

Provides the ability to integrate Flask directly with psycopg2
No need for a filthy ORM

## Installation

```bash
pip install hou-flask-pscyopg2
```

Sometimes on macs psycopg2 is a little pain in the ass.  You'll see
errors like 

```bash
>>> ld: library not found for -lssl
>>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>>> error: command 'clang' failed with exit status 1
```

To fix these try any of the following

1. `xcode-select --install`
2. `brew install openssl`
3. `LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" pip install hou-flask-pscyopg2`


=======
History
=======

0.0.1 (2018-06-27)
------------------

* First release on PyPI.
belousov-zhabotinsky 0.7.0
Simulation of the Belousov-Zhabotinski reaction with ASCII characters
Requires Python: >=3

# Belousov-Zhabotinsky

![](demo.gif)

## About

**The python package you never knew you needed!**
Now you can appreciate all the glory of the Belousov-Zhabotinsky reaction from the comfort of your console window in a state of the art *ASCII art* rendering. *Your life will never be the same!*

This a little python script I made for a class sometime ago. You can play around with the equations coefficients and rendering parameters with command line arguments (see usage). Besides the **BZ** equation there's also the **FitzHugh-Nagumo** (for Turing patterns), **Gray-Scoot** and **Cahn-Hilard** (simulates phase separation) equations.

## Theory

The Belousov-Zhabotinsky reaction is the classical examples of non-linear/oscillatory dynamics in chemical systems. The equations that describe the process are reaction-diffusion equations:

**BZ Equations:**


<img src="https://latex.codecogs.com/svg.latex?\large&space;a_{t+1}=a_t+a_t({\alpha}b_t-{\gamma}c_t)" title="A" class="center" />


<img src="https://latex.codecogs.com/svg.latex?\large&space;b_{t+1}=b_t+b_t({\beta}c_t-{\alpha}a_t)" title="B" class="center" />


<img src="https://latex.codecogs.com/svg.latex?\large&space;c_{t+1}=c_t+c_t({\gamma}a_t-{\beta}b_t)" title="C" class="center" />


Numerally you iterate the equations in a 2D grid. The Laplace operator in a discrete grid is simply a convolution.

You can learn more about the Belousov-Zhabotinsky reaction here:

- Dynamics and Chaos - Steven H. Strogatz

- Chaotic Dynamics, an introduction - G. L. Baker and J. P. Gollub

Inspired by the following blog posts:

![scipy blog](https://scipython.com/blog/simulating-the-belousov-zhabotinsky-reaction/)

![degenerate state](http://www.degeneratestate.org/posts/2017/May/05/turing-patterns/)

## Installation

> *Should work in any python3 version*

> *Needs numpy and scipy*

> See piplock file

You can pip install the python module with the following command

`pip install --user belousov-zhabotinsky`


## Usage

`$ belousov-zhabotinsky`

or

`$ python -m belousov-zhabotinsky`

Check cli options with:

`$ belousov-zhabotinsky --help`

You can exit the program by pressing any key

- Gray-Scott mode requires a terminal size bigger than 100x100 to work properly
- There's a **plot.py** script thay can be use to plot the system in matplotlib.

`$ python -m belousov-zhabotinsky.plot`

## Future

- [x] Fix Gray-Scott
- [x] Make it faster


*My First GitHub project; HOORAY!*
kov-utils 0.0.2
A small utils package
Requires Python: >=3.6

# kov-utils ![Python 3.6](https://img.shields.io/static/v1?label=Python&message=3.6%20|%203.7&color=blue)

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install kov-utils.

```bash
pip install kov-utils
```

## Modules

kjson.py - json save and load

paths.py - paths and file extensions

rand.py - generate random string and sleep mechanism

request.py - request with retry mechanism

sh.py - subprocess commands

strings.py - string utilities

## Example

```python
from kov_utils import strings

string_between('kov_utilstestingphase', 'kov_utils', 'phase') #string, from, to
```

## License
[MIT](https://choosealicense.com/licenses/mit/)
kafka-client-decorators 0.9.11
Decorator interface to pykafka
Requires Python: >=3.6

# Decorators to kafka
This module is based on pykafka project (https://github.com/Parsely/pykafka.git) and define a class KafkaDecorator and its 4 decorators

* @KafkaDecorator.host
The first defines the connection parameters and
its parameters are the same of *pykafka.KafkaClient*  


* @KafkaDecorator.balanced_consumer defines a balanced consumer and
its parameters are the same of *pykafka.topic.get_balanced_consumer* function


* @KafkaDecorator.simple_consumer defines a simple consumer and
its parameters are the same of *pykafka.topic.get_simple_consumer* function

* @KafkaDecorator.producer defines a producer and
its parameters are the same of *pykafka.topic.get_producer* function

# Install

	pip install kafka-client-decorators

# Example
```python
from kafka_client_decorators import KafkaDecorator

kc = KafkaDecorator(  )

#@kc.host(zookeeper_hosts='localhost:2181' )
@kc.host(hosts='localhost:9092' )
class A:
	def __init__(self, testA, cls):
		self.a = testA
		self.cls = cls
		pass

	@kc.balanced_consumer('test1', consumer_group='testgroup3', auto_commit_enable=True, managed=True, consumer_timeout_ms=1000)
	def get(self, msg):
		print ( f'{self.a} Receive offset {msg.offset} key {msg.partition_key} message: { msg.value }' )
		self.send( msg.value )

	@kc.simple_consumer('test2', consumer_group='testgroup4', auto_commit_enable=True, consumer_timeout_ms=1000)
	def get2(self, msg):
		print ( f'{self.a} Receive offset {msg.offset}, message: { msg.value }' )
		self.cls.stop(self)

	@kc.producer('test2')
	def send(self, msg):
		pass

	@kc.producer('test1')
	def sendKey(self, msg, key ):
		pass

class B:

	def __init__(self):
		pass

	def stop(self, conn):
		conn.stop()

a = A('Example', B())
a.start()

a.sendKey( 'Hello'.encode('utf-8'), partition_key='world'.encode('utf-8') )

a.wait()
```
MCRLLM-GUI 0.0.1
MCRLLM: Multivariate Curve Resolution by Log-Likelihood Maximization

MCRLLM: Multivariate Curve Resolution by Log-Likelihood Maximization.    

X = CS    
where    
X(nxk): Spectroscopic data where n spectra acquired over k energy levels    
C(nxa): Composition map based on a MCRLLM components    
S(axk): Spectra of the a components as computed by MCRLLM    

# Method first presented in    
Lavoie F.B., Braidy N. and Gosselin R. (2016) Including Noise Characteristics in MCR to improve Mapping and Component Extraction from Spectral Images, Chemometrics and Intelligent Laboratory Systems, 153, 40-50.    

# Input data    
Algorithm is designed to treat 2D data X(nxk) where n spectra acquired over k energy levels.    
A 3D spectral image X(n1,n2,k) can be reshaped to a 2D matrix X(n1xn2,k) prior to MCRLLM analysis. Composition maps can then be obtained by reshaping C(n1xn2,a) into 2D chemical maps C(n1,n2,a).    
# Examples    
Two full examples, along with datasets, are provided in 'Download Files'.    
Please refer to 'MCRLLM_example.pdf' for full details.    
  - Example 1: 1D spectral linescan of EELS data.    
  - Example 2: 2D spectral image of XPS data.    
# Compatibility    
MCRLLM tested on Python 3.7 using the following modules:    
Numpy 1.17.2    
Scipy 1.3.1    
Sklearn 0.21.3    
Pysptools 0.15.0    
Tqdm 4.36.1
H-MCRLLM 0.0.24
H MCRLLM: Hierarchical Multivariate Curve Resolution by Log-Likelihood Maximization

H MCRLLM: Hierarchical Multivariate Curve Resolution by Log-Likelihood Maximization    

X = CS    
where    
X(nxk): Spectroscopic data where n spectra acquired over k energy levels    
C(nxa): Composition map based on a MCRLLM components    
S(axk): Spectra of the a components as computed by MCRLLM    

# Method first presented in    
Lavoie F.B., Braidy N. and Gosselin R. (2016) Including Noise Characteristics in MCR to improve Mapping and Component Extraction from Spectral Images, Chemometrics and Intelligent Laboratory Systems, 153, 40-50.    

# Dataset    
XPS dataset of Titanium, Vanadium and Chromium. Please refer to Lavoie et al. (2016) for further details on the sample.