Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests #17

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
45a60f5
Merge pull request #7 from haiwen/update-test
freeplant Dec 26, 2017
adc44f4
update tests
kklein33 Feb 2, 2018
b2f5745
functests.sh: use py.test instead of nosetests
dongsupark May 28, 2015
6d9c73d
seafileapi: implement rename, moveTo, copyTo methods
dongsupark May 30, 2015
14faea6
seafileapi: make moveTo, rename update self.path
dongsupark Jun 2, 2015
6afb351
tests: add a test for rename, moveTo, copyTo
dongsupark Jun 2, 2015
4f7aac5
functests.sh: add a missing export call for SEAFILE_TEST_SERVER_ADDRESS
dongsupark Jun 2, 2015
07792a4
update
kklein33 Feb 2, 2018
9b898ea
Merge pull request #9 from haiwen/dirent-func
freeplant Feb 3, 2018
9744abe
public document
kklein33 Jan 31, 2018
954c440
review
kklein33 Feb 2, 2018
2fbbf7c
Merge pull request #8 from haiwen/public-doc
freeplant Feb 3, 2018
328266a
update doc link
kklein33 Feb 3, 2018
3dd5fd1
share to user for dir
kklein33 Jun 1, 2018
281398f
Merge pull request #12 from haiwen/search-virtual-repo-test
freeplant Jun 4, 2018
d3480ba
update ignore
SkywalkerSpace Sep 25, 2019
b4b077e
2to3 dict
SkywalkerSpace Sep 25, 2019
bc69e77
2to3 except
SkywalkerSpace Sep 25, 2019
e29d92b
2to3 unicode
SkywalkerSpace Sep 25, 2019
032545e
2to3 urllib
SkywalkerSpace Sep 25, 2019
209d7f5
remove utf8lize
SkywalkerSpace Sep 25, 2019
2842f8b
Merge pull request #14 from haiwen/python3-master
freeplant Sep 26, 2019
528b528
Make changes to source repo to work with HBP seafile
appukuttan-shailesh Jul 15, 2020
a2e30b8
update requirements
appukuttan-shailesh Jul 15, 2020
3204471
changes to conform to new package name
appukuttan-shailesh Jul 15, 2020
45eda04
change to py3 prints in docs
appukuttan-shailesh Jul 15, 2020
5c9cd95
Update readme with more details
appukuttan-shailesh Jul 15, 2020
8bc9170
add more convenience methods
appukuttan-shailesh Jul 16, 2020
838d39a
bug fixes and improvements
appukuttan-shailesh Jul 17, 2020
084f646
minor updates
appukuttan-shailesh Jul 20, 2020
f6d5e2a
minor update in get repo
appukuttan-shailesh Jul 20, 2020
78d5738
update version
appukuttan-shailesh Jul 28, 2020
7854e8b
rename into ebrains_seafile
Sep 2, 2020
0836a40
Define env settings
Sep 2, 2020
102512a
remove hardcoded drive url from function
Sep 7, 2020
643a105
transform File into class as repos for coherence
Sep 7, 2020
8c23246
package version indexed on git tag
Sep 11, 2020
d5c08d4
add version-query to requirement
Sep 11, 2020
8bb0198
Update links in readme
appukuttan-shailesh Sep 25, 2020
0c205d6
Merge pull request #1 from appukuttan-shailesh/master
appukuttan-shailesh Nov 17, 2020
1b14722
fix for duplicate repos in listing
appukuttan-shailesh Nov 25, 2020
ec054a8
Replace CNRS validation endpoint by an ebrains client
Dec 14, 2020
8ff11fc
Fix capitalisation in setup.py, and change package url to one more sp…
apdavison Jun 3, 2021
ebfcf8c
Remove test data with unknown contents
apdavison Jan 4, 2023
0684359
trying to get tests to work with drive-int
apdavison Jan 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testdrive.py
venv/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -52,3 +55,5 @@ docs/_build/

# PyBuilder
target/

.idea/
67 changes: 63 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
[![Build Status](https://secure.travis-ci.org/haiwen/python-seafile.svg?branch=master)](http://travis-ci.org/haiwen/python-seafile)

python-seafile
ebrains_drive
==============

python client for seafile web api
Python client interface for HBP Collaboratory Seafile storage


Original implementation source:
https://github.com/haiwen/python-seafile
by Shuai Lin ([email protected])


Updated for integration with HBP v2 Collaboratory's Seafile storage
by Shailesh Appukuttan ([email protected])


Documentation: https://github.com/HumanBrainProject/ebrains-drive/blob/master/doc.md

Installation: `pip install ebrains_drive`


Example usage (refer to docs for more):

```python
# 1. Import module
import ebrains_drive

# 2. Create client object
# 2.1 either via
client = ebrains_drive.connect('hbp_username', 'password')
# 2.2 or via
from ebrains_drive.client import DriveApiClient
client = DriveApiClient(username="hbp_username", password="password")


# 3. Working with Collab drives (libraries / repos)
# 3.1 Get list of all libraries that user has access to
list_repos = client.repos.list_repos()
# 3.2 Get info of specific library
repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355')
print(repo_obj.__dict__)

# 4. Working with directories
# 4.1 Get info of a directory
repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355')
dir_obj = repo_obj.get_dir('/') # specify dir path; '/' signifies root directory
print(dir_obj.__dict__)
# 4.2 Get contents of directory
dir_obj.ls()


# 5. Working with files
# 5.1 Get info of a file
repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355')
file_obj = repo_obj.get_file('/sample-latest.csv') # specify file path
print(file_obj.__dict__)
# 5.2 Get file content
file_content = file_obj.get_content()
print(file_content)
```


<div><img src="https://raw.githubusercontent.com/HumanBrainProject/ebrains-drive/master/eu_logo.jpg" alt="EU Logo" width="15%" align="right"></div>

### ACKNOWLEDGEMENTS
This open source software code was developed in part in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270 and No. 785907 (Human Brain Project SGA1 and SGA2).
Loading