Skip to content

Commit bc5a8cf

Browse files
committed
docs
1 parent d55a1cf commit bc5a8cf

File tree

3 files changed

+130
-9
lines changed

3 files changed

+130
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77

8-
## [0.1.2]
8+
## [0.1.2] - 2017-08-29
99

1010
### Fixed
1111

README.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,67 @@
11
# S3FS
22

3-
S3FS is a [PyFilesystem interface](https://docs.pyfilesystem.org/) to
3+
S3FS is a [PyFilesystem](https://www.pyfilesystem.org/) interface to
44
Amazon S3 cloud storage.
55

6-
As a PyFilesystem concrete class, S3FS allows you to work with S3 in the
7-
same as any other supported filesystem.
6+
As a PyFilesystem concrete class, [S3FS](http://fs-s3fs.readthedocs.io/en/latest/) allows you to work with S3 in the
7+
same way as any other supported filesystem.
88

9-
[Documentation](http://fs-s3fs.readthedocs.io/en/latest/)
9+
10+
## Opening a S3FS
11+
12+
Open an S3FS by explicitly using the constructor:
13+
14+
```python
15+
from s3_s3fs import s3FS
16+
s3fs = S3FS('mybucket')
17+
```
18+
19+
Or with a FS URL:
20+
21+
```python
22+
from fs import open_fs
23+
s3fs = open_fs('s3://mybucket')
24+
```
25+
26+
## Downloading Files
27+
28+
To *download* files from an S3 bucket, open a file on the S3
29+
filesystem for reading, then write the data to a file on the local
30+
filesystem. Here's an example that copies a file `example.mov` from
31+
S3 to your HD:
32+
33+
```python
34+
from fs.tools import copy_file_data
35+
with s3fs.open('example.mov', 'rb') as remote_file:
36+
with open('example.mov', 'wb') as local_file:
37+
copy_file_data(remote_file, local_file)
38+
```
39+
40+
Although it is preferable to use the higher-level functionality in the
41+
`fs.copy` module. Here's an example:
42+
43+
```python
44+
from fs.copy import copy_file
45+
copy_file(s3fs, 'example.mov', './', 'example.mov')
46+
```
47+
48+
## Uploading Files
49+
50+
You can *upload* files in the same way. Simply copy a file from a
51+
source filesystem to the S3 filesystem.
52+
See [Moving and Copying](https://docs.pyfilesystem.org/en/latest/guide.html#moving-and-copying)
53+
for more information.
54+
55+
## S3 URLs
56+
57+
You can get a public URL to a file on a S3 bucket as follows:
58+
59+
```python
60+
movie_url = s3fs.geturl('example.mov')
61+
```
62+
63+
## Documentation
64+
65+
- [PyFilesystem Wiki](https://www.pyfilesystem.org)
66+
- [S3FS Reference](http://fs-s3fs.readthedocs.io/en/latest/)
67+
- [PyFilesystem Reference](https://docs.pyfilesystem.org/en/latest/reference/base.html)

README.rst

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,73 @@
11
S3FS
22
====
33

4-
S3FS is a `PyFilesystem interface <https://docs.pyfilesystem.org/>`__ to
4+
S3FS is a `PyFilesystem <https://www.pyfilesystem.org/>`__ interface to
55
Amazon S3 cloud storage.
66

7-
As a PyFilesystem concrete class, S3FS allows you to work with S3 in the
8-
same as any other supported filesystem.
7+
As a PyFilesystem concrete class,
8+
`S3FS <http://fs-s3fs.readthedocs.io/en/latest/>`__ allows you to work
9+
with S3 in the same way as any other supported filesystem.
910

10-
`Documentation <http://fs-s3fs.readthedocs.io/en/latest/>`__
11+
Opening a S3FS
12+
--------------
13+
14+
Open an S3FS by explicitly using the constructor:
15+
16+
.. code:: python
17+
18+
from s3_s3fs import s3FS
19+
s3fs = S3FS('mybucket')
20+
21+
Or with a FS URL:
22+
23+
.. code:: python
24+
25+
from fs import open_fs
26+
s3fs = open_fs('s3://mybucket')
27+
28+
Downloading Files
29+
-----------------
30+
31+
To *download* files from an S3 bucket, open a file on the S3 filesystem
32+
for reading, then write the data to a file on the local filesystem.
33+
Here's an example that copies a file ``example.mov`` from S3 to your HD:
34+
35+
.. code:: python
36+
37+
from fs.tools import copy_file_data
38+
with s3fs.open('example.mov', 'rb') as remote_file:
39+
with open('example.mov', 'wb') as local_file:
40+
copy_file_data(remote_file, local_file)
41+
42+
Although it is preferable to use the higher-level functionality in the
43+
``fs.copy`` module. Here's an example:
44+
45+
.. code:: python
46+
47+
from fs.copy import copy_file
48+
copy_file(s3fs, 'example.mov', './', 'example.mov')
49+
50+
Uploading Files
51+
---------------
52+
53+
You can *upload* files in the same way. Simply copy a file from a source
54+
filesystem to the S3 filesystem. See `Moving and
55+
Copying <https://docs.pyfilesystem.org/en/latest/guide.html#moving-and-copying>`__
56+
for more information.
57+
58+
S3 URLs
59+
-------
60+
61+
You can get a public URL to a file on a S3 bucket as follows:
62+
63+
.. code:: python
64+
65+
movie_url = s3fs.geturl('example.mov')
66+
67+
Documentation
68+
-------------
69+
70+
- `PyFilesystem Wiki <https://www.pyfilesystem.org>`__
71+
- `S3FS Reference <http://fs-s3fs.readthedocs.io/en/latest/>`__
72+
- `PyFilesystem
73+
Reference <https://docs.pyfilesystem.org/en/latest/reference/base.html>`__

0 commit comments

Comments
 (0)