Skip to content

Commit

Permalink
Add setup instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Phạm Tuấn Anh committed Dec 20, 2017
1 parent 06004e3 commit 35dd0e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# MogileFS client library for Python

## Connect to MogileFS
## Installation

```bash
$ pip install pymogile
```

## Examples

### Connect to MogileFS

```python
>>> from pymogile import Client, MogileFSError
>>> datastore = Client(domain='test', trackers=['127.0.0.1:7001'])
```

## New file
### New file

```python
>>> fp = datastore.new_file('foobar.txt')
>>> fp.write('foo')
>>> fp.close()
```

## Get paths
### Get paths

```python
>>> datastore.get_paths('foobar.txt')
Expand All @@ -24,15 +32,15 @@
[]
```

## Get file data
### Get file data

```python
>>> datastore.get_file_data('404.txt')
>>> datastore.get_file_data('foobar.txt')
'foo'
```

## File info
### File info

```python
>>> datastore.file_info('foobar.txt')
Expand All @@ -52,7 +60,7 @@
'length': 3}
```

## Rename file
### Rename file

```python
>>> datastore.rename('404.txt', 'test.txt')
Expand All @@ -65,7 +73,7 @@ True
'foo'
```

## Remove file
### Remove file

```python
>>> datastore.delete('foobar.txt')
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
version='2.1.0',
description="pymogile",
long_description="""Python MogileFS Client""",
classifiers=(
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
),
],
author='AloneRoad',
author_email='aloneroad@gmail.com',
maintainer='stefanfoulis',
Expand Down

0 comments on commit 35dd0e2

Please sign in to comment.