Skip to content

Commit e2aebaf

Browse files
committed
docs: move to jupyterbook, add home page
1 parent 880b79e commit e2aebaf

File tree

9 files changed

+396
-160
lines changed

9 files changed

+396
-160
lines changed

docs/_config.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Book settings
2+
# Learn more at https://jupyterbook.org/customize/config.html
3+
4+
title: Pins
5+
author: RStudio Inc.
6+
#logo: logo.png
7+
8+
# Force re-execution of notebooks on each build.
9+
# See https://jupyterbook.org/content/execute.html
10+
execute:
11+
execute_notebooks: force
12+
13+
# Define the name of the latex output file for PDF builds
14+
latex:
15+
latex_documents:
16+
targetname: book.tex
17+
18+
# Add a bibtex file so that we can create citations
19+
bibtex_bibfiles:
20+
- references.bib
21+
22+
# Information about where the book exists on the web
23+
repository:
24+
url: https://github.com/machow/pins-python
25+
path_to_book: docs
26+
branch: main
27+
28+
# Add GitHub buttons to your book
29+
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
30+
html:
31+
use_issues_button: true
32+
use_repository_button: true
33+
34+
sphinx:
35+
config:
36+
nb_custom_formats:
37+
.Rmd:
38+
- jupytext.reads
39+
- fmt: Rmd
40+
extra_extensions:
41+
- "sphinx.ext.napoleon"
42+
- "sphinx.ext.autodoc"
43+
- "sphinx.ext.autosummary"

docs/_toc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Table of contents
2+
# Learn more at https://jupyterbook.org/customize/toc.html
3+
4+
format: jb-book
5+
root: intro
6+
chapters:
7+
- file: getting_started
8+
- file: api/index.rst

docs/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
API
1+
Reference
22
=============
33

44
.. toctree::

docs/conf.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

docs/index.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/intro.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
jupytext:
3+
formats: md:myst
4+
text_representation:
5+
extension: .md
6+
format_name: myst
7+
format_version: 0.13
8+
jupytext_version: 1.13.6
9+
kernelspec:
10+
display_name: venv-pins-python
11+
language: python
12+
name: venv-pins-python
13+
---
14+
15+
# Welcome
16+
17+
The pins package publishes data, models, and other R objects, making it easy to share them across projects and with your colleagues.
18+
You can pin objects to a variety of pin *boards*, including folders (to share on a networked drive or with services like DropBox), RStudio Connect, Amazon S3, Azure storage and ~Microsoft 365 (OneDrive and SharePoint)~.
19+
Pins can be automatically versioned, making it straightforward to track changes, re-run analyses on historical data, and undo mistakes.
20+
21+
## 🚧 Installation
22+
23+
To try out the development version of pins you'll need to install from GitHub:
24+
25+
```shell
26+
python -m pip install git+https://github.com/machow/pins-python
27+
```
28+
29+
## Usage
30+
31+
To use the pins package, you must first create a pin board.
32+
A good place to start is `board_folder()`, which stores pins in a directory you specify.
33+
Here I'll use a special version of `board_folder()` called `board_temp()` which creates a temporary board that's automatically deleted when your R session ends.
34+
This is great for examples, but obviously you shouldn't use it for real work!
35+
36+
```{code-cell} ipython3
37+
from pins import board_temp
38+
from pins.data import mtcars
39+
40+
board = board_temp()
41+
board
42+
```
43+
44+
You can "pin" (save) data to a board with `pin_write()`.
45+
It takes three arguments: the board to pin to, an object, and a name:
46+
47+
```{code-cell} ipython3
48+
board.pin_write(mtcars.head(), "mtcars", type="csv")
49+
```
50+
51+
~As you can see, the data saved as an `.rds` by default~, but depending on what you're saving and who else you want to read it, you might use the `type` argument to instead save it as a `csv`, ~`json`, or `arrow`~ file.
52+
53+
You can later retrieve the pinned data with `pin_read()`:
54+
55+
```{code-cell} ipython3
56+
board.pin_read("mtcars")
57+
```
58+
59+
A board on your computer is good place to start, but the real power of pins comes when you use a board that's shared with multiple people.
60+
To get started, you can use `board_folder()` with a directory on a shared drive or in dropbox, or if you use [RStudio Connect](https://www.rstudio.com/products/connect/) you can use `board_rsconnect()`:
61+
62+
🚧 TODO: add informational messages shown in display below
63+
64+
+++
65+
66+
```python
67+
board <- board_rsconnect()
68+
#> Connecting to RSC 1.9.0.1 at <https://connect.rstudioservices.com>
69+
board.pin_write(tidy_sales_data, "sales-summary", type = "rds")
70+
#> Writing to pin 'hadley/sales-summary'
71+
```
72+
73+
+++
74+
75+
Then, someone else (or an automated Rmd report) can read and use your pin:
76+
77+
+++
78+
79+
```python
80+
board = board_rsconnect()
81+
board.pin_read("hadley/sales-summary")
82+
```
83+
84+
+++
85+
86+
You can easily control who gets to access the data using the RStudio Connect permissions pane.
87+
88+
The pins package also includes boards that allow you to share data on services like Amazon's S3 (`board_s3()`), Azure's blob storage (`board_azure()`), and Microsoft SharePoint (`board_ms365()`).
89+
Learn more in [getting started](getting_started.Rmd).

docs/user_guide/index.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)