Microsoft Azure Storage Library for Python
Перейти к файлу
Ze Qian Zhang dbdec015b5 Merge pull request #350 from kfarmer-msft/dev
Port connection string changes to Python
2017-09-10 00:43:27 -07:00
azure Port connection string changes to Python 2017-09-08 15:07:31 -07:00
doc Bump version to 0.36.0 2017-08-22 15:39:25 -07:00
samples Update block_blob_usage.py 2017-07-11 10:40:14 +02:00
tests Port connection string changes to Python 2017-09-08 15:07:31 -07:00
.gitignore
BreakingChanges.md Breaking change update. 2017-02-17 18:02:41 -08:00
CONTRIBUTING.md
ChangeLog.md Port connection string changes to Python 2017-09-08 15:07:31 -07:00
LICENSE.txt
MANIFEST.in New azure namespace packaging system 2017-04-27 14:20:40 -07:00
README.rst Add logging to the library 2017-09-05 15:21:48 -07:00
azure-storage-python.pyproj Blob client-side encryption completed 2016-08-08 15:09:10 -07:00
azure-storage-python.sln
azure_bdist_wheel.py New azure namespace packaging system 2017-04-27 14:20:40 -07:00
requirements.txt May16 - Changelog, Requirements, BreakingChanges update. 2017-01-12 13:27:40 -08:00
setup.cfg New azure namespace packaging system 2017-04-27 14:20:40 -07:00
setup.py Bump version to 0.36.0 2017-08-22 15:39:25 -07:00

README.rst

Microsoft Azure Storage SDK for Python
======================================

This project provides a client library in Python that makes it easy to
consume Microsoft Azure Storage services. For documentation please see
the Microsoft Azure `Python Developer Center`_ and our `API Reference`_ Page.

    If you are looking for the Service Bus or Azure Management
    libraries, please visit
    https://github.com/Azure/azure-sdk-for-python.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

    pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first then install it again:

.. code:: shell

    pip uninstall azure
    pip install azure

If you are upgrading from a version older than 0.30.0, see the upgrade doc, the 
usage samples in the samples directory, and the ChangeLog and BreakingChanges.

If you are encountering `problems`_ installing azure-storage on Azure Web Apps,
`upgrading pip`_ might help.


Features
========

-  Blob

   -  Create/Read/Update/Delete Containers
   -  Create/Read/Update/Delete Blobs
   -  Advanced Blob Operations

-  Queue

   -  Create/Delete Queues
   -  Insert/Peek Queue Messages
   -  Advanced Queue Operations

-  Table

   -  Create/Read/Update/Delete Tables
   -  Create/Read/Update/Delete Entities
   -  Batch operations
   -  Advanced Table Operations

-  Files

   -  Create/Update/Delete Shares
   -  Create/Update/Delete Directories
   -  Create/Read/Update/Delete Files
   -  Advanced File Operations

Getting Started
===============

Download
--------

Option 1: Via PyPi
~~~~~~~~~~~~~~~~~~

To install via the Python Package Index (PyPI), type:
::

    pip install azure-storage

Option 2: Source Via Git
~~~~~~~~~~~~~~~~~~~~~~~~

To get the source code of the SDK via git just type:

::

    git clone git://github.com/Azure/azure-storage-python.git
    cd ./azure-storage-python
    python setup.py install

Option 3: Source Zip
~~~~~~~~~~~~~~~~~~~~

Download a zip of the code via GitHub or PyPi. Then, type:

::

    cd ./azure-storage-python
    python setup.py install

Minimum Requirements
--------------------

-  Python 2.7, 3.3, 3.4, or 3.5.
-  See setup.py for dependencies

Usage
-----

To use this SDK to call Microsoft Azure storage services, you need to
first `create an account`_.

Logging
-----------

To make debugging easier, it is recommended to turn on logging for the logger named 'azure.storage'.
Here are two example configurations:

.. code:: python

    # Basic configuration: configure the root logger, including 'azure.storage'
    logging.basicConfig(format='%(asctime)s %(name)-20s %(levelname)-5s %(message)s', level=logging.INFO)

.. code:: python

    # More advanced configuration allowing more control
    logger = logging.getLogger('azure.storage')
    handler = logging.StreamHandler()
    formatter = logging.Formatter('%(asctime)s %(name)-20s %(levelname)-5s %(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    logger.setLevel(logging.INFO)

Here is how we use the logging levels, it is recommended to use INFO:

-  DEBUG: log strings to sign
-  INFO: log outgoing requests and responses, as well as retry attempts
-  WARNING: not used
-  ERROR: log calls that still failed after all the retries

Code Sample
-----------

See the samples directory for blob, queue, table, and file usage samples.

Need Help?
==========

Be sure to check out the Microsoft Azure `Developer Forums on MSDN`_ or
the `Developer Forums on Stack Overflow`_ if you have trouble with the
provided code.

Contribute Code or Provide Feedback
===================================

If you would like to become an active contributor to this project, please
follow the instructions provided in `Azure Projects Contribution
Guidelines`_. You can find more details for contributing in the `CONTRIBUTING.md doc`_.

If you encounter any bugs with the library, please file an issue in the
`Issues`_ section of the project.

Learn More
==========

-  `Python Developer Center`_
-  `Azure Storage Service`_
-  `Azure Storage Team Blog`_
-  `API Reference`_

.. _Python Developer Center: http://azure.microsoft.com/en-us/develop/python/
.. _API Reference: https://azure-storage.readthedocs.io/en/latest/
.. _here: https://github.com/Azure/azure-storage-python/archive/master.zip
.. _create an account: https://account.windowsazure.com/signup
.. _Developer Forums on MSDN: http://social.msdn.microsoft.com/Forums/windowsazure/en-US/home?forum=windowsazuredata
.. _Developer Forums on Stack Overflow: http://stackoverflow.com/questions/tagged/azure+windows-azure-storage
.. _Azure Projects Contribution Guidelines: http://azure.github.io/guidelines.html
.. _Issues: https://github.com/Azure/azure-storage-python/issues
.. _Azure Storage Service: http://azure.microsoft.com/en-us/documentation/services/storage/
.. _Azure Storage Team Blog: http://blogs.msdn.com/b/windowsazurestorage/
.. _CONTRIBUTING.md doc: CONTRIBUTING.md
.. _problems: https://github.com/Azure/azure-storage-python/issues/219
.. _upgrading pip: https://docs.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service