{"id":15096918,"url":"https://github.com/apache/pulsar-client-python","last_synced_at":"2025-04-05T13:03:20.112Z","repository":{"id":60477002,"uuid":"542858730","full_name":"apache/pulsar-client-python","owner":"apache","description":"Apache Pulsar Python client library","archived":false,"fork":false,"pushed_at":"2025-03-27T01:47:18.000Z","size":842,"stargazers_count":60,"open_issues_count":72,"forks_count":43,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-03-29T12:03:31.062Z","etag":null,"topics":["event-streaming","messaging","pubsub","pulsar","queuing","streaming"],"latest_commit_sha":null,"homepage":"https://pulsar.apache.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-29T01:10:23.000Z","updated_at":"2025-03-27T02:58:13.000Z","dependencies_parsed_at":"2023-02-19T12:31:39.525Z","dependency_job_id":"ef1c0253-5ec9-4ff0-9d0f-df391f70b8c6","html_url":"https://github.com/apache/pulsar-client-python","commit_stats":{"total_commits":296,"total_committers":79,"mean_commits":"3.7468354430379747","dds":0.7060810810810811,"last_synced_commit":"c3c12c416b00943d03929457c026a6fde8296e00"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/pulsar-client-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339149,"owners_count":20923014,"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":["event-streaming","messaging","pubsub","pulsar","queuing","streaming"],"created_at":"2024-09-25T16:02:23.442Z","updated_at":"2025-04-05T13:03:20.098Z","avatar_url":"https://github.com/apache.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n\n--\u003e\n\n# Pulsar Python client library\n\nPulsar Python clients support a variety of Pulsar features to enable building applications connecting to your Pulsar cluster. For the supported Pulsar features, see [Client Feature Matrix](https://pulsar.apache.org/client-feature-matrix/).\n\n## Requirements\n\n- Python 3.9, 3.10, 3.11, 3.12 or 3.13\n- A C++ compiler that supports C++11\n- CMake \u003e= 3.18\n- [Pulsar C++ client library](https://github.com/apache/pulsar-client-cpp)\n- [PyBind11](https://github.com/pybind/pybind11)\n\nPyBind11 is a header-only library and a submodule, so you can simply download the submodule so that CMake can find this dependency.\n\n```bash\ngit submodule update --init\n```\n\nYou can also download the pybind11 directly like:\n\n```bash\npip3 install pyyaml\nexport PYBIND11_VERSION=$(./build-support/dep-version.py pybind11)\ncurl -L -O https://github.com/pybind/pybind11/archive/refs/tags/v${PYBIND11_VERSION}.tar.gz\ntar zxf v${PYBIND11_VERSION}.tar.gz\nmv pybind11-${PYBIND11_VERSION} pybind11\n```\n\nAfter that, you only need to install the Pulsar C++ client dependency into the system path. You can [install the pre-built binaries](https://pulsar.apache.org/docs/next/client-libraries-cpp/#installation) or [build from source](https://github.com/apache/pulsar-client-cpp#compilation).\n\n## Install the Python wheel\n\nMake sure the PyBind11 submodule has been downloaded and the Pulsar C++ client has been installed. Then run the following commands:\n\n```bash\ncmake -B build\ncmake --build build\ncmake --install build\npython3 ./setup.py bdist_wheel\npython3 -m pip install dist/pulsar_client-*.whl --force-reinstall\n```\n\n\u003e **NOTE**\n\u003e\n\u003e 1. The separate `build` directory is created to store all CMake temporary files. However, the `setup.py` requires the `_pulsar.so` to be under the project directory.\n\u003e 2. Add the `--force-reinstall` option to overwrite the existing Python wheel in case your system has already installed a wheel before.\n\u003e 3. On Windows, the Python command is `py` instead of `python3`.\n\n## Running examples\n\nYou can run `python3 -c 'import pulsar'` to see whether the wheel has been installed successfully. If it fails, check whether dependencies (e.g., `libpulsar.so`) are in the system path. If not, make sure the dependencies are in `LD_LIBRARY_PATH` (on Linux) or `DYLD_LIBRARY_PATH` (on macOS).\n\nThen you can run examples as a simple end-to-end test.\n\n```bash\n# In terminal 1\npython3 ./examples/consumer.py\n```\n\n```bash\n# In terminal 2\npython3 ./examples/producer.py\n```\n\nBefore executing the commands above, you must ensure the Pulsar service is running. See [here](https://pulsar.apache.org/docs/getting-started-standalone) for quick start.\n\n## Unit tests\n\nBefore running the unit tests, you must run a Pulsar service with all things set up:\n\n```bash\n./build-support/pulsar-test-service-start.sh\n```\n\nThe command above runs a Pulsar standalone in a Docker container. You can run `./build-support/pulsar-test-service-stop.sh` to stop it.\n\nRun all unit tests:\n\n```bash\n./tests/run-unit-tests.sh\n```\n\nRun a single unit test (e.g., `PulsarTest.test_tls_auth`):\n\n```bash\npython3 ./tests/pulsar_test.py 'PulsarTest.test_tls_auth'\n```\n\n## Generate API docs\n\nPulsar Python Client uses [pydoctor](https://github.com/twisted/pydoctor) to generate API docs. To generate by yourself, you need to install the Python library first. Then run the following command in the root path of this repository:\n\n```bash\nsudo python3 -m pip install pydoctor\ncp $(python3 -c 'import _pulsar, os; print(_pulsar.__file__)') ./_pulsar.so\npydoctor --make-html \\\n  --docformat=numpy --theme=readthedocs \\\n  --intersphinx=https://docs.python.org/3/objects.inv \\\n  --html-output=\u003cpath-to-apidocs\u003e \\\n  --introspect-c-modules \\\n  ./_pulsar.so \\\n  pulsar\n```\n\nThen the index page will be generated in `\u003cpath-to-apidocs\u003e/index.html`.\n\n## Contribute\n\nWe welcome contributions from the open source community!\n\nIf your contribution adds Pulsar features for Python clients, you need to update both the [Pulsar docs](https://pulsar.apache.org/docs/client-libraries/) and the [Client Feature Matrix](https://pulsar.apache.org/client-feature-matrix/). See [Contribution Guide](https://pulsar.apache.org/contribute/site-intro/#pages) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fpulsar-client-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fpulsar-client-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fpulsar-client-python/lists"}