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…

Documentation

Reference documentation can be found here: 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.

  • 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.1 (2018-07-14)

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

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.1.tar.gz (5.1 MB view details)

Uploaded Source

Built Distributions

uamqp-0.1.1-cp37-cp37m-win_amd64.whl (767.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

uamqp-0.1.1-cp37-cp37m-win32.whl (689.1 kB view details)

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

uamqp-0.1.1-cp36-cp36m-win_amd64.whl (767.5 kB view details)

Uploaded CPython 3.6m Windows x86-64

uamqp-0.1.1-cp36-cp36m-win32.whl (694.3 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

uamqp-0.1.1-cp35-cp35m-win_amd64.whl (765.1 kB view details)

Uploaded CPython 3.5m Windows x86-64

uamqp-0.1.1-cp35-cp35m-win32.whl (687.3 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m macOS 10.6+ intel

uamqp-0.1.1-cp34-cp34m-win_amd64.whl (763.2 kB view details)

Uploaded CPython 3.4m Windows x86-64

uamqp-0.1.1-cp34-cp34m-win32.whl (683.9 kB view details)

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m

uamqp-0.1.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for uamqp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 26da3ef2e7db94aa8fa5b34e283f08c80b243c45236111ad8db7daa1248d1c31
MD5 79d83e78365bd8d9f435c2c37ee366ff
BLAKE2b-256 e190035ff75bf651e0ae6376ba8f2eb05a7da5eabe8d5c446684d118af4d8ca8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 87a6a1cc04c07496a76f1f72364c24145a5b1699e80bcb8275f799d122e8f8fb
MD5 127ba53101a5a8c79234e19b8ce98414
BLAKE2b-256 54150cf28f8dc3270303414dde32c46824a7c91749471bc5c19d0c4dcd6a89e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 adb8e577b6b28d72931cd17a78ca299fdcb6c8e61c86b8e9ee7a33b8c8718cde
MD5 cdd0d7717e95a4f5eaf385329c2790bc
BLAKE2b-256 d29b5907624b61e507895856b1dd8b82facedcb73bf288cfba65d1e58c568963

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 316cf402187b254a9fb0933e416a02b2608a2a2d93a1e77f3149a120bedeb045
MD5 8bd9fb0ba1fe82157930e1ee8778a9b3
BLAKE2b-256 70708a69cf8b13389866cf2196022274bed61b03067f83d8978557926a2a74e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 e1bd0f59e793ba4cc3d3a1b4ee34a7bbfa6d0dce34268389a3df44e5218ebe6a
MD5 4c9068a8a4270c187d6529093cc60ddc
BLAKE2b-256 655d3eecbc107a0789b1fa575648f6fdc87342dc0208f49fd901e34224b90016

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 11ab8d9f3b6f9310969402f3b986b6ae1e941d78b588388e945aa5e8711e2e71
MD5 b281ece4c9606e8cedbbff409093957d
BLAKE2b-256 6218f3b9a9cb21ecd856cae4e57bb839b0d661ab056da0f9754a5db5f11ff950

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f95c927274cf1ae0ff6765b16c5805b0d59942f9115846db5999e3d236a32c21
MD5 2787cbfc66c1967a20a1a3f1d5967af5
BLAKE2b-256 4c8b844d73157e78182ac50ec8ff776353be02a330a73da3e6c4f4b1f890efdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 28059fbbe9ea53a6bd3fd8088d042a753c79f075fab4b560de326055f43636b2
MD5 1d67da4ce57880869e9d68348484d5b6
BLAKE2b-256 5697c8f0250f4216180da8c130391e34d3269642243003f9fdff9e72dd3a067c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 44e7e6eacac12e2832f8b1d4752c734ce599cdd1dcf4b4e6645e55e8e6776eda
MD5 a45814c893d8e55e2c02d8950f42c0b4
BLAKE2b-256 06794d0c269fe5d4b5b9c5d73db56360f59a057bd14c550b55771807d05c63c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 462587fa7a94af1a6cdd751488ca8bf066b977e918fd35ba04cfa03ef3fd2cac
MD5 5c72e60ad1209baa632a36b1c6c9d2f8
BLAKE2b-256 4914341ca3b7edc452f199256f918e934c1100422c0f0ba53d1cc58df225da7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 209b10bf959f0d90d5e2b9ec252e3f1809be7233cde5bc4c8c54a866d82d85fa
MD5 4197fa0b98a917abeed60ad10eadd30b
BLAKE2b-256 9c42bf79fa0efe0518f46e30154b35ef86ef0892b5dd16418f56c4426a1448d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 ff1717501c8259194103f2b5f89a4935d1c1cb453d0918dc77213dc1572756a3
MD5 95bd12cd4fafc159d8dcb213124baff3
BLAKE2b-256 f213959c82990a205dfaa0050916d51738ffec8ce90a943aa958e40eb2da8c32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 83280689fb5ac390a7ba63dff3458303b9e72aaa1f6de8ff4f498deab711fa7e
MD5 be34a477f2c78fa88c35c9d009d24732
BLAKE2b-256 3b3e3206acd1d955322098958f3e91ab31b05b8851214ea26fef4d6d036d2fc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8521f1899b0f5d70f6ce406e839992216289dd40b52bf1a9bf4647aa36c724eb
MD5 356b54a01ae9b4978d333bc518c04963
BLAKE2b-256 a3a1d153a132578d7e6565f1ef56d4d77efa52d68c698c9b52f80482f56c8a79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ed1dedb701e7b7859018da493c483c128aabbfffd0cc01a4041fbf2f58e8e8a5
MD5 89896925e9c5ced93b91807724855633
BLAKE2b-256 264cf56a43798a926d7ad9a74a3eabbd30961b1c6465ea1fcb15816f45596127

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 37ad247566a2f9179164f9725f92511d86266526d785cc0f6c0fdee4cf62e384
MD5 48ca79b1f7e6988f9f873e1ed7807a1c
BLAKE2b-256 54222308bca8df44bb75ead351cfa33b82572283f1b0e93a604a6f8fd7537d6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 55d19fef3f1a519c08fd7f49e0faea8ac37161d6027613d69f49667a30590b10
MD5 61c981461e9b1cea76a3df8179b30000
BLAKE2b-256 fddeb0dd30e91dd1777a5d3ff2f0a860b8c6471e5bad3bceffb7505e2e694af7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 4b5bba7cd735ba5576036d5cdc0c76993af0f308e87875abcb753063b83c5b58
MD5 3941a7e7967e03e819c0bd74dee5a302
BLAKE2b-256 6f398093fd7f7cf0d0ecc3deb97e7fb42badf670aa9a9010502d6a22068999b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 53e991ea36841eea3add83c11ec32cb9749e0ac8086943b02eb8fb3b08f2dd55
MD5 81969807776654679f4136aafa2fb98d
BLAKE2b-256 fd5996488c79a346dd6fbecccb613e0ee0064cb348b8918bb782fe87b2b55d72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4ee685ac54cc35c0bf668138f8b6d7d4e5b8d2b32397ef30ba812d0355ed0ca9
MD5 9cf6b5e50cede58088b575562cd3dcbc
BLAKE2b-256 87b258bf162c1ac12107325bd76b94d814ca3abfc622a40248a2ad92b171b3d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 dc9376b07852fd700f6531902ba3d6aa5d9cdfa39c98882c8d56abd7804b534e
MD5 0f379bcb906292532452b014348fb41f
BLAKE2b-256 604318bac00ec99cc36c44f992f4a7993b1ba8fa1fb2941481acca9d8d48d879

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