Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Readme got deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellsayer committed Nov 22, 2019
1 parent b2f12cc commit 30e2f2c
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Hybrid-Content-Manager
======================
It aims to a be a transparent, drop-in replacement for IPython's standard filesystem-backed storage system.
These features are useful when running IPython in environments where you either don't have access to—or don't trust the reliability of—the local filesystem of your notebook server.

Getting Started
---------------
**Prerequisites:**
- A Python installation with `Jupyter Notebook <https://github.com/jupyter/notebook>`_ >= 4.0.

**Installation:**
- TODO

Usage
-----
The following code snippet creates a HybridContentsManager with two directories with different content managers.

```python
c = get_config()

c.NotebookApp.contents_manager_class = HybridContentsManager

c.HybridContentsManager.manager_classes = {
"": FileContentsManager,
"shared": S3ContentsManager
}

# Each item will be passed to the constructor of the appropriate content manager.
c.HybridContentsManager.manager_kwargs = {
# Args for root S3ContentsManager.
"": {
"root_dir": read_only_dir
},
# Args for the shared S3ContentsManager directory
"shared": {
"access_key_id": ...,
"secret_access_key": ...,
"endpoint_url": ...,
"bucket": ...,
"prefix": ...
},
}

# Only allow notebook files to be stored in S3
c.HybridContentsManager.path_validator = {
"shared": lambda path: path.endswith('.ipynb')
}
```


Testing
-------
To run unit tests, simply cd to the root directory of the project and run the command ``tox``. This will run all unit tests for python versions 2.7, 3.6, 3.7 and jupyter notebook versions 4, 5, and 6.

0 comments on commit 30e2f2c

Please sign in to comment.