pins


Namepins JSON
Version 0.8.5 PyPI version JSON
download
home_pagehttps://github.com/rstudio/pins-python
SummaryPublish data sets, models, and other python objects, making it easy to share them across projects and with your colleagues.
upload_time2024-04-16 23:17:17
maintainerNone
docs_urlNone
authorIsabel Zimmerman
requires_python>=3.8
licenseMIT
keywords data tidyverse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pins
<a href="https://rstudio.github.io/pins-python/"><img src="docs/logo.png" align="right" height="138" /></a>

![PyPI - Version](https://img.shields.io/pypi/v/pins.svg) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pins)



The pins package publishes data, models, and other Python objects,
making it easy to share them across projects and with your colleagues.
You can pin objects to a variety of pin *boards*, including folders (to
share on a networked drive or with services like DropBox), Posit
Connect, Amazon S3, and Google Cloud Storage. Pins can be automatically
versioned, making it straightforward to track changes, re-run analyses
on historical data, and undo mistakes.

See the [documentation](https://rstudio.github.io/pins-python) for
getting started.

You can use pins from R as well as Python. For example, you can use one
language to read a pin created with the other. Learn more about [pins
for R](https://pins.rstudio.com).

## Installation

You can install the released version of pins from
[PyPI](https://pypi.org/project/pins/):

``` shell
python -m pip install pins
```

And the development version from
[GitHub](https://github.com/rstudio/pins-python) with:

``` shell
python -m pip install git+https://github.com/rstudio/pins-python
```

## Usage

To use the pins package, you must first create a pin board. A good place
to start is `board_folder()`, which stores pins in a directory you
specify. Here I’ll use a special version of `board_folder()` called
`board_temp()` which creates a temporary board that’s automatically
deleted when your Python script or notebook session ends. This is great
for examples, but obviously you shouldn’t use it for real work!

``` python
import pins
from pins.data import mtcars

board = pins.board_temp()
```

You can “pin” (save) data to a board with the `.pin_write()` method. It
requires three arguments: an object, a name, and a pin type:

``` python
board.pin_write(mtcars.head(), "mtcars", type="csv")
```

    Writing pin:
    Name: 'mtcars'
    Version: 20230523T115348Z-120a5

    Meta(title='mtcars: a pinned 5 x 11 DataFrame', description=None, created='20230523T115348Z', pin_hash='120a54f7e0818041', file='mtcars.csv', file_size=249, type='csv', api_version=1, version=Version(created=datetime.datetime(2023, 5, 23, 11, 53, 48, 555797), hash='120a54f7e0818041'), tags=None, name='mtcars', user={}, local={})

Above, we saved the data as a CSV, 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 `joblib`, `parquet`, or `json` file.

You can later retrieve the pinned data with `.pin_read()`:

``` python
board.pin_read("mtcars")
```

        mpg  cyl   disp   hp  drat     wt   qsec  vs  am  gear  carb
    0  21.0    6  160.0  110  3.90  2.620  16.46   0   1     4     4
    1  21.0    6  160.0  110  3.90  2.875  17.02   0   1     4     4
    2  22.8    4  108.0   93  3.85  2.320  18.61   1   1     4     1
    3  21.4    6  258.0  110  3.08  3.215  19.44   1   0     3     1
    4  18.7    8  360.0  175  3.15  3.440  17.02   0   0     3     2

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. To
get started, you can use `board_folder()` with a directory on a shared
drive or in DropBox, or if you use [Posit
Connect](https://posit.co/products/enterprise/connect/) you can use
`board_connect()`:

``` python
# Note that this uses one approach to connecting,
# the environment variables CONNECT_SERVER and CONNECT_API_KEY

board = pins.board_connect()
board.pin_write(tidy_sales_data, "hadley/sales-summary", type="csv")
```

Then, someone else (or an automated report) can read and use your pin:

``` python
board = board_connect()
board.pin_read("hadley/sales-summary")
```

You can easily control who gets to access the data using the Posit
Connect permissions pane.

The pins package also includes boards that allow you to share data on
services like Amazon’s S3 (`board_s3()`), Google Cloud Storage
(`board_gcs()`), and Azure blob storage (`board_azure()`).

## Contributing

- This project is released with a [Contributor Code of
  Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).
  By contributing to this project, you agree to abide by its terms.

- If you think you have encountered a bug, please [submit an
  issue](https://github.com/rstudio/pins-python/issues).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rstudio/pins-python",
    "name": "pins",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "data, tidyverse",
    "author": "Isabel Zimmerman",
    "author_email": "isabel.zimmerman@posit.co",
    "download_url": "https://files.pythonhosted.org/packages/db/55/0b25cec38963c4b8ec03951c384975781499684e1b188a62a80d018a5f37/pins-0.8.5.tar.gz",
    "platform": null,
    "description": "# pins\n<a href=\"https://rstudio.github.io/pins-python/\"><img src=\"docs/logo.png\" align=\"right\" height=\"138\" /></a>\n\n![PyPI - Version](https://img.shields.io/pypi/v/pins.svg) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pins)\n\n\n\nThe pins package publishes data, models, and other Python objects,\nmaking it easy to share them across projects and with your colleagues.\nYou can pin objects to a variety of pin *boards*, including folders (to\nshare on a networked drive or with services like DropBox), Posit\nConnect, Amazon S3, and Google Cloud Storage. Pins can be automatically\nversioned, making it straightforward to track changes, re-run analyses\non historical data, and undo mistakes.\n\nSee the [documentation](https://rstudio.github.io/pins-python) for\ngetting started.\n\nYou can use pins from R as well as Python. For example, you can use one\nlanguage to read a pin created with the other. Learn more about [pins\nfor R](https://pins.rstudio.com).\n\n## Installation\n\nYou can install the released version of pins from\n[PyPI](https://pypi.org/project/pins/):\n\n``` shell\npython -m pip install pins\n```\n\nAnd the development version from\n[GitHub](https://github.com/rstudio/pins-python) with:\n\n``` shell\npython -m pip install git+https://github.com/rstudio/pins-python\n```\n\n## Usage\n\nTo use the pins package, you must first create a pin board. A good place\nto start is `board_folder()`, which stores pins in a directory you\nspecify. Here I\u2019ll use a special version of `board_folder()` called\n`board_temp()` which creates a temporary board that\u2019s automatically\ndeleted when your Python script or notebook session ends. This is great\nfor examples, but obviously you shouldn\u2019t use it for real work!\n\n``` python\nimport pins\nfrom pins.data import mtcars\n\nboard = pins.board_temp()\n```\n\nYou can \u201cpin\u201d (save) data to a board with the `.pin_write()` method. It\nrequires three arguments: an object, a name, and a pin type:\n\n``` python\nboard.pin_write(mtcars.head(), \"mtcars\", type=\"csv\")\n```\n\n    Writing pin:\n    Name: 'mtcars'\n    Version: 20230523T115348Z-120a5\n\n    Meta(title='mtcars: a pinned 5 x 11 DataFrame', description=None, created='20230523T115348Z', pin_hash='120a54f7e0818041', file='mtcars.csv', file_size=249, type='csv', api_version=1, version=Version(created=datetime.datetime(2023, 5, 23, 11, 53, 48, 555797), hash='120a54f7e0818041'), tags=None, name='mtcars', user={}, local={})\n\nAbove, we saved the data as a CSV, but depending on what you\u2019re saving\nand who else you want to read it, you might use the `type` argument to\ninstead save it as a `joblib`, `parquet`, or `json` file.\n\nYou can later retrieve the pinned data with `.pin_read()`:\n\n``` python\nboard.pin_read(\"mtcars\")\n```\n\n        mpg  cyl   disp   hp  drat     wt   qsec  vs  am  gear  carb\n    0  21.0    6  160.0  110  3.90  2.620  16.46   0   1     4     4\n    1  21.0    6  160.0  110  3.90  2.875  17.02   0   1     4     4\n    2  22.8    4  108.0   93  3.85  2.320  18.61   1   1     4     1\n    3  21.4    6  258.0  110  3.08  3.215  19.44   1   0     3     1\n    4  18.7    8  360.0  175  3.15  3.440  17.02   0   0     3     2\n\nA board on your computer is good place to start, but the real power of\npins comes when you use a board that\u2019s shared with multiple people. To\nget started, you can use `board_folder()` with a directory on a shared\ndrive or in DropBox, or if you use [Posit\nConnect](https://posit.co/products/enterprise/connect/) you can use\n`board_connect()`:\n\n``` python\n# Note that this uses one approach to connecting,\n# the environment variables CONNECT_SERVER and CONNECT_API_KEY\n\nboard = pins.board_connect()\nboard.pin_write(tidy_sales_data, \"hadley/sales-summary\", type=\"csv\")\n```\n\nThen, someone else (or an automated report) can read and use your pin:\n\n``` python\nboard = board_connect()\nboard.pin_read(\"hadley/sales-summary\")\n```\n\nYou can easily control who gets to access the data using the Posit\nConnect permissions pane.\n\nThe pins package also includes boards that allow you to share data on\nservices like Amazon\u2019s S3 (`board_s3()`), Google Cloud Storage\n(`board_gcs()`), and Azure blob storage (`board_azure()`).\n\n## Contributing\n\n- This project is released with a [Contributor Code of\n  Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).\n  By contributing to this project, you agree to abide by its terms.\n\n- If you think you have encountered a bug, please [submit an\n  issue](https://github.com/rstudio/pins-python/issues).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Publish data sets, models, and other python objects, making it easy to share them across projects and with your colleagues.",
    "version": "0.8.5",
    "project_urls": {
        "Documentation": "https://rstudio.github.io/pins-python",
        "Homepage": "https://github.com/rstudio/pins-python"
    },
    "split_keywords": [
        "data",
        " tidyverse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c10b553b43d81a04719d3edd3e3f0671cb17ed71d1780a358fec9e686a0cd5f",
                "md5": "b928ff52414fb587b64061538e6da4b5",
                "sha256": "b0e3d75e2e1c516c37bdbf69ac1cfeab3e11d4520f26210c07086a2b4012c983"
            },
            "downloads": -1,
            "filename": "pins-0.8.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b928ff52414fb587b64061538e6da4b5",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 114218,
            "upload_time": "2024-04-16T23:17:14",
            "upload_time_iso_8601": "2024-04-16T23:17:14.851452Z",
            "url": "https://files.pythonhosted.org/packages/8c/10/b553b43d81a04719d3edd3e3f0671cb17ed71d1780a358fec9e686a0cd5f/pins-0.8.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db550b25cec38963c4b8ec03951c384975781499684e1b188a62a80d018a5f37",
                "md5": "161fc066538f1a48e1ae18fcedb71f38",
                "sha256": "411ad967c93a6f8283c3a272de89f0a1adef3a0735c56986691c97d88cabb454"
            },
            "downloads": -1,
            "filename": "pins-0.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "161fc066538f1a48e1ae18fcedb71f38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 111858,
            "upload_time": "2024-04-16T23:17:17",
            "upload_time_iso_8601": "2024-04-16T23:17:17.080969Z",
            "url": "https://files.pythonhosted.org/packages/db/55/0b25cec38963c4b8ec03951c384975781499684e1b188a62a80d018a5f37/pins-0.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 23:17:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rstudio",
    "github_project": "pins-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pins"
}
        
Elapsed time: 0.24559s