Skip to main content

Lightweight minimalistic Ara framework

Project description

Ara_core

Ara.Core is a lightweight Python framework for building interactive applications with GLFW. It provides an easy way to manage windows, handle input, integrate modules, and run the main loop with logging and error handling out of the box.


Features

Window Management – Create and control an OpenGL context window.

Input Handling – High-level API for keyboard and mouse state:

pressed, down, and up queries for keys and mouse buttons

Cursor locking, movement delta, and scroll tracking

Module System – Plug in custom modules with lifecycle methods:

init(), process_input(), render(), update(), terminate()

Timing Utilities – Frame delta (dt), elapsed time, and FPS measurement.

Logging – Integrated logging system with configurable levels.

Callbacks – Flexible frame_ui, callback, and terminate hooks in the main loop.


Quick Start

from ara_core import App

# Create application instance
app = App(title="My First App", width=1280, height=720, log_level="info")

def frame_ui(app):
    print("UI frame")

def callback(app):
    print(f"Frame time: {app.dt()}")

def terminate(app):
    print("Cleanup done!")

# Run with custom callbacks
app.run(frame_ui, callback, terminate)

Input API

app.key_pressed("w")      # True while 'W' is held
app.key_down("space")     # True only on the frame space was pressed
app.key_up("escape")      # True only on the frame escape was released

app.mouse_button_pressed("left")
pos = app.get_mouse_pos()
dx, dy = app.get_mouse_delta()
scroll = app.get_mouse_scroll()

Module System

Modules can be classes or instances. They may implement any of the lifecycle methods:

class ExampleModule:
    def __init__(self, app): self.app = app
    def init(self): print("Module initialized")
    def process_input(self): pass
    def render(self): pass
    def update(self): pass
    def terminate(self): print("Module terminated")

app.add_module(ExampleModule)

Utilities

app.close() – close the window

app.time() – elapsed time since start

app.dt() – delta time of last frame

app.fps() – current frames per second


Requirements

Python 3.8+

GLFW

Ara_log

Install dependencies:

pip install glfw, pyopengl, ara_log


License

MIT License. Feel free to use and modify for your projects.

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

ara_core-1.0.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ara_core-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file ara_core-1.0.0.tar.gz.

File metadata

  • Download URL: ara_core-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ara_core-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7db98278f8adde0372e83ddde50898646d6f17833d417efeac6de0b2ef942798
MD5 f03e16421163a8ecc795cd7d42fee67b
BLAKE2b-256 990d5ed4859f2c2627ad91298a3f24b52db4b661b76cd8f60f1138e7b1779f87

See more details on using hashes here.

File details

Details for the file ara_core-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ara_core-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ara_core-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a0d206519f6f1286bb2ebef252dea466526647f867f952bda25dfc2e00312f3
MD5 bea6ee3c1131d8e09674fc11f9ecb46d
BLAKE2b-256 3b67d8e69b393f9062f3f4aaed304d6340bae7da06f3fe0070c5443af84694f8

See more details on using hashes here.

Supported by

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