Metadata-Version: 2.1
Name: gcloud-rest-storage
Version: 5.3.0
Summary: Python Client for Google Cloud Storage
Home-page: https://github.com/talkiq/gcloud-rest
Author: Vi Engineering
Author-email: voiceai-eng@dialpad.com
License: MIT License
Platform: Posix; MacOS X; Windows
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet
Requires-Python: >= 2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
Requires-Dist: gcloud-rest-auth (<4.0.0,>=3.1.0)

(Asyncio OR Threadsafe) Python Client for Google Cloud Storage
==============================================================

    This is a shared codebase for ``gcloud-rest-storage`` and
    ``gcloud-rest-storage``

|pypi| |pythons-aio| |pythons-rest|

Installation
------------

.. code-block:: console

    $ pip install --upgrade gcloud-{aio,rest}-storage

Usage
-----

To upload a file, you might do something like the following:

.. code-block:: python

    import aiohttp
    from gcloud.rest.storage import Storage


    async with aiohttp.ClientSession() as session:
        client = Storage(session=session)

        async with open('/path/to/my/file', mode='r') as f:
            status = await client.upload('my-bucket-name',
                                         'path/to/gcs/folder',
                                         f.read())
            print(status)

Note that there are multiple ways to accomplish the above, ie,. by making use
of the ``Bucket`` and ``Blob`` convenience classes if that better fits your
use-case.

You can also refer `smoke test`_ for more info and examples.

Note that you can also let ``gcloud-rest-storage`` do its own session
management, so long as you give us a hint when to close that session:

.. code-block:: python

    async with Storage() as client:
        # closes the client.session on leaving the context manager

    # OR

    client = Storage()
    # do stuff
    await client.close()  # close the session explicitly

Contributing
------------

Please see our `contributing guide`_.

.. _contributing guide: https://github.com/talkiq/gcloud-rest/blob/master/.github/CONTRIBUTING.rst
.. _smoke test: https://github.com/talkiq/gcloud-rest/blob/master/storage/tests/integration/smoke_test.py

.. |pypi| image:: https://img.shields.io/pypi/v/gcloud-rest-storage.svg?style=flat-square
    :alt: Latest PyPI Version (gcloud-rest-storage)
    :target: https://pypi.org/project/gcloud-rest-storage/

.. |pythons-aio| image:: https://img.shields.io/pypi/pyversions/gcloud-rest-storage.svg?style=flat-square&label=python (aio)
    :alt: Python Version Support (gcloud-rest-storage)
    :target: https://pypi.org/project/gcloud-rest-storage/

.. |pythons-rest| image:: https://img.shields.io/pypi/pyversions/gcloud-rest-storage.svg?style=flat-square&label=python (rest)
    :alt: Python Version Support (gcloud-rest-storage)
    :target: https://pypi.org/project/gcloud-rest-storage/


