Metadata-Version: 2.1
Name: swiftpath
Version: 0.0.1.dev0
Summary: A pathlib-derived interface to Openstack Swift
Home-page: https://github.com/canonical/swiftpath
Author: Dan Ryan
Author-email: dan.ryan@canonical.com
License: Apache-2.0
Project-URL: Source Code, https://github.com/canonical/swiftpath
Project-URL: Change Log, https://github.com/canonical/swiftpath/CHANGES.rst
Keywords: swift pathlib openstack object storage
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software 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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Requires-Dist: keystoneauth1
Requires-Dist: openstackclient
Requires-Dist: python-swiftclient
Provides-Extra: dev
Requires-Dist: invoke ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: rope ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
Requires-Dist: sphinx-autodoc-typehints ; extra == 'dev'
Provides-Extra: lint
Requires-Dist: black ; extra == 'lint'
Requires-Dist: flake8 ; extra == 'lint'
Requires-Dist: flake8-bugbear ; extra == 'lint'
Requires-Dist: isort ; extra == 'lint'
Requires-Dist: mypy ; extra == 'lint'
Provides-Extra: release
Requires-Dist: parver ; extra == 'release'
Requires-Dist: towncrier ; extra == 'release'
Provides-Extra: tests
Requires-Dist: coverage ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-timeout ; extra == 'tests'
Requires-Dist: readme-renderer[md] ; extra == 'tests'
Requires-Dist: twine ; extra == 'tests'
Requires-Dist: swiftmock ; extra == 'tests'

==================================================================
SwiftPath: A pathlib-derived interface to Openstack Swift
==================================================================


🐉 Installation
=================

Install from `PyPI`_:

  ::

    $ pip install swiftpath

.. _PyPI: https://www.pypi.org/project/swiftpath
.. _Github: https://github.com/canonical/swiftpath


🐉 About
==========

Swift Connection
-------------------

**swiftpath** will automatically read environment variables to determine how to connect to a swift instance.

Currently, **swiftpath** looks for the following environment variables when connecting to swift:

  - **OS_USER_ID** or **OS_USERNAME**
  - **OS_PASSWORD**
  - **OS_PROJECT_NAME** or **OS_TENANT_NAME**
  - **OS_AUTH_URL** or **OS_AUTHENTICATION_URL**
  - **OS_STORAGE_URL**
  - **OS_REGION_NAME**
  - **OS_PROJECT_ID**

Caveats
---------

Note that the following methods are not provided as they are not available on swift:

  - *SwiftPath.cwd()*
  - *SwiftPath.home()*
  - *SwiftPath.chmod()*
  - *SwiftPath.expanduser()*
  - *SwiftPath.lchmod()*
  - *SwiftPath.group()*
  - *SwiftPath.is_block_device()*
  - *SwiftPath.is_char_device()*
  - *SwiftPath.lstat()*
  - *SwiftPath.resolve()*


🐉 Usage
==========

To construct a path to a swift instance, simply use the syntax ``/containername/path/to/key`` when referencing the object. All ``pathlib.Path``
methods that are not explicitly excluded are available on the subsequently created object.

.. code:: python

    >>> from swiftpath import SwiftPath
    >>> path = SwiftPath("/mycontainer/my-file.txt")
    >>> path.write_text("hello\n")
    >>> path.read_text()
    hello


.. note:: Symlinks are natively supported in swift, and you will find they are also supported in this library.



