Skip to main content

Python Multi-Media API (PMMA) is a multi-purpose API designed to make working on multi-media projects easier and faster!

Project description

PMMA logo

PMMA (Python Multi-Media API)

PMMA is a Python library aimed at improving application development in Python. Typically, developing applications in Python necessitates familiarity with a variety of different libraries such as Pygame, ModernGL, PIL and Numpy. PMMA aims to simplify the application development process by creating a single interface that provides easy access to simple and advanced pre-written and highly optimised application development utilities, whilst still also allowing these utilities to be expanded upon by exposing their underlying APIs.

Contents

History

I, (PycraftDev), joined GitHub to make the video game Pycraft in public using the programming language Python. Initially, my progress wasn't very methodical. I started with the basic game loop and worked out how different Python libraries interacted with each other. When I found that my design was slow, I went back and optimized it.

After many years of development and optimization, I gained extensive knowledge of making certain aspects of application development in Python really fast and performant. With that in mind, I started writing utility programs for Pycraft, which handled all of this behind the scenes, leaving the main programs much cleaner for their aggregation into my project - a video game.

As I worked on other projects, I found myself copying over these utility programs, revising them and gradually evolving my implementation of specific functions or classes. Eventually, this set of utility programs grew to be longer typically than the applications using them, and I decided it was time to separate my applications into two: the application itself, and PMMA.

Features

  • Object-Oriented Programming—Most of PMMA exists as specific objects, making it super easy to customize what you want.
  • Cython acceleration - Where native Python is "too slow" we switch it out for this alternative whenever possible.
  • GPU accelerated - PMMA can use GPU acceleration for 2D and 3D rendering.
  • Advanced mathematics - PMMA includes highly optimised commonly used mathematical functions.
  • Advanced threading - PMMA includes an advanced form of the Threading library, which extends its existing functionality to include the ability to kill threads on the fly.
  • Advanced Tkinter - PMMA includes some advanced Tkinter functions, like getting window size and default operating system fonts.
  • Simple shared memory - PMMA allows you to have a shared memory space for variables as a replacement for global variables, which can be accessed easily through threads.
  • Dynamic colour, coordinate, time, angle, and scalars—PMMA easily converts between different formats, so you can work with whatever is easiest for you!
  • Easy display management - PMMA allows you to easily manage your application window, including size, captions, display modes and v-sync.
  • Efficient shape rendering—PMMA supports a wide range of shapes and can render them using GPU acceleration.
  • Advanced memory management - PMMA will automatically manage large objects stored in memory.
  • Fast noise generation - PMMA can very efficiently create noise patterns in 1D, 2D or 3D.
  • Application customization—PMMA can be told details about your application and dynamically change its behaviour or how it appears to the operating system!
  • Video playback - PMMA can play back videos from a file, in your application. This is done by streaming the data from the disk, so wave goodbye to long video loading times and high memory usage.
  • Simplified Audio playback - PMMA includes support for very efficient audio playback, including steaming music directly from a file instead of reading the whole file at once. This is additionally supplemented with a range of additional controls like the ability to loop or pan audio and change its volume back.
  • Realtime Effects - PMMA can be used to apply effects to audio in real-time.
  • Transitions—PMMA can automatically manage the animation of values and coordinates for you in a variety of different styles. This is useful for moving objects about onscreen.
  • Advanced GPU information collection - PMMA can gather extremely detailed information about all installed GPUs.
  • Easy multi-device input—PMMA will automatically handle any additional controllers connected to your system, allowing you to interface easily with these devices. It even includes support for effects like Rumble!
  • Event management—PMMA will automatically update event objects in the background, allowing you to easily choose which events you need in your application. This idea has also been extended to detect when some events have been triggered in quick succession, like a double-tapped key (with per-key timings if needed).
  • Simple file systems – PMMA will automatically resolve file paths for you and can even scan project directories and produce unique user-friendly names for your files, which you can use instead!
  • Advanced data structures – PMMA includes access to fast implementations for advanced data structures like stacks, queues, circular queues, priority queues, priority stacks, inverted priority queues, inverted priority stacks, priority lists and inverted priority lists.
  • Command Execution—PMMA includes a super simple way for you to run command-line-level commands for your application, including the ability to get the result from the command in real time!
  • Projections—PMMA can automatically create and easily create projections that match your PMMA display for use in your 3D scenes.
  • OpenGL objects—PMMA includes its own wrapper for OpenGL through ModernGL, with a much simpler interface and the usual performance improvements thrown in.
  • Dynamic GPU allocation - PMMA can automatically try to distribute some graphics tasks to multiple installed GPUs to spread the load across all the available hardware.
  • Pipelines—PMMA combines complex 2D and 3D objects and renders them simultaneously, significantly improving performance.

Note: PMMA is still undergoing active development, and some features will be changed, added or extended in the near future - we will attempt to include backwards compatibility where possible.

Optional Dependencies

Cython

PMMA can take advantage of Cython compilation. This converts PYX files into C or C++. To do this, we would recommend GCC or MSVC, as they have written support in PMMA - you can use another compiler, or potentially even use pre-compiled binaries, but note you might get very slightly reduced performance in some applications.

To install GCC:

To install MSVC:

Note: I am working on supporting additional compilers directly, however they should already work - they just haven't been tested yet

Final Notes

PMMA is still in active development. PLease bear with us as we continue to make changes, and consult the documentation for advise on what features are 'safe to use'!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmma-4.1.4.tar.gz (158.1 kB view details)

Uploaded Source

Built Distribution

pmma-4.1.4-py3-none-any.whl (183.6 kB view details)

Uploaded Python 3

File details

Details for the file pmma-4.1.4.tar.gz.

File metadata

  • Download URL: pmma-4.1.4.tar.gz
  • Upload date:
  • Size: 158.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pmma-4.1.4.tar.gz
Algorithm Hash digest
SHA256 4222bd367c790a7019e4ffe86951561af1268d0cd8ec29513ce101450c1316df
MD5 d6aed1b2dc8fdc5784b1859b1cdea878
BLAKE2b-256 6a79396021ef90cd06e0f0d134a0ad47f081a1342e02d39e69606599de77843d

See more details on using hashes here.

File details

Details for the file pmma-4.1.4-py3-none-any.whl.

File metadata

  • Download URL: pmma-4.1.4-py3-none-any.whl
  • Upload date:
  • Size: 183.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pmma-4.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b767c0187407a8941ebfb2868d7255ffc6b9841abe4d4042d6579e9d44e6d3c8
MD5 0d3c853bb9f414bd5c719818242314a7
BLAKE2b-256 56f062a52f24899f25e6fbba8b53a6078d00990d64a7a5971abdde72b06a31e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page