Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Apr 12, 2022
1 parent 531d8fb commit c8dd615
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Chunk replicator

## Example Usage

```python
from chunk_replicator import (
EbrainsDataproxyHttpReplicatorAccessor,
HttpMirrorSrcAccessor,
User,
DataProxyBucket,
)
import os
from neuroglancer_scripts.precomputed_io import get_IO_for_existing_dataset

bigbrain_url = "https://neuroglancer.humanbrainproject.eu/precomputed/BigBrainRelease.2015/8bit"
bigbrain_accessor = HttpMirrorSrcAccessor(bigbrain_url)

auth_token=os.getenv("AUTH_TOKEN")
user = User(auth_token=auth_token)
bucket = DataProxyBucket(user, "MY_BUCKET_NAME")

proxy = EbrainsDataproxyHttpReplicatorAccessor(dataproxybucket=bucket, prefix="bigbrain_2015")
io = get_IO_for_existing_dataset(bigbrain_accessor)
import json
proxy.store_file("info", json.dumps(io.info).encode("utf-8"))
bigbrain_accessor.mirror_to(proxy)
```

## License

MIT

0 comments on commit c8dd615

Please sign in to comment.