Access Objective-C classes from Python
Go to file
Akshay Arora 573bd69b85 Merge branch 'misl6-fix/args-no-frame' 2024-10-04 13:14:03 +05:30
.github/workflows Merge pull request #119 from kivy/renovate/softprops-action-gh-release-2.x 2024-09-24 12:50:24 +05:30
docs Update dependency furo to v2024.8.6 2024-09-24 07:03:45 +00:00
examples docs: Fix a few typos (#83) 2021-12-26 09:44:16 +01:00
objc_classes Disable -Wincompatible-function-pointer-types in testlib 2024-10-04 12:50:28 +05:30
pyobjus Update pyobjus.pyx 2024-09-24 21:52:42 +05:30
tests Merge pull request #66 from Mulugruntz/fix-objcarr-crash-if-empty 2020-10-20 15:19:10 -04:00
tools fix protocol parsing and update protocols 2016-04-10 15:31:24 -05:00
.gitignore
.readthedocs.yaml Add (now mandatory) .readthedocs.yaml file, add docs requirements.txt and update sphinx conf (#103) 2023-10-20 18:32:00 +02:00
LICENSE Update copyright year 2017-08-11 21:38:21 +02:00
MANIFEST.in Switch to GitHub actions with automatic deployment (#71) 2020-11-04 20:45:58 -05:00
Makefile Improved Apple Silicon support (variadic functions) + add tests on apple-silicon-m1 (self hosted runner) (#85) 2022-03-26 13:57:26 +01:00
README.md Add Discord and remove IRC from support channels (#94) 2023-05-13 11:30:35 +02:00
pyproject.toml Add pyproject.toml (#69) 2020-09-05 16:52:17 -04:00
renovate.json Add renovate.json (#110) 2024-05-25 11:47:19 +02:00
setup.py Remove support for Python 3.7 as reached EOL (#108) 2024-05-25 11:38:20 +02:00

README.md

Pyobjus

Python module for accessing Objective-C classes as Python classes using Objective-C runtime reflection.

Build Status Backers on Open Collective Sponsors on Open Collective

Quick overview


from pyobjus import autoclass, objc_str
from pyobjus.dylib_manager import load_framework, INCLUDE

# load AppKit framework into pyojbus
load_framework(INCLUDE.AppKit)

# get nsalert class
NSAlert = autoclass('NSAlert')

# create an NSAlert object, and show it.
alert = NSAlert.alloc().init()
alert.setMessageText_(objc_str('Hello world!'))
alert.runModal()

Support

If you need assistance, you can ask for help on our mailing list:

We also have a Discord server:

https://chat.kivy.org/

Contributing

We love pull requests and discussing novel ideas. Check out our contribution guide and feel free to improve Pyobjus.

The following mailing list and IRC channel are used exclusively for discussions about developing the Kivy framework and its sister projects:

Discord channel:

License

Pyobjus is released under the terms of the MIT License. Please refer to the LICENSE file.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]