Skip to content

Commit

Permalink
docs, urls namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Aug 11, 2017
1 parent ac274a9 commit d8fdb13
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Amazon S3 cloud storage.

As a PyFilesystem concrete class, S3FS allows you to work with S3 in the
same as any other supported filesystem.

`Documentation <http://fs-s3fs.readthedocs.io/en/latest/>`__
5 changes: 4 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ There are two options for constructing a :ref:`s3fs` instance. The simplest way
is with an *opener*, which is a simple URL like syntax. Here is an example::

from fs import open_fs
s3fs = S3FS('s3://mybucket/')
s3fs = open_fs('s3://mybucket/')

For more granular control, you may import the S3FS class and construct
it explicitly::

from fs_s3fs import S3FS
s3fs = S3FS('mybucket')

See :class:`~fs_s3fs.S3FS` for other arguments you may pass to the
constructor.


Authentication
==============
Expand Down
13 changes: 13 additions & 0 deletions fs_s3fs/_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,19 @@ def _info_from_object(self, obj, namespaces):
value = datetime_to_epoch(value)
s3info[name] = value

if 'urls' in namespaces:
url = self.client.generate_presigned_url(
ClientMethod='get_object',
Params={
'Bucket': self._bucket_name,
'Key': key
}
)
info['urls'] = {
'download': url
}


return info

def getinfo(self, path, namespaces=None):
Expand Down
2 changes: 1 addition & 1 deletion fs_s3fs/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2a0"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

REQUIREMENTS = [
"boto3~=1.4.5",
"fs==2.0.7",
"fs~=2.0.7",
"six~=1.10.0"
]

Expand Down

0 comments on commit d8fdb13

Please sign in to comment.