Skip to main content

AMQP 1.0 Client Library for Python

Project description

uAMQP for Python

An AMQP 1.0 client library for Python.

Installation

Wheels are provided for most major operating systems, so you can install directly with pip:

$ pip install uamqp

If you are running a Linux distro that does not support ManyLinux1, you can install from source:

$ 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

Python 2.7 support

Coming soon…

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.

  • Linux: Install dependencies as descriped above in the installation instructions.

  • MacOS: Install cmake using Homebrew:

$ brew install cmake

Building the extension

This project has two C library dependencies. They are vendored in this repository in these versions:

To build, start by creating a virtual environment and installing the required Python packages:

$ python -m venv env
$ env/Scripts/activate
(env)$ pip install -r dev_requirements.txt

Next, run the build command:

$ python setup.py built_ext --inplace

Tests

The tests can be run from within the virtual environment. The extension must be built first using the instructions above.

(env)$ pytest

Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the 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. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Release History

0.1.0 (2018-07-05)

  • Fixed bug in error handling for CBS auth to invalid hostname.

  • Changed C error logging to debug level.

  • Bumped uAMQP C version to 1.2.7

  • Fixed memory leaks and deallocation bugs with Properties and Annotations.

0.1.0rc2 (2018-07-02)

  • Breaking change Submodule async has been renamed to the internal _async. All asynchronous classes in the submodule can now be accessed from uamqp or uamqp.authentication directly.

  • Breaking change Anything returned by a callback supplied to receive messages will now be ignored.

  • Breaking change Changed message state enum values:

    • Complete -> SendComplete

    • Failed -> SendFailed

    • WaitingForAck -> WaitingForSendAck

  • Added new message state enum values:

    • ReceivedUnsettled

    • ReceivedSettled

  • Breaking change Changes to message settlement exceptions:

    • Combined the AbandonMessage and DeferMessage exceptions as MessageModified to be in keeping with the AMQP specification.

    • Renamed AcceptMessage to MessageAccepted.

    • Renamed RejectMessage to MessageRejected which now takes condition and description arguments rather than message.

  • Added errors.LinkDetach exception as new subclass of AMQPConnectionError as a wrapped for data in a Link DETACH dispostition.

  • Added errors.LinkRedirect as a specific subclass of LinkDetach to decode the specific redirect fields of a Link Redirect response.

  • Added errors.MessageAlreadySettled exception for operations performed on a received message that has already returned a receipt dispostition.

  • Added errors.MessageReleased exception.

  • Added errors.ErrorResponse exception.

  • A received Message can now be explicitly settled through a set of new functions on the message:

    • Message.accept()

    • Message.reject(condition:str, description:str)

    • Message.release()

    • Message.modify(failed:bool, deliverable:bool, annotations:dict)

  • Added explicit auto_complete argument to ReceiveClient and ReceiveClientAsync. If auto_complete is set to False then all messages must be explicitly “accepted” or “rejected” by the user otherwise they will timeout and be released. The default is True, which is the exiting behaviour for each receive mechanism:

    • Received messages processed by callback (ReceiveClient.receive_messages()) will be automatically “accepted” if no explicit response has been set on completion of the callback.

    • Received messages processed by batch (ReceiveClient.receive_message_batch()) will by automatically “accepted” before being returned to the user.

    • Received messages processed by iterator (ReceiveClient.receive_message_iter()) will by automatically “accepted” if no explicit response has been set once the generator is incremented.

  • Added new methods to clients and connections to allow to redirect to an alternative endpoint when a LinkRedirect exception is raised. The client redirect helper cannot be used for clients that use a shared connection - the clients must be closed before the connection can be redirected. New credentials must be supplied for the new endpoint. The new methods are:

    • uamqp.Connection.redirect(redirect_info, auth)

    • uamqp.async.ConnectionAsync.redirect_async(redirect_info, auth)

    • uamqp.SendClient.redirect(redirect_info, auth)

    • uamqp.ReceiveClient.redirect(redirect_info, auth)

    • uamqp.async.SendClientAsync.redirect_async(redirect_info, auth)

    • uamqp.async.ReceiveClientAsync.redirect_async(redirect_info, auth)

  • Added on_detach_received argument to Sender and Receiver classes to pass in callback to run on Link DETACH.

  • Removed automatic char encoding for strings of length 1, and added types.AMQPChar for explicit encoding.

  • Bumped uAMQP C version to 1.2.5

  • Bumped Azure C Shared Utility to 1.1.5

  • Fixed memory leaks in MessageProperties, MessageHeader and message annotations.

0.1.0rc1 (2018-05-29)

  • 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.Message.

  • Made AMQP connection/session/sender/receiver types in a client overridable.

  • Added debug trace to management operations.

  • Fixed error in management callback on failed operation.

  • Default AMQP encoding of bytes is now a String type and a bytearray is a Binary type.

  • Added AMQP Array type and fixed Long type range validation.

  • Added header argument to Message and BatchMessage for setting a MessageHeader.

  • Fixed MessageHeader attribute setters.

0.1.0b5 (2018-04-27)

  • Added Certifi as a depedency to make OpenSSL certs dynamic.

  • Added verify option to authentication classes to allow setting custom certificate path (for Linux and OSX).

0.1.0b4 (2018-04-19)

  • Fixed memory leak in async receive.

  • Removed close_on_done argument from client receive functions.

  • Added receive iterator to synchronous client.

  • Made async iter receive compatible with Python 3.5.

0.1.0b3 (2018-04-14)

  • Fixed SSL errors in manylinux wheels.

  • Fixed message annoations attribute.

  • Fixed bugs in batched messages and sending batched messages.

  • Fixed conflicting receiver link ID.

  • Fixed hanging receiver by removing queue max size in sync clients.

  • Added support for sending messages with None and empty bodies.

0.1.0b2 (2018-04-06)

  • Added message send retry.

  • Added timeouts and better error handling for management requests.

  • Improved connection and auth error handling and error messages.

  • Fixed message annotations type.

  • SendClient.send_all_messages() now returns a list of message send statuses.

  • Fixed OpenSSL platform being initialized multiple times.

  • Fixed auto-refresh of SAS tokens.

  • Altered receive_batch behaviour to return messages as soon as they’re available.

  • Parameter batch_size in receive_batch renamed to max_batch_size.

  • Fixed message application_properties decode error.

  • Removed MacOS dependency on OpenSSL and libuuid.

0.1.0b1 (2018-03-24)

  • Added management request support.

  • Fixed message-less C operation ValueError.

  • Store message metadata in Python rather than C.

  • Refactored Send and Receive clients to create a generic parent AMQPClient.

  • Fixed None receive timestamp bug.

  • Removed async iterator queue due to instabilities - all callbacks are now synchronous.

0.1.0a3 (2018-03-19)

  • Added support for asynchronous message receive by iterator or batch.

  • Removed synchronous receive iterator, and replaced with synchronous batch receive.

  • Added sync and async context managers for Send and Receive Clients.

  • Fixed token instability and added put token retry policy.

  • Exposed Link ATTACH properties.

  • A connection now has a single $cbs session that can be reused between clients.

  • Added C debug trace logging to the Python logger (‘uamqp.c_uamqp’)

0.1.0a2 (2018-03-12)

  • Exposed OPEN performative properties for connection telemetry.

  • Exposed setters for message.message_annotations and message.application_properties.

  • Made adjustments to connection open and close to facilitate sharing a connection object between send/receive clients.

  • Support for username/password embedded in connection URI.

  • Clients can now optionally leave connection/session/link open for re-use.

  • Updated build process and installation instructions.

  • Various bug fixes to increase stability.

0.1.0a1 (2018-03-04)

  • Initial release

Project details


Download files

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

Source Distribution

uamqp-0.1.0.tar.gz (5.1 MB view details)

Uploaded Source

Built Distributions

uamqp-0.1.0-cp37-cp37m-win_amd64.whl (768.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

uamqp-0.1.0-cp37-cp37m-win32.whl (689.3 kB view details)

Uploaded CPython 3.7m Windows x86

uamqp-0.1.0-cp37-cp37m-manylinux1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.7m

uamqp-0.1.0-cp37-cp37m-manylinux1_i686.whl (2.5 MB view details)

Uploaded CPython 3.7m

uamqp-0.1.0-cp37-cp37m-macosx_10_6_intel.whl (2.0 MB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

uamqp-0.1.0-cp36-cp36m-win_amd64.whl (768.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

uamqp-0.1.0-cp36-cp36m-win32.whl (694.5 kB view details)

Uploaded CPython 3.6m Windows x86

uamqp-0.1.0-cp36-cp36m-manylinux1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.6m

uamqp-0.1.0-cp36-cp36m-manylinux1_i686.whl (2.5 MB view details)

Uploaded CPython 3.6m

uamqp-0.1.0-cp36-cp36m-macosx_10_6_intel.whl (2.0 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

uamqp-0.1.0-cp35-cp35m-win_amd64.whl (765.6 kB view details)

Uploaded CPython 3.5m Windows x86-64

uamqp-0.1.0-cp35-cp35m-win32.whl (687.6 kB view details)

Uploaded CPython 3.5m Windows x86

uamqp-0.1.0-cp35-cp35m-manylinux1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.5m

uamqp-0.1.0-cp35-cp35m-manylinux1_i686.whl (2.5 MB view details)

Uploaded CPython 3.5m

uamqp-0.1.0-cp35-cp35m-macosx_10_6_intel.whl (2.0 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

uamqp-0.1.0-cp34-cp34m-win_amd64.whl (763.8 kB view details)

Uploaded CPython 3.4m Windows x86-64

uamqp-0.1.0-cp34-cp34m-win32.whl (684.0 kB view details)

Uploaded CPython 3.4m Windows x86

uamqp-0.1.0-cp34-cp34m-manylinux1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.4m

uamqp-0.1.0-cp34-cp34m-manylinux1_i686.whl (2.5 MB view details)

Uploaded CPython 3.4m

uamqp-0.1.0-cp34-cp34m-macosx_10_6_intel.whl (2.0 MB view details)

Uploaded CPython 3.4m macOS 10.6+ intel

File details

Details for the file uamqp-0.1.0.tar.gz.

File metadata

  • Download URL: uamqp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uamqp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25c3e9e57c333843fae2fa3b4ee146ecb76b052940c368fd374ba6e2a3bb1aa2
MD5 64cf2239352faf53b2c0f49d14e20977
BLAKE2b-256 11d9b1fe12e3cd563f362c52a8303189e1a674a031ebfa71c83a8b02d0c40dfd

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8b31a247a37e1610ddd428f6ea577e96a5f36c5f0f0c8de01c97f5b45894ee97
MD5 8b5e62a31f8978b99d83f8bb7be4b014
BLAKE2b-256 77ecc73621a72612eab4942046172661ff322ca8e63789cbf653435c3c60dc08

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp37-cp37m-win32.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 30463e4b292e199c7d43a921220b6369a548b5e6399d29a1dda2b7bd80113cf5
MD5 69fccf158f19fc26b82c4bb43cc70fdc
BLAKE2b-256 13839ff3d9b3d7ba459a72c5f15b14d3febf10b254ae70fa58ead1326558b2d5

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a1327bd62afda96d17ac03ce045fe0518013aeb6a0d47b6d68339578385dd86b
MD5 dc2f5e37255eb6631f929c483f5ac734
BLAKE2b-256 a1856c7a2b0674737c5502ac39be881729a3bd027b815ad1026d6ea235b7f89a

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp37-cp37m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 e877c0f5f6fb461269dd3f57ea2bc27d4c357c8bdce832d2fc9707da99b699a2
MD5 aeaccc0effea06c85cc756a5f53c4e2c
BLAKE2b-256 971786d1122f769110e4c776157176f2d9f6c4ec0aa24bd1cba6a7d1b8259db1

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp37-cp37m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 905ca1728ffa2bda60fe97036fd8fd93bf39c51aac8eec6f2adf23ccc9433d32
MD5 b67ac2ca985205082a162534d58b6e57
BLAKE2b-256 60322c1564b4045ee6d963b601f789a11dd40b87cb5dcfd0f80070911863433c

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e2a29e81b423f394ff854bd1bdaca5ea2e0b9930b1f66fa78a9a1b9a8b677b50
MD5 61365f71ed655142d2e6f97baf192a3d
BLAKE2b-256 77265e0df76141605f485ee23200fc3b2bc9d7edb0158d80e5c3222236024400

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 a96bd9d7cef9b67cf1ad8d180d1bcd624ca3c3f7968ea5af833faa05edaeaf88
MD5 df43b0cd4f09fc86dc9b48542aa2c2c4
BLAKE2b-256 dd4c8597ccbadb5570a4819d0ee27ff83cbd63049e657d49e66ec4e215f476ba

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9c3990c6958ebc6d5c0725994a01db5395de44cde725828ad566ffb367012410
MD5 13aa91c2e4447a21cd256662ee0fb416
BLAKE2b-256 f0fa54198262ade33f956ac527ae6142776b5500264e1444ebef5368831fd74b

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 236288a4d9348866175fbca62742e6c03f072ccdcaded53a132e44d075fdc6cb
MD5 b65309d6615af435ac6d7a3d988c258f
BLAKE2b-256 2034b9e91b72a8c9f26572eae65c871a3fc99b7de35dedb031db9911db9a9db4

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 eb975fc3c0e91e00d2e5d35ec1825b5cf54a5b673bd06a9fecd0addb95e08b6a
MD5 32adb517d7501d1faa2efc0e06bc6b12
BLAKE2b-256 af1f3c151d9e5aeed7317f5bf4c40c772d1bc3d5b8720e107382e4db031d06f6

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d9414997fb46cdef8c1a14f83640fba18d3b8271333db34a533959da39ac349d
MD5 3973623e773f524f5a43ffdb920527b2
BLAKE2b-256 c98faba62fe884dfebf631360e88bf2e435bfe701dd5fa511bdcecd2e8def553

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 cdf4ae33d20d19116a0f3f3c2108f4a4fd1d883edf76d6f903d068a05d7727da
MD5 10eec4aeba2d6b7305ff376e2e02a5c0
BLAKE2b-256 15b7a586f1362572e0942ceab0896b781b7fdd5ab8dabe0f4d4a2be4470de1eb

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3f7d2dde0b1400a5de2faccc57935e9ae3dcd39668d0b4e7dbcc8e0f4ed61a09
MD5 8e7f6c8fee65403d848fe7c82f019fcf
BLAKE2b-256 d3028ba593786b6ae9c768dab04de3d3c2ce7baf3ae32428a1d743e706a921de

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b3c9fdc97e3efcb794eaf9155fd2260853576e848e076db80ce0807e97dca127
MD5 63bb72af2e5fcdf93351864dbe6c62e0
BLAKE2b-256 2edff574a8205c737cbb6df21958ec31b4146fc36b29bfb16f1d75991c556b14

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 0d3824eae22359c20fee79774d44bd5b98053b56ba55d55d0e2a77c782b5e0e6
MD5 77ba66352a7fde2eba914544e4ba1c6c
BLAKE2b-256 fc1a1ea8b1244d8fa2c2a62f5d230e8819f0808f17aaede4d521c20d2e198eaa

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 c191c96e7078f6683cf5a157fd9730ae1d4d690afa2d78abc56316fd15dfbe5a
MD5 17019a8f276e3a0a78ef4e9146b1a34d
BLAKE2b-256 7e0bab3a40a176476ea305ce714e9a51df3346708877c7a1d718e9617c10c66f

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 b7cd14a4f2db782547f365166cca65ac1b1dbb1f33fd0d54d257355b5eada47f
MD5 2a00e5e2e20afedb2feead27a0d92e79
BLAKE2b-256 2e576bd25a1ad35994dfdbaed23ffc00426cfe68994bdba46d92f7c0341d061b

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a4c5eaa3dfa5e9991bcff6258e791840309c3580a0e0c69d98bc88eec2f96249
MD5 4f913f8b2b4799f113cbc2bdf3c0e7d3
BLAKE2b-256 bab8881961e45a00e9d2647b6425abbd6001b43b411be2df5a9e699709b643bd

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a0b2b265f76d8445be05bedfc0ad775f6cc9a6d93832766b39b8f49c0a0200e5
MD5 2215d7e400a3ba95fd0a2fa21f8b0d06
BLAKE2b-256 f2bbab69a95f4b8df769407e1689c2e88e390dc3af63c1fc4b7fd38500144afc

See more details on using hashes here.

File details

Details for the file uamqp-0.1.0-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for uamqp-0.1.0-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e8bb741aed00f194d5f71468c6803404d04dc5cb6660a94be10a462e6a0d8b5d
MD5 8cbd2bf607a7b95671001977c210f2ed
BLAKE2b-256 494b0fcaf5106ed428a01a2d7d74ebbfcf3f2fe890a9da9ef2fc462d9385d07e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page