Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Basic Python binding to macOS' Objective-C Cocoa

Project description

A basic, partial, ctypes-based Python binding to the macOS Objective-C Cocoa runtime and several other macOS libraries.

This is package cocoa-python by Phillip Nguyen (C) 2011, modified, extended, tested, documented and published with permission under both the MIT License and the original New BSD License.

In addition to the pycocoa package, the distribution files contain several tests, some examples and the documentation (generated by Epydoc using command line epydoc --html --no-private --no-source --name=PyCocoa --url=... -v pycocoa).

Examples cocoavlc.py and simple_VLCplayer.py require installation of the VLC App and the corresponding Python-VLC binding.

The tests and examples have only been run with 64-bit Python 2.7.15 and 3.7.0 using Python-VLC 2.2.8, 3.0.1 and 3.0.3 (with the compatible VLC App), but only on macOS 10.13.5 or 10.13.6 High Sierra. PyCocoa has not been tested on iOS nor with 32-bit Python and does not work with PyPy nor with Intel(R) Python.

All PyCocoa source code has been statically checked with PyChecker, PyFlakes, PyCodeStyle (formerly Pep8) and McCabe using 64-bit Python 2.7.15 and with Flake8 using 64-bit Python 3.7.0.

To install PyCocoa, type pip install PyCocoa or easy_install PyCocoa in a terminal window. Alternatively, download PyCocoa-X.Y.Z from PyPI or GitHub, unzip the downloaded file, cd to directory PyCocoa- and type python setup.py install. To run all PyCocoa tests, type python setup.py test before installation.

Some alternatives to PyCocoa are (a) PyObjC, the most comprehensive Python to Objective-C bridge (and included in macOS’ Python), (b) Rubicon-ObjC for Python 3.5+, taking advantage of Python’s new typing annotations and (c) PyGUI for macOS.

Last updated: Aug 16, 2018.

Copyright (C) 2017-2018 -- mrJean1 at Gmail dot com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright (C) 2011 -- Phillip Nguyen -- All Rights Reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of objective-ctypes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
PyCocoa-18.8.16-py2.py3-none-any.whl (152.9 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Aug 20, 2018
PyCocoa-18.8.16.zip (662.6 kB) Copy SHA256 hash SHA256 Source None Aug 20, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page