Name | papermerge-cli JSON |
Version |
0.8.0
JSON |
| download |
home_page | |
Summary | Command line utility for your Papermerge DMS instance |
upload_time | 2024-02-22 06:05:30 |
maintainer | |
docs_url | None |
author | Eugen Ciur |
requires_python | >=3.10,<4.0 |
license | Apache 2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![Tests](https://github.com/papermerge/papermerge-cli/actions/workflows/tests.yml/badge.svg)](https://github.com/papermerge/papermerge-cli/actions/workflows/tests.yml)
# Papermerge Cli
Command line utility which uses REST API to interact with your Papermerge DMS
instance. You can use `papermerge-cli`, for example, to recursively import local folder to
your Papermerge DMS instance.
## Requirements
In order to use `papermerge-cli` you need to have python installed.
You need [python](https://www.python.org/) version >= 3.10.
## Install
$ pip install papermerge-cli
[pip](https://pypi.org/project/pip/) is package installer for python - it usually comes with python
interpreter. In order to install `pip` on Ubuntu use following command:
$ sudo apt install python3-pip
## REST API/CLI Version Compatibility
REST API column - is version of Papermerge REST API server. This value
you can get from:
$ papermerge-cli server-version
CLI column - is version of papermege-cli command line utility. This value
you can get from:
$ papermerge-cli --version
| REST API | CLI |
|----------|------|
| =3.0 | =0.7 |
| =2.1 | = 0.3.3|
## Usage
Get you REST API authentication token from your instance:
$ papermerge-cli --host=https://mydms.some-vps.com auth
Or you can provide host as environment variable:
$ export PAPERMERGE_CLI__HOST=https://mydms.some-vps.com
$ papermerge-cli auth
Papermerge Cli will prompt you for username and password. On successfull
authentication your REST API token will be displayed - now you can use
this token for all subsequent authentications.
Use token for authentication by exporting token as `PAPERMERGE_CLI__TOKEN`
environment variable:
$ export PAPERMERGE_CLI__TOKEN=mytoken
### list
Now, with `PAPERMERGE_CLI__HOST` and `PAPERMERGE_CLI__TOKEN` environment
variables set you can use list content of you home folder:
$ papermerge-cli list
In order to list content of specific folder (including inbox folder):
$ papermerge-cli list --parent-uuid=UUID-of-the-folder
### me
In order to see current user details (current user UUID, home folder UUID, inbox
folder UUID, username etc):
$ papermerge-cli me
### pref-list
List all preferences:
$ papermerge-cli pref-list
List specific section of the preferences
$ papermerge-cli pref-list --section=ocr
Show value of preference `trigger` from section `ocr`:
$ papermerge-cli pref-list --section=ocr --name=trigger
### pref-update
Update value of the preference `trigger` from section `ocr`:
$ papermerge-cli pref-update --section=ocr --name=trigger --value=auto
### import
Recursively imports folder from local filesystem. For example, in order
to import recursively all documents from local folder:
$ papermerge-cli import /path/to/local/folder/
You can also import one single document
$ papermerge-cli import /path/to/some/document.pdf
If you want the local copy the uploaded documents **to be deleted** after
successful import - add `--delete` flag:
$ papermerge-cli import --delete /path/to/folder/
PLEASE BE CAREFUL WITH `--delete` FLAG AS IT WILL IRREVERSIBLE DELETE THE LOCAL
COPY OF THE UPLOADED DOCUMENT!
Choose to skip OCR of imported documents with `--skip-ocr` flag:
$ papermerge-cli import --skip-ocr /path/to/folder/
Skip OCR flag can be used with folders (will apply to all docs in the folder)
or with individual documents.
`--skip-ocr` flag will work only with Papermerge REST API >= v3.1
### search
Search for node (document or folder) by text or by tags:
$ papermerge-cli search -q apotheke
Returns all documents (or folders with such title) containing OCRed
text 'apotheke'.
You can search by tags only:
$ papermerge-cli search --tags important
Will search for all documents (and folders) which were tagged with
tag 'important' When multiple tags are provided, by default, will search for
nodes with all mentioned tags:
$ papermerge-cli search --tags important,letters # returns nodes with both tags important AND letters
In case you want to search for nodes with ANY of the provided tags, use
`tags-op` parameter:
$ papermerge-cli search --tags important,letters --tags-op any
Finally, `tags` and `q` may be combined:
$ papermerge-cli search --tags important -q apartment
### download
Downloads a folder or a document:
$ papermerge-cli download --uuid <document or folder uuid>
In case uuid is the ID of specific folder - a zip file will be downloaded; zip
file will contain all nodes insides specified folder.
You can use `--uuid` multiple times:
$ papermerge-cli download --uuid <uuid of doc1> --uuid <uuid of doc2> --uuid <uuid of folder 1>
If you want to download content to specific file on your file-system, use `-f`
option:
$ papermerge-cli download --uuid <doc-uuid> -f /path/to/file-system/document.pdf
or in case of uuid is a folder:
$ papermerge-cli download --uuid <folder-uuid> -f /path/to/file-system/folder.zip
You can also specify the format/type of the downloaded archive (e.g. in case node is either a folder):
$ papermerge-cli download --uuid <folder-uuid> -f /path/to/file-system/folder.targz -t targz
## Version Compatiblity
| CLI Version | REST API version | Remarks|
|-------------|------------------|--------|
| 0.7.0 | 3.0.x ||
| 0.7.1 | 3.0.x ||
| 0.8.0 | 3.1.x | Skip OCR feature introduced|
Raw data
{
"_id": null,
"home_page": "",
"name": "papermerge-cli",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Eugen Ciur",
"author_email": "eugen@papermerge.com",
"download_url": "https://files.pythonhosted.org/packages/71/3a/a57fcc4e075dbd4933da5daa8f4bc665e994d1eea1b8110b736808ee2f79/papermerge_cli-0.8.0.tar.gz",
"platform": null,
"description": "[![Tests](https://github.com/papermerge/papermerge-cli/actions/workflows/tests.yml/badge.svg)](https://github.com/papermerge/papermerge-cli/actions/workflows/tests.yml)\n\n# Papermerge Cli\n\nCommand line utility which uses REST API to interact with your Papermerge DMS\ninstance. You can use `papermerge-cli`, for example, to recursively import local folder to\nyour Papermerge DMS instance.\n\n## Requirements\n\nIn order to use `papermerge-cli` you need to have python installed.\nYou need [python](https://www.python.org/) version >= 3.10.\n\n## Install\n\n $ pip install papermerge-cli\n\n[pip](https://pypi.org/project/pip/) is package installer for python - it usually comes with python\ninterpreter. In order to install `pip` on Ubuntu use following command:\n\n $ sudo apt install python3-pip\n\n\n## REST API/CLI Version Compatibility\n\nREST API column - is version of Papermerge REST API server. This value\nyou can get from:\n\n $ papermerge-cli server-version\n\nCLI column - is version of papermege-cli command line utility. This value\nyou can get from:\n\n $ papermerge-cli --version\n\n\n| REST API | CLI |\n|----------|------|\n| =3.0 | =0.7 |\n| =2.1 | = 0.3.3|\n\n## Usage\n\nGet you REST API authentication token from your instance:\n\n $ papermerge-cli --host=https://mydms.some-vps.com auth\n\nOr you can provide host as environment variable:\n\n $ export PAPERMERGE_CLI__HOST=https://mydms.some-vps.com\n $ papermerge-cli auth\n\nPapermerge Cli will prompt you for username and password. On successfull\nauthentication your REST API token will be displayed - now you can use\nthis token for all subsequent authentications.\n\nUse token for authentication by exporting token as `PAPERMERGE_CLI__TOKEN`\nenvironment variable:\n\n $ export PAPERMERGE_CLI__TOKEN=mytoken\n\n### list\n\nNow, with `PAPERMERGE_CLI__HOST` and `PAPERMERGE_CLI__TOKEN` environment\nvariables set you can use list content of you home folder:\n\n $ papermerge-cli list\n\nIn order to list content of specific folder (including inbox folder):\n\n $ papermerge-cli list --parent-uuid=UUID-of-the-folder\n\n### me\n\nIn order to see current user details (current user UUID, home folder UUID, inbox\nfolder UUID, username etc):\n\n $ papermerge-cli me\n\n### pref-list\n\nList all preferences:\n\n $ papermerge-cli pref-list\n\nList specific section of the preferences\n\n $ papermerge-cli pref-list --section=ocr\n\nShow value of preference `trigger` from section `ocr`:\n\n $ papermerge-cli pref-list --section=ocr --name=trigger\n\n### pref-update\n\nUpdate value of the preference `trigger` from section `ocr`:\n\n $ papermerge-cli pref-update --section=ocr --name=trigger --value=auto\n\n### import\n\nRecursively imports folder from local filesystem. For example, in order\nto import recursively all documents from local folder:\n\n $ papermerge-cli import /path/to/local/folder/\n\nYou can also import one single document\n\n $ papermerge-cli import /path/to/some/document.pdf\n\nIf you want the local copy the uploaded documents **to be deleted** after\nsuccessful import - add `--delete` flag:\n\n $ papermerge-cli import --delete /path/to/folder/\n\nPLEASE BE CAREFUL WITH `--delete` FLAG AS IT WILL IRREVERSIBLE DELETE THE LOCAL\nCOPY OF THE UPLOADED DOCUMENT!\n\nChoose to skip OCR of imported documents with `--skip-ocr` flag:\n\n $ papermerge-cli import --skip-ocr /path/to/folder/\n\nSkip OCR flag can be used with folders (will apply to all docs in the folder)\nor with individual documents.\n`--skip-ocr` flag will work only with Papermerge REST API >= v3.1\n\n### search\n\nSearch for node (document or folder) by text or by tags:\n\n $ papermerge-cli search -q apotheke\n\nReturns all documents (or folders with such title) containing OCRed\ntext 'apotheke'.\n\nYou can search by tags only:\n\n $ papermerge-cli search --tags important\n\nWill search for all documents (and folders) which were tagged with\ntag 'important' When multiple tags are provided, by default, will search for\nnodes with all mentioned tags:\n\n $ papermerge-cli search --tags important,letters # returns nodes with both tags important AND letters\n\nIn case you want to search for nodes with ANY of the provided tags, use\n`tags-op` parameter:\n\n $ papermerge-cli search --tags important,letters --tags-op any\n\nFinally, `tags` and `q` may be combined:\n\n $ papermerge-cli search --tags important -q apartment\n\n### download\n\nDownloads a folder or a document:\n\n $ papermerge-cli download --uuid <document or folder uuid>\n\nIn case uuid is the ID of specific folder - a zip file will be downloaded; zip\nfile will contain all nodes insides specified folder.\n\nYou can use `--uuid` multiple times:\n\n $ papermerge-cli download --uuid <uuid of doc1> --uuid <uuid of doc2> --uuid <uuid of folder 1>\n\nIf you want to download content to specific file on your file-system, use `-f`\noption:\n\n $ papermerge-cli download --uuid <doc-uuid> -f /path/to/file-system/document.pdf\n\nor in case of uuid is a folder:\n\n $ papermerge-cli download --uuid <folder-uuid> -f /path/to/file-system/folder.zip\n\nYou can also specify the format/type of the downloaded archive (e.g. in case node is either a folder):\n\n $ papermerge-cli download --uuid <folder-uuid> -f /path/to/file-system/folder.targz -t targz\n\n\n## Version Compatiblity\n\n\n| CLI Version | REST API version | Remarks|\n|-------------|------------------|--------|\n| 0.7.0 | 3.0.x ||\n| 0.7.1 | 3.0.x ||\n| 0.8.0 | 3.1.x | Skip OCR feature introduced|\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Command line utility for your Papermerge DMS instance",
"version": "0.8.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8259241b3e01bbaa10273fbad75c1fb002039f90aea8a6e99d52db9bd14c5718",
"md5": "cf285dcbb1f403767ac19bd3fa34f653",
"sha256": "1e50889d88f497a1d487e1acda7ee30137559eab5641cfaa87968175a9da94f6"
},
"downloads": -1,
"filename": "papermerge_cli-0.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cf285dcbb1f403767ac19bd3fa34f653",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 23893,
"upload_time": "2024-02-22T06:05:29",
"upload_time_iso_8601": "2024-02-22T06:05:29.165394Z",
"url": "https://files.pythonhosted.org/packages/82/59/241b3e01bbaa10273fbad75c1fb002039f90aea8a6e99d52db9bd14c5718/papermerge_cli-0.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "713aa57fcc4e075dbd4933da5daa8f4bc665e994d1eea1b8110b736808ee2f79",
"md5": "da82db86031ad2b181b707126936b94a",
"sha256": "d91c3b1b549005ca428c88836cb760c2d503bbfb5356a5379404491ec1af7bc9"
},
"downloads": -1,
"filename": "papermerge_cli-0.8.0.tar.gz",
"has_sig": false,
"md5_digest": "da82db86031ad2b181b707126936b94a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 17930,
"upload_time": "2024-02-22T06:05:30",
"upload_time_iso_8601": "2024-02-22T06:05:30.523536Z",
"url": "https://files.pythonhosted.org/packages/71/3a/a57fcc4e075dbd4933da5daa8f4bc665e994d1eea1b8110b736808ee2f79/papermerge_cli-0.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 06:05:30",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "papermerge-cli"
}