https://github.com/quantopian/pgcontents
A Postgres-backed ContentsManager implementation for Jupyter
https://github.com/quantopian/pgcontents
Last synced: 9 months ago
JSON representation
A Postgres-backed ContentsManager implementation for Jupyter
- Host: GitHub
- URL: https://github.com/quantopian/pgcontents
- Owner: quantopian
- License: apache-2.0
- Created: 2014-12-12T20:57:18.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T02:33:15.000Z (almost 3 years ago)
- Last Synced: 2025-03-29T03:06:57.356Z (10 months ago)
- Language: Python
- Homepage:
- Size: 276 KB
- Stars: 150
- Watchers: 34
- Forks: 85
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
PGContents
==========
PGContents is a PostgreSQL-backed implementation of `IPEP 27 `_. It aims to a be a transparent, drop-in replacement for IPython's standard filesystem-backed storage system. PGContents' `PostgresContentsManager` class can be used to replace all local filesystem storage with database-backed storage, while its `PostgresCheckpoints` class can be used to replace just IPython's checkpoint storage. 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.
This repository developed as part of the `Quantopian Research Environment `_.
Getting Started
---------------
**Prerequisites:**
- Write access to an empty `PostgreSQL `_ database.
- A Python installation with `Jupyter Notebook `_ >= 5.0.
**Installation:**
0. Install ``pgcontents`` from PyPI via ``pip install pgcontents``.
1. Run ``pgcontents init`` to configure your database. You will be prompted for a database URL for pgcontents to use for storage. (Alternatively, you can set the ``PGCONTENTS_DB_URL`` environment variable, or pass ``--db-url`` on the command line).
2. Configure Jupyter to use pgcontents as its storage backend. This can be done from the command line or by modifying your notebook config file. On a Unix-like system, your notebook config will be located at ``~/.jupyter/jupyter_notebook_config.py``. See the ``examples`` directory for example configuration files.
3. Enjoy your filesystem-free Jupyter experience!
Demo Video
----------
You can see a demo of PGContents in action in `this presentation from JupyterCon 2017`_.
.. _`this presentation from JupyterCon 2017` : https://youtu.be/TtsbspKHJGo?t=917