Saravanan666/pypi-org huggingface dataset:
Package: pygame-button
pygame_buttonA very simple button class for pygame.
Supports different background and font colors for idle, hover, and clicked modes. Can be linked to a function and set to either run on down-click, or click release.It is stylable to a degree (see example). The easiest way to do this is to create a style dictionary and then pass this with the **kwarg unpacking syntax.Many things that could still be added.Installationpipinstallpygame_buttonUsageSeeexample
Package: pygame_cffi
# pygame_cffi[![Build Status](https://img.shields.io/travis/CTPUG/pygame_cffi.svg)](https://travis-ci.org/CTPUG/pygame_cffi)[![PyPI](https://img.shields.io/pypi/v/pygame_cffi.svg)](https://pypi.python.org/pypi/pygame_cffi)[![Windows Build status](https://ci.appveyor.com/api/projects/status/qsa3c9qfa8xt8j9i/branch/master?svg=true)](https://ci.appveyor.com/project/CTPUG/pygame-cffi/branch/master)A cffi-based SDL wrapper that copies the pygame API.We copy various code and API ideas from pygame, so we inherit pygame'sLGPL v2.1, or later license.## DiscussionWe have a Google Group: https://groups.google.com/forum/#!forum/pygame-cffi.Any pygame-cffi discussion welcome!There is also the #pygame-cffi channel on irc.freenode.net## Installation1. Install the requirements listed below. On a Debian-based system, allrequirements can be installed using `sudo apt-get build-dep pygame`(pygame_cffi requires most of the pygame dependencies).2. `pip install pygame_cffi`## Requirementspygame_cffi requires a recent version of python-cffi to build (at leastversion 1.3.0).* libjpeg-dev* libpng-dev* libsdl1.2-dev* libsdl-image1.2-dev* libsdl-mixer1.2-dev* libsdl-ttf2.0-dev## Local Development1. Install dependencies (probably in a virtualenv)2. Run `cffi_builders/build.py`3. Hack## Running Tests* Upstream pygame unit tests: `python -m test`* Tests that are known to fail on pygame_cffi are marked as expectedfailures. To see these failures, pass the `--expected-failures`argument.* Conformance between pygame and pygame_cffi: See `conformance/README`* pygame_cffi functionality example apps are in the `demos` directory## Building on windowsTo build on windows, you need to download the appropriate dependency libraries.The ``pygame`` project provides all the required libraries in a nicelybundled set, available from `https://bitbucket.org/llindstrom/pygame/downloads/`For 32 bit machines, download the latest prebuilt-x86 zipfile andunzip it under the pygame_cffi directory.For 64 bit machines, download the latest prebuild-x64 zipfile andunzip it under the pygame_cffi directory.Then run python setup.py build to compile the modules.
Package: pygame-chess-api
pygame_chess_api packageWelcome to pygame_chess_api!The goal of this package is to be able toeasily setup chess games, with thegame engine and the graphical user interface given.
Especially to enable you toquickly build chess AI.InstallationTo install this package you only have to run this:pip install pygame_chess_api.If you're having issues with the installation, please try to install pygame manually first withpip install pygameand then try again to install this package without dependencies with the following command:pip install --no-deps pygame_chess_api.If it doesn't work, feel free to open an issueGetting StartedTo get started you can check theQuickstarton the documentation (https://pygame-chess-api.readthedocs.io/)To run a quick test and see what working witch pygame_chess_api can look like you can also download examples on the GitHub RepositoryPlease check the Documentation athttps://pygame-chess-api.readthedocs.io/to access to Quickstart, References, etc
Package: pygame-colliders
Pygame colliders will enhance your game or application to have more complex
colliding system beyond standardRectcolliders in Pygame.Despite the name colliders aren’t bound to Pygame and Pygame library is not
prerequisite.DocumentationDocumentation is located athttps://pygame-colliders.readthedocs.io/UsageLook how easy it is to use:frompygame_collidersimportConcaveCollider,ConvexCollider# Create colliderscollider_a_points=[(3,3),(5,3),(5,4),(4,4),(4,5),(5,5),(5,6),(3,6)]collider_b_points=[(4.5,3.5),(6,2),(6,4)]collider_a=ConcaveCollider(poly_a_points)collider_b=ConvexCollider(poly_b_points)# Check collisionifcollider_a.collide(collider_b):print("Collision detected!")FeaturesCollisions betweenInstallationInstall pygame colliders by running:pip install pygame-collidersContributeIssue Tracker:https://github.com/jtiai/pygame-colliders/issuesSource Code:https://github.com/jtiai/pygame-collidersSupportIf you are having issues, please let us know.
We have a Discord channel located at :https://discord.gg/VXVRPxeLicenseThe project is licensed under the 3-clause BSD license.
Package: pygame-easy-btn
python package for pygame to make buttons with cool hovers , resize , functions and more all in a really fast and easy way !example:import pygame, sys, pygame_easy_btn
pygame.init()

width, height = 1280, 720
screen = pygame.display.set_mode((width, height), 0, 32)
pygame.display.set_caption("example")
fps = 30
clock = pygame.time.Clock()

def main():
    print ("hi" )
    screen.fill((0, 0, 0))

def main1():
    print ("hi" )
    screen.fill((0, 0, 0))
    
while True:
    print (pygame_easy_btn.clicked)
    pygame_easy_btn.mainloop()
    screen.fill((255, 255, 255))
    pygame_easy_btn.img_button_with_hover(screen, 50, 50, "help.png", "help2.png", 50, 50, main)
    pygame_easy_btn.img_button_with_hover(screen, 200, 400, "help.png", "help2.png", 50, 50, main1)
    pygame_easy_btn.img_button_without_hover(screen, 200, 200, "help.png", 50, 50, main)
    pygame_easy_btn.shape_button_with_hover(screen, 500, 200, (0, 0, 0), (20, 20, 20), 100, 100, main)
    pygame_easy_btn.shape_button_without_hover(screen, 500, 500, (0, 0, 0), 100, 100, main)
    pygame_easy_btn.text_button_with_hover(screen, "Hi ", 700, 600, (0, 0, 0) , (255, 0, 0), clicked_function=main)
    for event in pygame.event.get():
        pass


    pygame.display.update()
    clock.tick(fps)document:
# you must enter this command in gameloop:
pygame_easy_btn.mainloop()
#you can put an image button with hover in screen using :pygame.img_button_with_hover(surface, X pos, Y pos, file, hover_file, scale width, scale height, When clicked call this function)

#you can put an image button without hover in screen using :

pygame.img_button_without_hover(surface, X pos, Y pos, file, scale width, scale height, When clicked call this function)

#you can put rectangle button with hover in screen using :

pygame.shape_button_with_hover(surface , x_position, y_position , color, hover_color, width, height, When clicked call this function)

#you can put rectangle button without hover in screen using :

pygame.shape_button_without_hover(surface , x_position, y_position , color, width, height, When clicked call this function)

#you can put text button with hover in screen using :

pygame.text_button_with_hover(surface , text , x_position, y_position , color, hover_color,  font = pygame.font.Font(None, 40), When clicked call this function)

#you can put text button without hover in screen using :

pygame.text_button_without_hover(surface , text , x_position, y_position , color,  font = pygame.font.Font(None, 40), When clicked call this function)
Package: pygame-ecs
Pygame_ecsAn Pure Python, simple to use ECS library for pygame.How it worksCreate an entityentity=entity_manager.add_entity()You can delete an entity like this:entity_manager.kill_entity(entity)Components are just classes that hold dataclassPosition(pygame_ecs.BaseComponent):def__init__(self,x:int,y:int):super().__init__()self.x=xself.y=ySystems are just classes that hold logicclassBallPhysics(pygame_ecs.BaseSystem):def__init__(self,screen)->None:super().__init__(required_component_types=[Position,Velocity])self.dt=0self.screen=screendefupdate_entity(self,entity,entity_components):pos:Position=entity_components[Position]vel:Velocity=entity_components[Velocity]pos.x+=vel.vec.x*self.dtpos.y+=vel.vec.y*self.dtifpos.x>WIDTHorpos.x<0:vel.vec.x*=-1ifpos.y>HEIGHTorpos.y<0:vel.vec.y*=-1Example Usageimportpygameimportpygame_ecsimportrandomclassPosition(pygame_ecs.BaseComponent):def__init__(self,x:int,y:int):super().__init__()self.x=xself.y=yclassBallRenderer(pygame_ecs.BaseComponent):def__init__(self,radius:int,color)->None:super().__init__()self.radius=radiusself.color=colorclassBallDrawSystem(pygame_ecs.BaseSystem):def__init__(self,screen)->None:super().__init__(required_component_types=[Position,BallRenderer])self.screen=screendefupdate_entity(self,entity,entity_components):pos:Position=entity_components[Position]ball_renderer:BallRenderer=entity_components[BallRenderer]pygame.draw.circle(self.screen,ball_renderer.color,(pos.x,pos.y),ball_renderer.radius)screen=pygame.display.set_mode((800,600))clock=pygame.time.Clock()component_manager=pygame_ecs.ComponentManager()entity_manager=pygame_ecs.EntityManager(component_manager)system_manager=pygame_ecs.SystemManager(entity_manager,component_manager)ball_draw_system=BallDrawSystem(screen)system_manager.add_system(ball_draw_system)component_manager.init_components()for_inrange(200):center=(random.randint(0,screen.get_width()),random.randint(0,screen.get_height()),)radius=random.randint(4,18)color=[random.randint(0,255)for_inrange(3)]vel=pygame.math.Vector2((random.random()-0.5)*400/1000,(random.random()-0.5)*400/1000,)entity=entity_manager.add_entity()component_manager.add_component(entity,Position(center[0],center[1]))component_manager.add_component(entity,BallRenderer(radius,color))whileTrue:foreventinpygame.event.get():ifevent.type==pygame.QUIT:raiseSystemExitsystem_manager.update_entities()pygame.display.update()clock.tick(60)pygame.display.set_caption(f"FPS:{clock.get_fps()}")CreditsI'd like to give credit tohttps://www.youtube.com/watch?v=71RSWVyOMEYandhttps://github.com/seanfisk/ecsAs well asdickerdackelfrom pgc server andSamieZaurus#8030from UnitOfTime's server.
Package: pygame-emojis
Pygame Emojis✨✨✨ Load emojis in pygame. ✨✨✨This containopen source emojisfromhttps://openmoji.org/UsageIt is very easy to include emojis in your game 😊First install the  📦 package 📦pip install pygame-emojisThen import the package from 🐍 python 🐍frompygame_emojisimportload_emoji# Choose the sizesize=(64,64)# Load the emoji as a pygame.Surfacesurface=load_emoji('😍',size)📥 The first time you use this package, it will automatically download  a svg database. ✌🏼Acknowledgements ❤️Emojis come fromhttps://openmoji.org/.See also their repohttps://github.com/hfg-gmuend/openmoji/.Thanks a lot to the whole team:https://openmoji.org/about/#acknowledgement.Thanks a lot to the developpers from pygame 🎮:https://www.pygame.org
Package: pygame-engine
PyginPygin is a simple game engine made usingPygame.One of the purposes of this engine is for making to build more complex games using python.This engine includes support for collisions, meshes, materials, game objects and scenes.The elements used are very similar to the ones used in the engineUnity.Getting StartedThese instructions will get you the Pygin package ready to run on your local machine if you use Linux.
Instructions for Windows and Mac would be quite similar.PrerequisitesYou will just have to install Pygin. The instructions below will show you how to do this for Linux (Ubuntu 16.04).Install PythonFirst, install de most recent Python version and the most recent version of pip.
Therefore install Python3 setup tools and pip:$ sudo apt-get install python3-setuptools
$ sudo easy_install3 pipInstall PyginNow you will just have to install the Pygin packge.
Then install Pygin using pip:$ pip install pyginAboutThis project aims to create a game engine to make easier the precess of game development using python.
To understand a little bit more about how the code is structured visit thewiki.Example GamesCheck out the gameBalance, a simple and challenging arcade game made using Pygin.AuthorsCarlos Matheus Barros da Silva-CarlosMatheusAloysio Galvão Lopes-aloysioglIgor Albuquerque Silva-igoralbuqEric Pereira Queiroz Moreira-ericpqmorIgor Mourão Ribeiro-igor-ribeiiroNotes about documentation and contributingIf any substantial change is made, please, help out with the documentation using thewiki.Upgrading version on PypiMake sure you have the latest versions of setuptools and wheel installed:python -m pip install --upgrade setuptools wheelNow run this command from the same directory where setup.py is located:python3 setup.py sdistThis command will generate a file in dist directory.Now you’ll need to install Twine:python -m pip install --upgrade twineOnce installed, run Twine to upload all of the archives under dist:twine upload --repository-url https://upload.pypi.org/legacy/ dist/*You will be asked your username and password from your Pypi account, in which you must have access to the project in oder to upload.After this, the version on Pypi is already updated.Now you should delete the dist folder.LicenseThis project is licensed under the MIT License - see thelicencefile for details.AcknowledgmentsProfessor Edgar Toshiro Yano-Curriculum
Package: pygame_fpak
Flatpak packaging for pygameFlatpakis a sandboxed application packaging system
for Linux (developer docs).
Pygame is a framework for making games.This is anexperimentaltool to make Flatpak packages for pygame games. To use
it:You will need a Linux system with Flatpak >= 0.8 installed, such as Fedora 25
or Ubuntu 17.10.Install usingpip install pygame_fpak. The tool needs Python 3 to run,
even if your game uses Python 2.Create apygame-fpak.tomlconfig file like this:# At the moment, you can specify "3.6", "3.4" or "2.7".# 3.6 produces a somewhat bigger app to download.python="3.6"# User-visible namename="Solarwolf"# Identifier based on a reverse domain name you control. E.g. if your# project is on Github, you could use io.github.username.reponameappid="org.pygame.solarwolf"# Files/directories needed to run the game - relative paths from where# the config file lives.files=["solarwolf"]# The function to start your game. This will be called like:# from solarwolf.cli import main; main()entry-point="solarwolf.cli:main"# Icons in different sizes. Icons should be square, sizes are pixels# along one side of a square. 32, 48 and 64 are common.[icons]64="dist/solarwolf.png"Runpython3-mpygame_fpakpygame-fpak.toml.The other code in this repo builds the base apps for the tool described above.
To build & install them:# Slow, but only needed once:makeinstall-runtime# Build the base applications and install them:makeinstall-baseapp-py36.donemakeinstall-baseapp-py34.donemakeinstall-baseapp-py27.doneThere are three variants of the base application:-py36includes Python 3.6 as/app/bin/python3. This is approximately
30 MiB to download, and 140 MiB when installed. TheAliensexample is built
on this by default.-py34uses Python 3.4, which is provided by the freedesktop.org runtime.
This makes it smaller - about 7 MiB to download, and 40 MiB installed - but
you can’t use the latest Python features in your code.py27uses Python 2.7. It is a similar size to the Python 3.4 base app.Flatpak applications use aruntime, a bundle of common libraries and
executables. If your application is the first a user installs with a given
runtime, Flatpak will download the runtime as well. Hopefully most apps will
share a few runtimes, so that installation is quick and easy.
Package: pygameFPS
pygameFPSA simple python package to show your fps in pygameExample:import pygame
import pygameFPS as fps
pygame.init()
screen = pygame.display.set_mode([500, 500])
running = True
pygame.init()
screen = pygame.display.set_mode((1280, 720))
pygame.display.set_caption('Graphing calculator')
clock = pygame.time.Clock()
maxFPS = 144
running = True

while running:
    mouse_pos = pygame.mouse.get_pos()
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    fps.tick()
    # default rendering
    fps.render(screen)
    # custom args(surface, x, y, size, color)
    fps.render(screen, 50, 50, 24, (255, 255, 255))
    
    screen.fill("black")
    width = 1280
    height = 720
    colour = (255, 255, 255)
    font = pygame.font.SysFont(None, 24)
    img = font.render(f'FPS: {getFPS()}', True, colour)
    screen.blit(img, (20, 20))
    pygame.draw.line(screen, colour, (width / 2, 0), (width / 2, height), 3)
    pygame.draw.line(screen, colour, (0, height / 2), (width, height / 2), 3)

    for line in lines:
        if not line.getCalculated():
            line.calculate()
        x = line.x
        y = line.y
        x2 = line.x2
        y2 = line.y2
        half_width = width / 2
        half_height = height / 2
        pygame.draw.line(screen, colour, (half_width + x, half_height + y), (half_width + x2, half_height + y2), 3)

    pygame.display.flip()

    clock.tick(maxFPS)

pygame.quit()
Package: pygame-gameover
first from pygame_gameover import gameoverfrom pygame_gameover import gameover
import pygame
import sys
screen=pygame.display.set_mode((1000,500))this is a example of gameoverdef gameloop():
game=True
while game:
for event in pygame.event.get():
if event.type==pygame.QUIT:
game=False
sys.exit()
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_s:
# second gameover.gameover() and is module call the gameover function
gameover.gameover()screen.fill((255,255,0))           

    pygame.display.update()gameloop()
Package: pygame-geometry
DescriptionThis is a framework based on pygame that allows an easier process for making games. This is so much more than a tool kit.
Tested in pygame2 not in pygame1.Installationpipinstallpygame-geometryQuick examples:Draw some moving Points and a Circlefrompygame_geometry.abstractimportPoint,Circlefrompygame_geometry.contextimportContextfrompygame_geometryimportcolorscontext=Context(name="title")# create a context similar to a pygame surfacep1=Point(2,2)p2=Point(3,2,color=colors.BLUE)c=Circle(0,-1,radius=2,color=colors.RED)# main game loopwhilecontext.open:# clear the windowcontext.clear()# check quit event (empty pygame event buffer by doing so)context.check()# move and zoom around the scenecontext.control()# update objectsp1.rotate(0.01,p2)c.x+=0.01# show objectsp1.show(context)p2.show(context)c.show(context)# flip the screencontext.flip()Draw Bezier Curvesfrompygame_geometry.contextimportSurfacefrompygame_geometry.curvesimportTrajectory,BezierCurvefrompygame_geometry.abstractimportPointfrompygame_geometryimportcolorsimportrandom# create objectssurface=Surface(name="Curves demonstration")l=10points=[Point(2*x,random.randint(-5,5))forxinrange(l)]t=Trajectory(points,segment_color=colors.GREEN)b=BezierCurve(points,segment_color=colors.RED)n=0ncp=50#number construction pointswhilesurface.open:# surface stuffsurface.check()surface.clear()surface.control()surface.show()# show a math grid in background# updatePoint.turnPoints([1/1000foriinrange(l)],points)n=(n+1)%(ncp+1)b.showConstruction(surface,n/ncp)p1=b(n/ncp)p2=Point(*t(n/ncp))# showt.show(surface)b.show(surface)p1.show(surface,color=colors.YELLOW,radius=0.1,fill=True)p2.show(surface,color=colors.YELLOW,radius=0.1,fill=True)# flipsurface.flip()ControlsSpace: Switch to next mode.Enter: Go back to the center.Up/Down/Right/Left Arrow: Move arround.Right/Left Shift: Zoom in or out.Quit/Escape: Quit.Geometry objectsGeometry components added:pointsegmentvectorlinehalflineBut also:circlerectanglesquarepolygontrianglebezier curvetrajectoryPhysics/Maths objectsforcemotionbodypolynomialperlin noiseGame objectsentityanatomywidgetmenumanagerMore technical physics objectsmaterialmaterial formmaterial circlematerial formcolliderEnjoy!
Package: pygame-gesture-kit
pygame_gesture_kitEasy camera based hand tracking and gesture recognition for pygameTake a look at thePyGame-ComputerVision-Racer 🚗game for an example
project.How it workspygame_gesture_kit usesMediaPipeandOpenCVto
capture a video feed from a camera and detect hands in these images.The camera frame is mapped to the pygame window and tracking coordinates for all hand landmarks can be acquired by
calling the functionget_hands()from within the game loop. It also provides information on detected gesture.
Capturing from a camera from within the game loop would limit the frame rate of your game to that of the camera,
which might cause the framerate to drop to 30 fps or even lower. To prevent this, pygame_gesture_kit executes video
capturing and processing in a separate thread.The gesture recognition uses a customized model, trained from theHaGRID dataset.
It provides the following labels:noneif no gesture was detected,fistfor a closed hand,one finger:onetwo fingers:two_up,two_up_inverted,peace,peace_invertedthree fingers:three,three2four fingers:fourfive fingers:palm,stop,stop_invertedthumbs up/down:like,dislikeHow to use itA comprehensive example is provided in theexampledirectory. Basically, you need to import and use two classes
in your code: theCameraandGestureRecognizer.frompygame_gesture_kitimportGestureRecognizer,Cameraimportpygame_gesture_kit.hand_visualizerTheCameraclass wraps an OpenCV capture device and uses the same index numbers to specify devices. Unfortunately,
OpenCV does not provide an interface to enumerate cameras, so you will have to guess, which is the right index for
you. It will usually be0, but on macOS that index may also be the continuity camera. Try1and higher numbers
if you don't get the camera you want.You can start capturing and recognizing hands easily like this:capture_device=Camera()try:capture_device.open_camera(0)exceptExceptionase:print(e)exit(1)gesture_recognizer=GestureRecognizer(capture_device,max_hands=2)gesture_recognizer.start()The number of visible hands can be determined by thegesture_recognizer.get_visible_hands()function.The following code snippet illustrates how to process data from theget_hands()function. It uses thehand_visualizerto draw the detected landmarks on a surface and adds labels for the detected gestures.i_hand=0forhandingesture_recognizer.get_hands():hand_visualizer.draw_bones(screen,hand,joint_label_font=small_font)i_hand+=1text=font.render(f'Hand{i_hand}',1,pygame.Color('black'),pygame.Color('white'))x,y=hand.landmarks[0]screen.blit(text,(x,y))text=font.render(f'Gesture:{hand.gesture}',1,pygame.Color('black'),pygame.Color('white'))screen.blit(text,(x,y+24))InstallingYou can install pygame_gesture_kit using the PyPI package manager:python-mpipinstallpygame-gesture-kitalternatively, install it directly from this github repo:python-mpipinstallgit+https://github.com/FreeBugs/pygame_gesture_kit.gitIf you are using PyCharm, you can install the package from the Package Manager by selectingAdd Package->From Version Control.
Package: pygamegui
pygameGUIPython user interface framework using pygame libraryGetting start :eyes:Installation via pip:pip install pygameguipip install git+https://github.com/Ethosa/pygameGUI.gitImport:frompygameimportManager,ViewContact:social.ethosa@gmail.comWant to support a project?You can put a star! :star:You can also open the source and offer new features or talk about bugs.
Package: pygamehelper
pygamehelperDeveloped by Asher Thomas AbrahamUses of pygame helperhelps you to show text on the pygame window easily.
helps you to scale images on the pygame window easily
helps you to rotate images in the pygame window easilyhow to scale images with pygame helper#exampleYOUR_IMAGE_NAME=scale_image(pygame.image.load("YOUR_IMAGE_PATH"),TYPE_THE_NUMBER_HERE_TO_SCALE)how to rotate images with pygame helper#exampleblit_rotate_center(win,self.img,(self.x,self.y),self.angle)how to show text with pygame helper#exampleblit_text_center(WIN,MAIN_FONT,"THE_TEXT")CreditsDeveloped by Asher Thomas
Special thanks to Tim Ruscica