MCore - Maic's Core Utils
Collection of Python code I always copy into new projects. Supportive code for logging, testing, network, and arcade game development.
Installation
pip install git+https://github.com/eruvanos/mcore.git#main
or
pip install git+https://github.com/eruvanos/mcore.git#main[<extras>]
Overview
General
mcore.log.configure()
- configures loggers (stdout: info|debug; stderr: warn|error)mcore.serialize.EnhancedJSONEncoder
- json support for dataclassmcore.enum.AutoNameEnum
- the missing AutoNameEnummcore.dispatcher.Dispatcher
- Dispatcher for objects, register listener by typemcore.dispatcher.AsyncDispatcher
- LikeDispatcher
with async interface
Networking
mcore.net.SecureNetwork
requiresmcore[secnet]
mcore.net.Packet
- Dict like wrapper with access to items via attributesmcore.net.Network
- Handles data transfer via socketmcore.net.SecureNetwork
- LikeNetwork
with end-to-end encryptionmcore.net.AIONetwork
- LikeNetwork
with async interface
Test
requires
mcore[test]
mcore.test.local_dynamodb
- Manage local dynamodb within test setupsmcore.test.mock_server
- Mock json API with Flask in test setups
Game development
requires
mcore[game]
mcore.game.fps.FPSDisplay
- Pyglets FPSDisplay with fix for arcademcore.game.frozen
- Utils for frozen environments (PyInstaller)mcore.game.sound.SoundPlayer
- Sound controls (music, sound effects, adjust volume)mcore.game.animation.Animation
- Time based animations within arcademcore.game.transition.Effect
- Time based change of valuesmcore.game.esper_ext.World
- improved version ofesper.World
mcore.game.predict.PredictedValue
- Helper to smooth network latencymcore.game.camera
- different camera implementationsMarginCamera
- Camera keeps margin between borders and tracked spriteZoomCamera
- Supports zoomFreeCamera
- Moveable with mouse interaction