# resticpy
[](https://pypi.org/project/resticpy/)
[](https://circleci.com/gh/mtlynch/resticpy)
[](https://coveralls.io/github/mtlynch/resticpy?branch=master)
[](LICENSE)
## Overview
Minimal Python wrapper around the [restic](https://restic.readthedocs.io/) backup command-line interface.
## Installation
### From pip
```bash
pip install resticpy
```
### From source
```bash
git clone https://github.com/mtlynch/resticpy.git
cd resticpy
pip install .
```
## Quick start
### Create a password file
```bash
printf "mysecretpass" > password.txt
```
### Initialize a repository and back up a file
```python
import restic
restic.repository = '/tmp/backup1'
restic.password_file = 'password.txt'
restic.init()
restic.backup(paths=['some-file.txt'])
```
### Restore a snapshot
```python
import restic
restic.repository = '/tmp/backup1'
restic.password_file = 'password.txt'
restic.restore(snapshot_id='latest', target_dir='~/restored')
```
## API Documentation
<https://mtlynch.github.io/resticpy/>
## Example
I personally use this library for my backups. I've published my backup script at [mtlynch/mtlynch-backup](https://github.com/mtlynch/mtlynch-backup).
## Compatibility
resticpy is tested against [restic 0.17.1](https://github.com/restic/restic/releases/tag/v0.17.1).
## resticpy's scope and future
resticpy is maintained by [Michael Lynch](https://mtlynch.io) as a hobby project.
resticpy is **not** meant to achieve feature parity with restic. It is meant to cover a small subset of the most useful features of restic.
Due to time limitations, I keep resticpy's scope limited to only the features that fit into my workflows.
### Feature requests
I don't fulfill feature requests for resticpy. You are welcome to file a feature request for a third-party contributor to take on.
### Pull requests
I accept pull requests when they are:
- Documented
- Tested
- Small
I don't accept pull requests for features that look like they'll be a large maintenance burden.
## Acknowledgments
This project is forked from [jstzwj/PyRestic](https://github.com/jstzwj/PyRestic).
Raw data
{
"_id": null,
"home_page": "https://github.com/mtlynch/resticpy.git",
"name": "resticpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "backup",
"author": "Michael Lynch",
"author_email": "michael@mtlynch.io",
"download_url": "https://files.pythonhosted.org/packages/b3/69/cb549be36e32ac82315d983da61d5de3b41a3c63c123f7e39448df40c4fe/resticpy-1.3.0.tar.gz",
"platform": null,
"description": "# resticpy\n\n[](https://pypi.org/project/resticpy/)\n[](https://circleci.com/gh/mtlynch/resticpy)\n[](https://coveralls.io/github/mtlynch/resticpy?branch=master)\n[](LICENSE)\n\n## Overview\n\nMinimal Python wrapper around the [restic](https://restic.readthedocs.io/) backup command-line interface.\n\n## Installation\n\n### From pip\n\n```bash\npip install resticpy\n```\n\n### From source\n\n```bash\ngit clone https://github.com/mtlynch/resticpy.git\ncd resticpy\npip install .\n```\n\n## Quick start\n\n### Create a password file\n\n```bash\nprintf \"mysecretpass\" > password.txt\n```\n\n### Initialize a repository and back up a file\n\n```python\nimport restic\n\nrestic.repository = '/tmp/backup1'\nrestic.password_file = 'password.txt'\n\nrestic.init()\nrestic.backup(paths=['some-file.txt'])\n```\n\n### Restore a snapshot\n\n```python\nimport restic\n\nrestic.repository = '/tmp/backup1'\nrestic.password_file = 'password.txt'\n\nrestic.restore(snapshot_id='latest', target_dir='~/restored')\n```\n\n## API Documentation\n\n<https://mtlynch.github.io/resticpy/>\n\n## Example\n\nI personally use this library for my backups. I've published my backup script at [mtlynch/mtlynch-backup](https://github.com/mtlynch/mtlynch-backup).\n\n## Compatibility\n\nresticpy is tested against [restic 0.17.1](https://github.com/restic/restic/releases/tag/v0.17.1).\n\n## resticpy's scope and future\n\nresticpy is maintained by [Michael Lynch](https://mtlynch.io) as a hobby project.\n\nresticpy is **not** meant to achieve feature parity with restic. It is meant to cover a small subset of the most useful features of restic.\n\nDue to time limitations, I keep resticpy's scope limited to only the features that fit into my workflows.\n\n### Feature requests\n\nI don't fulfill feature requests for resticpy. You are welcome to file a feature request for a third-party contributor to take on.\n\n### Pull requests\n\nI accept pull requests when they are:\n\n- Documented\n- Tested\n- Small\n\nI don't accept pull requests for features that look like they'll be a large maintenance burden.\n\n## Acknowledgments\n\nThis project is forked from [jstzwj/PyRestic](https://github.com/jstzwj/PyRestic).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Restic backup Python wrapper",
"version": "1.3.0",
"project_urls": {
"Homepage": "https://github.com/mtlynch/resticpy.git",
"repository": "https://github.com/mtlynch/resticpy"
},
"split_keywords": [
"backup"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3d8c8e81026ca917e30439150c6508b0a8e2c4560d532aad97d0e8eab6bb4ef4",
"md5": "59159bd343eed7e8157059daa09880f2",
"sha256": "81c114dfa1547a0285dfd7c9d4290f025d4d4762900b00286af469729d12cf57"
},
"downloads": -1,
"filename": "resticpy-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "59159bd343eed7e8157059daa09880f2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 26868,
"upload_time": "2025-10-26T00:19:57",
"upload_time_iso_8601": "2025-10-26T00:19:57.105825Z",
"url": "https://files.pythonhosted.org/packages/3d/8c/8e81026ca917e30439150c6508b0a8e2c4560d532aad97d0e8eab6bb4ef4/resticpy-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b369cb549be36e32ac82315d983da61d5de3b41a3c63c123f7e39448df40c4fe",
"md5": "ffffc569cf5460986f91d407dc13a284",
"sha256": "b63eb3b45e45386b2a1d21519550cbc3ebcf36b2a0420db7fbd3055b1fb5464b"
},
"downloads": -1,
"filename": "resticpy-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "ffffc569cf5460986f91d407dc13a284",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16819,
"upload_time": "2025-10-26T00:19:58",
"upload_time_iso_8601": "2025-10-26T00:19:58.270947Z",
"url": "https://files.pythonhosted.org/packages/b3/69/cb549be36e32ac82315d983da61d5de3b41a3c63c123f7e39448df40c4fe/resticpy-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-26 00:19:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mtlynch",
"github_project": "resticpy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "resticpy"
}