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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m macOS 10.6+ intel

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m

uamqp-0.1.0rc2-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.0rc2.tar.gz.

File metadata

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

File hashes

Hashes for uamqp-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 d82c50e79c5a46038ccedd14a86b1b49b18063498a985f0716832fc58a30151f
MD5 bce7f98ff2567bace88e226d836caa52
BLAKE2b-256 ad60dcde13d22b97bfc14028959b83c0181bed3cdc018a9fcbb32ff74cf36139

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b2cd33f18c9774f9d68fa4f023a42c7777f3b43882b2e5f6b2f2ac350f6260ea
MD5 29da96a29b93cb7f08294f8524adeb27
BLAKE2b-256 5252cc756e0dc4bdd57e67616d257028db4ed2dfe95ba845c7b075df8eafde57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 ecf320ff0b76a0ec936f4bec4e44153bf6fd4af126d25ebd98006bb5eb7912fb
MD5 4c9af4b8e9c76e79b2932965b23a14b1
BLAKE2b-256 2d2c8101fcbbdce7c42dbd082f297ca5a0a1011124d853f107542a2398f1fadc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ecdeb91c1602ae9e1c282d576b6a7d684ebf4c070a976577c2206da4a0a1ea8b
MD5 40cb217a8f0b23ab9ffb803eff3fa073
BLAKE2b-256 15e93e73bf1f1412c0391c341eda0436790b1fa6a152305358598f0469bd4b2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4b5b95a8c07ffa2a1d68c9234ee0f1b622010cf8106e2c5c677c33a28adb50eb
MD5 7ab1770f9df7acb02b541536b9d1efb9
BLAKE2b-256 35fc63cc501bcd56fac2758097adccdd769704c9d623626e6ab1bc0bf84c20c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 634fa53f847de70f1539f6d4b3ebeaa3dd3e66da518ff3a49b2002ca05de5cdb
MD5 beda720cb3a266c29c7a6d37d0a19a3c
BLAKE2b-256 979d42be8dbe8731205c24e3c21808144380c7e180df41750b997bd546e96612

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d6eebdf70ba17734cc7f7768af6917cc2c8ff44da7b20697c5774a5ddaa52eba
MD5 6d6aea8600d82ffa50a3b91628a9978b
BLAKE2b-256 8350b04a91e69e718cd099f59b7ad5167c4d55ff06f2b3d19e0ae76c466520db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 65134f4bc1ba9d6b0006b6f68c3dc39721f3706138cd5acb43026fbf404709bc
MD5 a25975a18864e4c9036d6d780c336e73
BLAKE2b-256 f6864d9d76c3827fb0f8f7ee9b1cc1bb01feaa0ada4fff37fa90771d4d8c6b96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 484b38091a43c144084f0a6819c527ac206146012951b1612f8799ad68e06d6b
MD5 387cdfc2f197ecec7c46f215a1dda909
BLAKE2b-256 56504cefdac254f2eca78a58b02065b84475480b1d53d6903e178e5d2ad61a9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 66f81ee4dc8386843d7b06da287b617a07978ab41f6016a0d1dae32b8639ca9a
MD5 667ea339b9b90d8bb450e0c05f00edf6
BLAKE2b-256 5ec978db584cdf67a891ff16cb21808325740bad0b50fc47b45329119323913a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 a3eb56aca1c3727ea88360428b3b77464c62a8fd79efb4f568e20fa7aaf15980
MD5 33b011f37674f29ac8a805bf303dc803
BLAKE2b-256 6bff440771afaafa61a99ece0882e6da5437cbda43dce6daf51f7b6f5a2c7724

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 fd73474e48759352db6a5214df7062a8b7a51bec6ebbdd8c722eb41f41cb7742
MD5 0046c9874c3340e2f8ee113246555ac3
BLAKE2b-256 d45ed506b338b02fee4ed10afb56a40403680cfdeb2a75c111827c007cf837e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 222ff42fb19eb8c8d99da21c47527a2f16a01397b9ae5f60d6ce5b069fc7c085
MD5 5e5af8d07266ed0b183004acc34d4964
BLAKE2b-256 7ba55f916879068e75c8c75ea29bff033fa341b8229db1cc26189e65e50a52c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 65daff29415d664daed5d69017841f823b21cfd5f3d2dffdc9cac68dda476d31
MD5 c1f60d9f080f479fd3c642b17e3be7aa
BLAKE2b-256 45d16eac845c51bddf28032eada3c9202f5d10f8ab9cb11821b02ac3ce5f5a6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 1793c99bf04b8a248098a0c8e80911dcf62d33df287accd45db9b44ad3f6631f
MD5 df47cf98e9bebb4b35270b78dccd6018
BLAKE2b-256 e907e2408af8aefd930155878463b712710bc093859d1f8bd4bc68eb45a9cf4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 4d9d9b7f25839699ff45cf57b101b2b9629fa81519d2b62da845df2cae1d5855
MD5 59d842c6dc4e5579ecc66cb3a76d4461
BLAKE2b-256 beefcd175cc7e06cbf5408ec33fb1e488d2637b4c5c2d13278eb84ba150e080b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 d8f929bece3f488da49992baa727665c90c64c1b459244b214956d228f6b1eb4
MD5 ed443d9e97ed7cf1ade5096d7146b44d
BLAKE2b-256 5124c0445b6f5d5bd09a4619d4ddbf2da7b98015bcfa8092d5c46e9c79686663

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 d9b565d1bfd3e21ed25261c9c3bdc11b6393f55395d63134994a1d53fe5f2965
MD5 399bd3108611e78d5589a48b6d63bd58
BLAKE2b-256 2e71282bb2afa9ffba7bca3254a1cdf3055bc8bdd65f6027d0f4100cb546209f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b6c2b083abce4b546cb2f43d975031f7a7264fa79b0d7ef219a858e97ad48629
MD5 66d6fb12c315121f1861a597602ae1c0
BLAKE2b-256 32c634cdf1032efb982dfdd0e65da88c577db45ba88c6b381aeae5df10dd3f05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a8c1eecf2a22f7804b1b06c70c0d5f9028ca7ad1d8e9d6763f0a9a17bf452027
MD5 a40269914b2a2c17a34d4cae29a97e33
BLAKE2b-256 6d90c631a043491c722d78bf337b2a21eff64c63af7e94bbf846ef8773c679be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uamqp-0.1.0rc2-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 ecbedae5a359c4a299603eb3ead76a1ff1977aa49e0beaff543bbf15913487e3
MD5 e1c31e5c002bd3e15a0151017e9962ab
BLAKE2b-256 c4d9eaf0b6359503d24cf947455e8910a896fb6ff289209a422623ca74731d0d

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