Skip to content

Commit

Permalink
Fleshed out the README, cleaned up other docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Apr 24, 2024
1 parent 15dad01 commit 655e7a3
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 18 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Changelog

## Version 0.1 (development)
## Version 0.1.0

- Feature A added
- FIX: nasty bug #1729 fixed
- add your changes here!
- New release of the Gobbler.
84 changes: 83 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,86 @@

# Python client for the gobbler service

Pretty much as it says on the can; provides an Python client for the [Gobbler service](https://github.com/ArtifactDB/gobbler).
Pretty much as it says on the tin; provides an Python client for the [Gobbler service](https://github.com/ArtifactDB/gobbler),
as a sister package to the corresponding [R client](https://github.com/ArtifactDB/gobbler-R).
To demonstrate, let's spin up a mock Gobbler instance:

```python
import pygobbler as pyg
_, staging, registry, url = pyg.start_gobbler()
```

Administrators are responsible for creating projects:

```python
pyg.create_project("test", staging=staging, url=url, owners=["akari"])
```

An authorized user account (in this case, `akari`) can then upload directory of arbitrary files:

```python
import tempfile
import os
tmp = tempfile.mkdtemp()
with open(os.path.join(tmp, "blah.txt"), "w") as f:
f.write("BAR")
os.mkdir(os.path.join(tmp, "foo"))
with open(os.path.join(tmp, "foo", "bar.txt"), "w") as f:
f.write("1 2 3 4 5 6 7 8 9 10")

pyg.upload_directory(
project="test",
asset="foo",
version="bar",
directory=tmp,
staging=staging,
url=url
)
```

Anyone can fetch or list the contents, either on the same filesystem or remotely via the REST API.

```python
pyg.list_files("test", "foo", "bar", registry=registry, url=url)
pyg.fetch_manifest("test", "foo", "bar", registry=registry, url=url)
pyg.fetch_summary("test", "foo", "bar", registry=registry, url=url)
pyg.version_path("test", "foo", "bar", registry=registry, url=url)
```

Project owners can set the permissions to allow other users to add new assets or new versions of existing assets:

```python
pyg.set_permissions(
"test",
uploaders=[ { "id": "alicia", "asset": "foo" } ],
registry=registry,
staging=staging,
url=url
)

# And then 'alicia' can do:
pyg.upload_directory(
project="test",
asset="foo",
version="bar2",
directory=tmp,
staging=staging,
url=url
)
```

By default, `uploaders` are untrusted and their uploads will be "probational".
Owners can approve/reject probational uploads after review.

```python
pyg.approve_probation("test", "foo", "bar2", staging=staging, url=url)
```

Finally, administrators can delete projects, though this should be done sparingly.

```python
pyg.remove_project("test", staging=staging, url=url)
```

Check out the [API documentation](https://artifactdb.github.io/gobbler-py/) for more details on each function.
For the concepts underlying the Gobbler itself, check out the [repository](https://github.com/ArtifactDB/gobbler) for a detailed explanation.
14 changes: 1 addition & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# pygobbler

Add a short description here!


## Note

> This is the main page of your project's [Sphinx] documentation. It is
> formatted in [Markdown]. Add additional pages by creating md-files in
> `docs` or rst-files (formatted in [reStructuredText]) and adding links to
> them in the `Contents` section below.
>
> Please check [Sphinx] and [MyST] for more information
> about how to document your project and how to configure your preferences.
Python client for the [Gobbler](https://github.com/ArtifactDB/gobbler) service.

## Contents

Expand Down

0 comments on commit 655e7a3

Please sign in to comment.