{"id":19973264,"url":"https://github.com/zeromq/pyczmq","last_synced_at":"2025-05-04T02:31:47.863Z","repository":{"id":11063623,"uuid":"13405502","full_name":"zeromq/pyczmq","owner":"zeromq","description":"Python CZMQ bindings","archived":false,"fork":false,"pushed_at":"2017-09-02T15:56:15.000Z","size":182,"stargazers_count":31,"open_issues_count":7,"forks_count":18,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-08T01:35:02.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeromq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-08T06:41:16.000Z","updated_at":"2023-04-18T04:29:06.000Z","dependencies_parsed_at":"2022-09-03T23:50:42.774Z","dependency_job_id":null,"html_url":"https://github.com/zeromq/pyczmq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fpyczmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fpyczmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fpyczmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fpyczmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeromq","download_url":"https://codeload.github.com/zeromq/pyczmq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252278956,"owners_count":21722793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T03:10:49.819Z","updated_at":"2025-05-04T02:31:47.600Z","avatar_url":"https://github.com/zeromq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pyczmq\nPyczmq is a Python wrapper around the CZMQ zeromq bindings.\n\n[![Build Status](https://travis-ci.org/zeromq/pyczmq.png?branch=master)](https://travis-ci.org/zeromq/pyczmq)\n\n## Overview\n\nPyczmq exposes CZMQ functions via the cffi library's ABI access mode.  No compiler is required to use it.  The czmq library is accessed with dlopen and a set of parsed function declarations.\n\nThis is still a work in progress, not all of the API is fully wrapped yet. Most of the core context, socket, socket option, polling, beacon, auth, and cert functions are provided. Some functions will probably not be wrapped, notably those that provide duplicate functionality to built-in python type or libraries like zlist, zhash, zsys, zclock, zdir, etc.\n\n\n## Building and Installing\n\nThere are two methods for installing pyczmq.\n\n### Option 1 - Use the Cheese Shop\n\nThis is the easiest option for most users. If you have all the dependencies then it is as simple as:\n\n    [sudo] pip install pyczmq\n\nNOTE: This version may not be as up to date as the Github master.\n\n\n### Option 2 - Use Github\n\nThis option would typically be used by users and contributing developers who want access to the most up to date version.\n\n\n#### Dependencies\n\nOn Ubuntu you need the following packages (Other OSes may use a different package name) which are typicall installed using 'sudo apt-get install _package_':\n\n    libffi-dev\n    python-dev\n    python-virtualenv\n\nThe following Python packages are required which are typically installed using 'sudo pip install _package_':\n\n    cffi\n    nose\n\nLibsodium provides security for ZMQ:\n\n    git clone git://github.com/jedisct1/libsodium.git\n    cd libsodium\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\nThe ZMQ core library:\n\n    git clone git://github.com/zeromq/libzmq.git\n    cd libzmq\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\nThe high-level CZMQ library:\n\n    git clone git://github.com/zeromq/czmq.git\n    cd czmq\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\n\n#### Pyczmq Installation\n\n    git clone git://github.com/zeromq/pyczmq.git\n    cd pyczmq\n    sudo python setup.py install\n\n\n#### Testing\n\nThe pyczmq tests are run using the *nose* testing package. The tests are run from the top level pyczmq directory using:\n\n    nosetests [-v]\n\n\nTo report an issue, use the [Pyczmq issue tracker](https://github.com/zeromq/pyczmq/issues) at github.com.\n\n## Details\n\nAll CZMQ functions can be accessed directly via the low-level cffi\nbinding, ie:\n\n  - pyczmq.C.zctx_new\n\n  - pyczmq.C.zsocket_bind\n\n  - pyczmq.C.zstr_send\n\n  - etc...\n\nFunctions also have aliases in a module level namespace interface, so:\n\n  - pyczmq.C.zctx_new is pyczmq.zctx.new (with caveat, see below)\n\n  - pyczmq.C.zsocket_bind is pyczmq.zsocket.bind\n\n  - pyczmq.C.zstr_send is pyczmq.zstr.send\n\n  - etc...\n\nFor example a simple PUSH/PULL socket pipeline::\n\n    from pyzmq import zctx, zsocket, zstr, zmq\n\n    ctx = zctx.new()\n    push = zsocket.new(ctx, zmq.PUSH)\n    pull = zsocket.new(ctx, zmq.PULL)\n    zsocket.bind(push, 'inproc://test')\n    zsocket.connect(pull, 'inproc://test')\n    zstr.send(push, 'foo')\n    assert zstr.recv(pull) == 'foo'\n    zstr.send(push, 'foo')\n    zsocket.poll(pull, 1)\n    assert zstr.recv_nowait(pull) == 'foo'\n\nSome of the 'new' functions in the module namespaces (like pyczmq.zctx.new) are wrappers that plug into Python's garbage collector, so you typically never need to explicitly destroy objects if you use the namespace interface.\n\nTherefore, pyczmq.zctx.new isn't *really* pyczmq.C.zmq_new, but the effect is exactly the same.  If you use the \"raw\" C binding interface pyczmq.C.zctx_new, however, you must explicitly garbage collect your own resources by calling the coresponding destroy method (pyczmq.C.zctx_destroy, etc.).\n\nSome 'new' functions do not do this wrapping behavior, because they are meant to be destroyed by czmq. zmsg objects for example are destroyed by zmsg_send, and zframe objects have their ownership taken over by various functions in zmsg and are destroyed when the msg is sent and destroyed.  If you create these objects and don't in turn call the functions that destroy them, you must explicitly destroy them yourself with zmsg.destroy or zframe.destroy.\n\n\n## API Documentation\n\nThe documentation for this binding can be found at readthedocs:\n\n    http://pyczmq.readthedocs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Fpyczmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeromq%2Fpyczmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Fpyczmq/lists"}