semvec/pypi-packages huggingface dataset:
pygametext 0.1.0.4
This Package adds UI Elements like Buttons and Textboxes to PyGame.
Requires Python: >=3.6

### Changelog:
* Fixed Bugs
* Added pgt.square() function (for more information look at the Elements section)


# pygametext
This Package adds UI Elements to PyGame.

## Install
pip install pygametext

## Import
`import pygametext`


## Initiate pygametext
`pgt = pygametext.PGT(screen)`


## Elements
`pgt.button(x,y,width,height,buttonColor,"Text",textColor,onClickFunction,onClickArguments,layer)`
-> Returns True

`pgt.switch(x,y,width,height,buttonColor,"Text",textColor,activeFunction,activeArguments,layer)`
-> Returns True

`pgt.checkbox(x,y,scale,color,activeFunction,activeArguments,layer)`
-> Returns True

`pgt.text(x,y,"Text",textColor,textSize,layer)`
-> Returns True

`pgt.square(x,y,width,height,color,layer)`
-> Returns True

`pgt.textbox(x,y,width,height,textColor,layer)`
-> Returns True


## Process inputs and events
This function needs to be called if you want that the elements on specified layer to be interactive.
`pgt.update(layer)`

## Draw elements to screen
This function needs to be called if you want that the elements on specified layer to be drawn.
`pgt.draw(layer)`

## Utitilty functions
`pgt.getLayer(layer)`
-> Returns list of PGT Objects on specified Layer

`pgt.clear(id,layer)`
-> Returns True or False

`pgt.rebuild(layer)`
-> Returns True

``` python
import pygame
import pygametext

running = True

pygame.init()

screen = pygame.display.set_mode((640, 360))
clock = pygame.time.Clock()

pgt = pygametext.PGT(screen) # Define pygametext object.

pgt.button(10,10,100,50,(255,0,0),"Hello!",(0,0,0),print,"Hello World!",0) # Add pgt Button
pgt.button(120,10,100,50,(255,255,0),"Bye bye",(0,0,0),print,"Goodbye World!",0) # Add pgt Button
pgt.text(10,70,"Simple pygametext example.",(0,120,0),20,0) # Add pgt Text

def update(): # Update & Eventd
	events = pygame.event.get()

	pgt.update(events, 0) # Update all pgt elements from layer 0. Takes events arg to process some elements.

	for event in events:
		if event.type == pygame.QUIT:
			running = False
			pygame.quit()
			quit()

def draw():
	screen.fill((255,255,255)) # Clear screen
	pgt.draw() # Draw all pgt elements from layer 0

	pygame.display.flip()

while running:
	update()
	draw()
	clock.tick(60)
```
pypusu 1.0.6
Python client for PuSuEngine
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*,<4
Keywords: pubsub,publisher,subscriber,messaging

PuSu Engine client for Python
=============================

Client for using the PuSu Engine server from Python. Probably much
better suitable for sending than receiving, but both should work.

Threaded example
----------------

If you want immediate delivery and are ok with your callbacks getting
called from another thread, you can use the threaded client.

.. code:: python

   from pypusu.threaded import PuSuClient
   from time import sleep


   if __name__ == "__main__":
       c = PuSuClient("ws://127.0.0.1:55000")

       count = 0


       def listener(msg):
           global count
           count += 1


       c.authorize("foo")
       c.subscribe("channel.1", listener)
       c.publish("channel.1", {"foo": "bar"})

       sleep(30)

       print(count)

Polling example
---------------

If your callbacks getting called from another thread is an issue, you
can use the polling client. Internally it still uses threads, but it
will not deliver the messages to your callbacks until you call
``poll()``.

.. code:: python

   from pypusu.polling import PuSuClient
   from time import sleep


   if __name__ == "__main__":
       c = PuSuClient("ws://127.0.0.1:55000")

       count = 0

       def listener(msg):
           global count
           count += 1

       c.authorize("foo")
       c.subscribe("channel.1", listener)
       c.publish("channel.1", {"foo": "bar"})

       for i in range(0, 30):
           sleep(1)
           c.poll()

       print(count)

Dependencies
------------

Not quite sure how to deal with dependencies yet, so for now you’ll have
to install them separately.

Both threaded and polling client need the following in your
``requirements.txt``:

::

   ws4py==0.3.5
   wsaccel==0.6.2

Or you can try:

::

   pip install ws4py wsaccel

License
-------

Short version: MIT + New BSD.

Long version: Read the LICENSE.md -file.

Uploading to PyPi
-----------------

You can’t really do that without the appropriate username + password
information, but I’m saving this here because I’ll just forget.

::

   python setup.py sdist upload -r pypitest
   python setup.py sdist upload -r pypi
py-variety 0.1.0
Use variety by python.

# 项目背景
基于 Python 调用 Github 项目 [variety](https://github.com/variety/variety) 的脚本  
variety 文件夹来源于该项目拷贝  
版本：![](https://img.shields.io/badge/Python-3.x-brightgreen) ![](https://img.shields.io/badge/variety-1.5.1-lightgrey)

---

## 目前已有的功能  

### 1. 规整指定数据库集合的首层字段
```text
如： 
object1={'a':1,'b':2,'d':4}
object2={'a':1,'b':2,'c':3}
...
变更为：
object1={'a':1,'b':2,'c':'','d':4}
object2={'a':1,'b':2,'c':3,'d':''}
...
```

#### demo
```python
from py_variety import formal_fields

db_name = 'db_name'
coll_name = 'coll_name'
new_name = 'new_name'
formal_fields(host='x.x.x.x', verify={'user': 'xxx', 'passwd': 'xxxxxx', 'authdb': 'xxxx'},
              db_name=db_name, coll_name=coll_name,new_name=new_name)
```