freshcrate

uamqp

AMQP 1.0 Client Library for Python

Description

# uAMQP for Python [![image](https://img.shields.io/pypi/v/uamqp.svg)](https://pypi.python.org/pypi/uamqp/) [![image](https://img.shields.io/pypi/pyversions/uamqp.svg)](https://pypi.python.org/pypi/uamqp/) [![image](https://dev.azure.com/azure-sdk/public/_apis/build/status/python/azure-uamqp-python%20-%20client?branchName=main)](https://dev.azure.com/azure-sdk/public/_build?definitionId=89) An AMQP 1.0 client library for Python. # Disclaimer This repo is no longer in active maintenance and we plan on deprecating it sometime in the first quarter of 2025. The EventHubs & Service Bus client libraries are now using the python based AMQP library which is under active development. If there is interest in using the new python library as standalone, please share your interest in this [issue](https://github.com/Azure/azure-uamqp-python/issues/374). uAMQP for Python requires Python 3.6+ starting from v1.5, and Python 2.7 is no longer supported. If Python 2.7 is required, please install uAMQP v1.4.3: ``` shell $ pip install uamqp==1.4.3 ``` # Installation Wheels are provided for most major operating systems, so you can install directly with pip: ``` shell $ pip install uamqp ``` If you are running a Linux distro that does not support [ManyLinux1](https://www.python.org/dev/peps/pep-0513) or you need to customize the build based on your system settings and packages, you can install from source: ``` shell $ apt-get update $ apt-get install -y build-essential libssl-dev uuid-dev cmake libcurl4-openssl-dev pkg-config python3-dev python3-pip $ pip3 install uamqp --no-binary :all: ``` If you are running Alpine, you can install from source: ``` shell $ apk add --update python3 py-pip python3-dev cmake gcc g++ openssl-dev build-base $ pip3 install uamqp --no-binary :all: ``` If you are running Red Hat, you can install from source: ``` shell $ yum install cmake gcc gcc-c++ make openssl-devel python3-devel $ pip3 install uamqp --no-binary :all: ``` ## Documentation Reference documentation can be found here: [docs.microsoft.com/python/api/uamqp/uamqp](https://docs.microsoft.com/python/api/uamqp/uamqp). # Developer Setup In order to run the code directly, the Cython extension will need to be build first. ## Pre-requisites - Windows: Setup a [build environment](https://packaging.python.org/guides/packaging-binary-extensions/#building-binary-extensions). - Linux: Install dependencies as descriped above in the installation instructions. - MacOS: Install cmake using Homebrew: ``` shell $ brew install cmake ``` ## Building the extension This project has two C library dependencies. They are vendored in this repository in these versions: - [Azure uAMQP for C](https://github.com/Azure/azure-uamqp-c) @ [2021-11-16](https://github.com/Azure/azure-uamqp-c/tree/259db533a66a8fa6e9ac61c39a9dae880224145f) - [Azure C Shared Utility](https://github.com/Azure/azure-c-shared-utility) @ [2021-11-15](https://github.com/Azure/azure-c-shared-utility/tree/735be16a943c2a9cbbddef0543f871f5bc0e27ab) To build, start by creating a virtual environment and installing the required Python packages: ``` shell $ python -m venv env $ env/Scripts/activate (env)$ pip install -r dev_requirements.txt ``` Next, run the build command: ``` shell $ python setup.py build_ext --inplace ``` ## Tests The tests can be run from within the virtual environment. The extension must be built first using the instructions above. ``` shell (env)$ pytest ``` # Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-uamqp-python/issues) section of the project. # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.microsoft.com>. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact <opencode@microsoft.com> with any additional questions or comments. # Release History ## 1.6.11 (2024-10-28) - Added support for python 3.13 - Updated OpenSSL dependency to 3.0 LTS - Updated Cython dependency to 3.0.11 - Updated Azure uAMQP C and Azure C Shared Utility dependencies ## 1.6.10 (2024-09-11) - Incorporate fixes from [PR](https://github.com/Azure/azure-sdk-for-c

Release History

VersionChangesUrgencyDate
1.6.11Imported from PyPI (1.6.11)Low4/21/2026
v1.6.11* Added support for python 3.13 * Updated OpenSSL dependency to 3.0 LTS * Updated Cython dependency to 3.0.11 * Updated Azure uAMQP C and Azure C Shared Utility dependenciesLow10/28/2024
v1.6.10* Incorporate fixes in to vendored uamqp-c code to use safe mathLow10/22/2024
v1.6.9* Incorporate fixes from [PR](https://github.com/Azure/azure-uamqp-c/commit/30865c9ccedaa32ddb036e87a8ebb52c3f18f695.patch) to use safe math in messages.Low3/20/2024
v1.6.8* Incorporate fixes from https://github.com/Azure/azure-uamqp-c/pull/447Low1/29/2024
v1.6.7* Fixes for CVE-2024-21646Low1/29/2024
v1.6.6* Update to add wheels for python 3.12Low1/29/2024
v1.6.5Starting with this release `uamqp` will not be in active maintenance, as the Event Hubs & Service Bus libraries are now using the python based AMQP library. * Build windows wheels with visual studio 2002 * Few more openssl 3.0 updates at the submodulesLow7/28/2023
v1.6.4* Updated OpenSSL dependency to 1.1.1t * Updated submodules to support OpenSSL 3.0 compilation * Removed dependency on six * Fixed a bug that caused the wrong port to selected for websockets when a port was not passed inLow7/7/2023
v1.6.3Wheels from this release forward have been built with manylinux2014. * Added in support for python 3.11 * Updated OpenSSL dependency to 1.1.1q * Wheels are now built with cibuildwheel for linux, macOS and windowsLow7/7/2023
v1.6.1This will release will be the last with wheels generated with manylinux2010 as it is deprecated. *Added support for handling duplicate certificates in azure-c-shared-utility dependency by using `CERT_STORE_ADD_REPLACE_EXISTING` parameter in the `CertAddEncodedCertificateToStore` function call. (azure-sdk-for-python issue #26034)Low7/7/2023
v1.6.0This version and all future versions will require Python 3.7+, Python 3.6 is no longer supported. * Added data, value, sequence properties to uamqp.Message, which return the body if the body type corresponds. * Added message_annotations property to uamqp.Message, which is an alias for the annotations instance variable. * Added data property to uamqp.BatchMessage, which returns the iterable body of the batch. * Added ttl property to uamqp.MessageHeader, which is an alias for the time_to_livLow7/7/2023
v1.5.3- Updated OpenSSL dependency to 1.1.1n for wheels of manylinux and macOS.Low3/23/2022
v1.5.2- Fixed bug that resulted in an error when deepcopying BatchMessage objects (azure-sdk-for-python issue #22529).Low3/16/2022
v1.5.1- Added back the support for Python 3.6.Low1/12/2022
v1.5.0This version and all future versions will require Python 3.7+, Python 2.7 and Python 3.6 are no longer supported. - `SASTokenAuth`, `JWTTokenAuth`, `SASTokenAsync`, and `JWTTokenAsync` now takes keyword argument `refresh_window` to override default token refresh timing in constructors. - Fixed bug that `SendClientAsync` might run into infinite loop while sending when it is shutdown unexpectedly. - Updated dependencies Azure uAMQP C @ [2021-11-16](https://github.com/Azure/azure-uamqp-c/tree/Low1/5/2022
v1.4.3- Added support for Python 3.10.Low10/7/2021
v1.4.2- Fixed memory leak in win32 socketio and tlsio (azure-sdk-for-python issue #19777). - Fixed memory leak in the process of converting AMQPValue into string (azure-sdk-for-python issue #19777).Low9/21/2021
v1.4.1- Fixed bug that JWTTokenAuth and JWTTokenAsync do not initialize token for token types other than b'jwt'. - Fixed bug that attibutes `creation_time`, `absolute_expiry_time` and `group_sequence` on `MessageProperties` should be compatible with integer types on Python 2.7.Low7/7/2021
v1.4.0This version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported. - Fixed memory leaks in the process of link attach where source and target cython objects are not properly deallocated (azure-sdk-for-python issue #15747). - Improved management operation callback not to parse description value of non AMQP_TYPE_STRING type as string (azure-sdk-for-python issue #18361).Low5/3/2021
v1.3.0This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+. - Added support for AMQP Sequence as the body type of an amqp message. - Added new class `uamqp.MessageBodyType` to represent the body type of an amqp message, including: - `Data`: The body consists of one or more data sections and each section contains opaque binary data. - `Sequence`: The body consists of one or more sequence sections and each section coLow4/5/2021
v1.2.15- Added desired-capabilities for `SendClient(Async)` and `MessageSender(Async)` as part of the AMQP protocol. - Added types for AMQPShort and AMQPuShort for explicit handling of short and unsigned short encoding.Low3/2/2021
v1.2.14- Updated Azure uAMQP C and Azure C Shared Utility dependencies. - Fixed memory leak with SAS Token creation.Low2/10/2021
v1.2.13- Fixed bug in accessing `MessageProperties.user_id` triggering segmentation fault when the underlying C bytes are NULL. - Fixed bug in `MessageProperties.user_id` being limited to 8 bytes. - Fixed bug where connection establishment on macOS with Clang 12 triggering unrecognized selector exception. - Fixed bug that macOS was unable to detect network error. - Fixed bug that `ReceiveClient` and `ReceiveClientAsync` receive messages during connection establishment.Low1/6/2021
v1.2.12- Updated cython dependency to 0.29.21. - Added support for Python 3.9.Low10/9/2020
v1.2.11- Updated tlsio_openssl module to send SNI when establishing tls connection (Thanks to milope). - Fixed bug where `Message.footer` and `Message.delivery_annotation` were not encoded into the outgoing payload. - Fixed bug where message sending timeout error didn't get raised out.Low10/2/2020
v1.2.10- Added parameter `shutdown_after_timeout` to `ReceiveClient` and `ReceiveClientAsync` which gives control over whether to shutdown receiver after timeout.Low8/5/2020
v1.2.9- Added method `MessageReceiver.reset_link_credit` which is responsible for resetting current available link credit on the receiver link and send update to the sender.Low7/6/2020
v1.2.8- Fix to initialize delivery_count header at 0 instead of None (azure-sdk-for-python issue #9708) - Added info fields to rejected delivery disposition.Low5/21/2020
v1.2.7- Fixed bug in setting certificate of tlsio on MacOS (azure-sdk-for-python issue #7201). - Fixed seg fault in logging network tracing on MacOS (PR#147, Thanks to malthe). - Fixed typos in log messages (PR#146, Thanks to bluca). - Imrpoved reproducibility of the generated c_uamqp.c file (PR#144, Thanks to bluca).Low5/21/2020
v1.2.6- Fixed seg fault in tearing down a failed link with unsent pending messages.Low2/14/2020
v1.2.5- Fixed garbage collection of C objects to prevent crashing on uncontrolled shutdown. - Fixed missing event loop references passed into asyncio functions. - Fixed bug in noneffective flow control when large messages are received. - Demote link redirect logging from warning to info.Low12/11/2019
v1.2.4- Fixed bug in calculating send timeout. - Removed ThreadPoolExecutor in ConnectionAsync. - Added support for Python 3.8Low12/3/2019
v1.2.3- Fixed bug in dropping received messages at the moment when the connection just started working. - Fixed bug where underlying io type wasn't set to WebSocket when http_proxy was applied (PR#92, Thanks to skoop22). - Fixed bug in noneffective timeout when sending messages. - Added desired-capabilities for `ReceiveClient(Async)` and `MessageReceiver(Async)` as part of the AMQP protocol. - Added delivery-tag to `Message` (azure-sdk-for-python issue #7336). - Added method `work` to `MessageRecLow10/9/2019
v1.2.2- Made bug fix in asyncio.get_event_loop backwards-compatible for now by just printing a warning rather than raising an error. In the next major version bump we can disable entirely.Low8/7/2019
v1.2.1- Updated the implementation of `update_token()` in `JWTTokenAuth` and `JWTTokenAsync` (issue #80).Low8/7/2019
v1.2.0- Fixed bug in batched messages missing application_properties (azure-event-hubs-python issue #97). - Fixed bug in datetime object parsing (issue #63). - Fixed bug in unexposed send/receive settle modes. - Fixed bug where retried messages were not added back to the send queue. - Fixed bug in using asyncio.get_event_loop. - Added type objects for AMQP Byte and uBytes types. - Added async locking around pending messages queue (PR#54, Thanks to zach-b) - Added WebSocket(AMQP over WebSocket) Low8/7/2019
v1.1.0- Support for Python 2.7 - Where ever a `TimeoutError` is raised in Python 3.x, this will be replaced with a new ~uamqp.errors.ClientTimeout exception in Python 2.7. - A Python 2 `str` object will be treated as `bytes` in Python 3 and a Python 2 `unicode` object will be treated like a Python 3 `str`. - Added uamqp.compat module for handling Py 2 vs 3 imports and types (PR#46, Thanks to maxkrivich). - AMQP encoding of an integer type will now automatically failover into a Long tLow11/13/2018
v1.1.0rc2In addition to the updates in RC1: - Support for Python 2.7: - Added uamqp.compat module for handling Py 2 vs 3 imports and types (PR#46, Thanks to maxkrivich). - AMQP encoding of an integer type will now automatically failover into a Long type or a double type if the value is too large. - Improved support for promptly detecting invalid ATTACH handles and raising the appropriate error. - Added types for AMQPInt and AMQPuInt for explicit handling of int and unsigned int encoding. - Low10/19/2018
v1.1.0rc1- Support for Python 2.7 - Where ever a `TimeoutError` is raised in Python 3.x, this will be replaced with a new `ClientTimeout` exception in Python 2.7. - A Python 2 `str` object will be treated as `bytes` in Python 3 and a Python 2 `unicode` object will be treated like a Python 3 `str`. - Added new error `AMQPClientShutdown` as a wrapper for `KeyboardInterrupt` to better handle interrupt handling. - Added better handling of keyboard interrupts during C callbacks to better facilLow9/28/2018
v1.03- Reduced CPU load during idle receive (issue #38). - Updated Azure uAMQP C and Azure C Shared Utility dependencies. Low9/14/2018
v1.0.2- Fixed additional bugs in setting MessageProperties as string or bytes. - Removed auth locking to prevent locking issues on keyboard interrupt.Low9/10/2018
v1.0.1Bug fix release to address some reported issues: - Added some more checks in place to prevent lock hanging on a keyboard interrupt. (issue #30) - Fixed bug in setting MessageProperties.subject as string or bytes. (issue #35) - Added missing return value to `uamqp.send_message`, which now returns a list of `uamqp.constants.MessageState` to indicate the success of each message sent.Low8/30/2018
v1.0.0API is now stable! No breaking changes in this release but a few behavioural changes: - When a SendClient or SendClientAsync is shutdown, any remaining pending messages (that is messages in the states WaitingToBeSent and WaitingForSendAck) will no longer be cleared, but can be retrieved from a new attribute SendClient.pending_messages in order to be re-processed as needed. - The function SendClient.queue_message now allows for queueing multiple messages at once by simply passing in additionLow8/22/2018
v0.2.1Some stability improvements in the bindings. - Fixed potential crashing in bindings for amqpvalue. - Fixed bindings fault in cbs PUT token complete callback. - Added additional auth and connection locking for thread/async safety. - Increased INFO level logging. - Added handling for a connection reaching a client-caused error state.Low8/7/2018
v0.2.0Some internal breaking changes to the MessageSender/MessageReceiver classes and their async equivalents. New features: - Optional keep-alive background process for keep unused connections active. - Added ability to supply an ErrorPolicy to a client to determine how the client should handle a vendor specific error occurring in either a message disposition, link detach or connection close event. - Now parsing standard AMQP errors for retryability - and surfacing error details to the user. - ALow7/26/2018
v0.1.1Bug fix release: - Removed circular dependency in Python 3.4 with types.py/utils.py - When a header properties is not set, returns `None` rather than raising ValueError. - Fixed bug in receiving messages with application properties.Low7/14/2018
v0.1.0First stable release! No breaking changes - only bug fixes. For all changes, please see the [release notes](https://github.com/Azure/azure-uamqp-python/blob/master/HISTORY.rst).Low7/6/2018
v0.1.0rc2**Breaking changes** - This release includes a restructure to support Python 3.7. The `async` submodule has been renamed and all classes within it can now be imported directly from `uamqp` or `uamqp.authentication`. - Anything returned by a callback supplied to receive messages will now be ignored. - Changed message state enum values: - `Complete -> SendComplete` - `Failed -> SendFailed` - `WaitingForAck -> WaitingForSendAck` - Changes to message settlement exceptions: Low7/2/2018
v0.1.0rc1- Fixed import error in async receiver. - Exposed sender/receiver destroy function. - Moved receiver.open on_message_received argument to constructor. - Removed sasl module and moved internal classes into authentication module. - Added encoding parameter everywhere where strings are encoded. - Started documentation. - Updated uAMQP-C to 1.2.4 and C Shared Utility to 1.1.4 (includes fix for issue #12). - Fixed return type of MgmtOperation.execute - now returns ~uamqp.Message. - Made AMQP Low5/29/2018
v0.1.0b5- Fixed dynamic cert reference for OpenSSL. Now install ca-certificates on Linux is no longer required.Low4/27/2018

Dependencies & License Audit

Loading dependencies...

Similar Packages

azure-coreMicrosoft Azure Core Library for Pythonazure-template_0.1.0b6187637
azure-mgmt-coreMicrosoft Azure Management Core Library for Pythonazure-template_0.1.0b6187637
azure-monitor-opentelemetry-exporterMicrosoft Azure Monitor Opentelemetry Exporter Client Library for Pythonazure-template_0.1.0b6187637
azure-servicebusMicrosoft Azure Service Bus Client Library for Pythonazure-template_0.1.0b6187637
azure-monitor-opentelemetryMicrosoft Azure Monitor Opentelemetry Distro Client Library for Pythonazure-template_0.1.0b6187637