Skip to content

Commit 655e7a3

Browse files
committed
Fleshed out the README, cleaned up other docs.
1 parent 15dad01 commit 655e7a3

File tree

3 files changed

+86
-18
lines changed

3 files changed

+86
-18
lines changed

CHANGELOG.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
## Version 0.1 (development)
3+
## Version 0.1.0
44

5-
- Feature A added
6-
- FIX: nasty bug #1729 fixed
7-
- add your changes here!
5+
- New release of the Gobbler.

README.md

+83-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,86 @@
1212

1313
# Python client for the gobbler service
1414

15-
Pretty much as it says on the can; provides an Python client for the [Gobbler service](https://github.com/ArtifactDB/gobbler).
15+
Pretty much as it says on the tin; provides an Python client for the [Gobbler service](https://github.com/ArtifactDB/gobbler),
16+
as a sister package to the corresponding [R client](https://github.com/ArtifactDB/gobbler-R).
17+
To demonstrate, let's spin up a mock Gobbler instance:
18+
19+
```python
20+
import pygobbler as pyg
21+
_, staging, registry, url = pyg.start_gobbler()
22+
```
23+
24+
Administrators are responsible for creating projects:
25+
26+
```python
27+
pyg.create_project("test", staging=staging, url=url, owners=["akari"])
28+
```
29+
30+
An authorized user account (in this case, `akari`) can then upload directory of arbitrary files:
31+
32+
```python
33+
import tempfile
34+
import os
35+
tmp = tempfile.mkdtemp()
36+
with open(os.path.join(tmp, "blah.txt"), "w") as f:
37+
f.write("BAR")
38+
os.mkdir(os.path.join(tmp, "foo"))
39+
with open(os.path.join(tmp, "foo", "bar.txt"), "w") as f:
40+
f.write("1 2 3 4 5 6 7 8 9 10")
41+
42+
pyg.upload_directory(
43+
project="test",
44+
asset="foo",
45+
version="bar",
46+
directory=tmp,
47+
staging=staging,
48+
url=url
49+
)
50+
```
51+
52+
Anyone can fetch or list the contents, either on the same filesystem or remotely via the REST API.
53+
54+
```python
55+
pyg.list_files("test", "foo", "bar", registry=registry, url=url)
56+
pyg.fetch_manifest("test", "foo", "bar", registry=registry, url=url)
57+
pyg.fetch_summary("test", "foo", "bar", registry=registry, url=url)
58+
pyg.version_path("test", "foo", "bar", registry=registry, url=url)
59+
```
60+
61+
Project owners can set the permissions to allow other users to add new assets or new versions of existing assets:
62+
63+
```python
64+
pyg.set_permissions(
65+
"test",
66+
uploaders=[ { "id": "alicia", "asset": "foo" } ],
67+
registry=registry,
68+
staging=staging,
69+
url=url
70+
)
71+
72+
# And then 'alicia' can do:
73+
pyg.upload_directory(
74+
project="test",
75+
asset="foo",
76+
version="bar2",
77+
directory=tmp,
78+
staging=staging,
79+
url=url
80+
)
81+
```
82+
83+
By default, `uploaders` are untrusted and their uploads will be "probational".
84+
Owners can approve/reject probational uploads after review.
85+
86+
```python
87+
pyg.approve_probation("test", "foo", "bar2", staging=staging, url=url)
88+
```
89+
90+
Finally, administrators can delete projects, though this should be done sparingly.
91+
92+
```python
93+
pyg.remove_project("test", staging=staging, url=url)
94+
```
95+
96+
Check out the [API documentation](https://artifactdb.github.io/gobbler-py/) for more details on each function.
97+
For the concepts underlying the Gobbler itself, check out the [repository](https://github.com/ArtifactDB/gobbler) for a detailed explanation.

docs/index.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
# pygobbler
22

3-
Add a short description here!
4-
5-
6-
## Note
7-
8-
> This is the main page of your project's [Sphinx] documentation. It is
9-
> formatted in [Markdown]. Add additional pages by creating md-files in
10-
> `docs` or rst-files (formatted in [reStructuredText]) and adding links to
11-
> them in the `Contents` section below.
12-
>
13-
> Please check [Sphinx] and [MyST] for more information
14-
> about how to document your project and how to configure your preferences.
15-
3+
Python client for the [Gobbler](https://github.com/ArtifactDB/gobbler) service.
164

175
## Contents
186

0 commit comments

Comments
 (0)