You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.7 KiB

4 years ago
  1. ===============================
  2. Boto 3 - The AWS SDK for Python
  3. ===============================
  4. |Build Status| |Version| |Gitter|
  5. Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for
  6. Python, which allows Python developers to write software that makes use
  7. of services like Amazon S3 and Amazon EC2. You can find the latest, most
  8. up to date, documentation at our `doc site`_, including a list of
  9. services that are supported.
  10. .. _boto: https://docs.pythonboto.org/
  11. .. _`doc site`: https://boto3.amazonaws.com/v1/documentation/api/latest/index.html
  12. .. |Build Status| image:: http://img.shields.io/travis/boto/boto3/develop.svg?style=flat
  13. :target: https://travis-ci.org/boto/boto3
  14. :alt: Build Status
  15. .. |Gitter| image:: https://badges.gitter.im/boto/boto3.svg
  16. :target: https://gitter.im/boto/boto3
  17. :alt: Gitter
  18. .. |Downloads| image:: http://img.shields.io/pypi/dm/boto3.svg?style=flat
  19. :target: https://pypi.python.org/pypi/boto3/
  20. :alt: Downloads
  21. .. |Version| image:: http://img.shields.io/pypi/v/boto3.svg?style=flat
  22. :target: https://pypi.python.org/pypi/boto3/
  23. :alt: Version
  24. .. |License| image:: http://img.shields.io/pypi/l/boto3.svg?style=flat
  25. :target: https://github.com/boto/boto3/blob/develop/LICENSE
  26. :alt: License
  27. Quick Start
  28. -----------
  29. First, install the library and set a default region:
  30. .. code-block:: sh
  31. $ pip install boto3
  32. Next, set up credentials (in e.g. ``~/.aws/credentials``):
  33. .. code-block:: ini
  34. [default]
  35. aws_access_key_id = YOUR_KEY
  36. aws_secret_access_key = YOUR_SECRET
  37. Then, set up a default region (in e.g. ``~/.aws/config``):
  38. .. code-block:: ini
  39. [default]
  40. region=us-east-1
  41. Then, from a Python interpreter:
  42. .. code-block:: python
  43. >>> import boto3
  44. >>> s3 = boto3.resource('s3')
  45. >>> for bucket in s3.buckets.all():
  46. print(bucket.name)
  47. Development
  48. -----------
  49. Getting Started
  50. ~~~~~~~~~~~~~~~
  51. Assuming that you have Python and ``virtualenv`` installed, set up your
  52. environment and install the required dependencies like this instead of
  53. the ``pip install boto3`` defined above:
  54. .. code-block:: sh
  55. $ git clone https://github.com/boto/boto3.git
  56. $ cd boto3
  57. $ virtualenv venv
  58. ...
  59. $ . venv/bin/activate
  60. $ pip install -r requirements.txt
  61. $ pip install -e .
  62. Running Tests
  63. ~~~~~~~~~~~~~
  64. You can run tests in all supported Python versions using ``tox``. By default,
  65. it will run all of the unit and functional tests, but you can also specify your own
  66. ``nosetests`` options. Note that this requires that you have all supported
  67. versions of Python installed, otherwise you must pass ``-e`` or run the
  68. ``nosetests`` command directly:
  69. .. code-block:: sh
  70. $ tox
  71. $ tox -- unit/test_session.py
  72. $ tox -e py26,py33 -- integration/
  73. You can also run individual tests with your default Python version:
  74. .. code-block:: sh
  75. $ nosetests tests/unit
  76. Generating Documentation
  77. ~~~~~~~~~~~~~~~~~~~~~~~~
  78. Sphinx is used for documentation. You can generate HTML locally with the
  79. following:
  80. .. code-block:: sh
  81. $ pip install -r requirements-docs.txt
  82. $ cd docs
  83. $ make html
  84. Getting Help
  85. ------------
  86. We use GitHub issues for tracking bugs and feature requests and have limited
  87. bandwidth to address them. Please use these community resources for getting
  88. help:
  89. * Ask a question on `Stack Overflow <https://stackoverflow.com/>`__ and tag it with `boto3 <https://stackoverflow.com/questions/tagged/boto3>`__
  90. * Come join the AWS Python community chat on `gitter <https://gitter.im/boto/boto3>`__
  91. * Open a support ticket with `AWS Support <https://console.aws.amazon.com/support/home#/>`__
  92. * If it turns out that you may have found a bug, please `open an issue <https://github.com/boto/boto3/issues/new>`__