-c, --compare-checksums
-f, --use-filename-format
-d, --delete
+-z --zip
```
`target` is a folder to which the data gets written. This includes
Be careful when pointing paperless to a directory that already contains
other files.
+If `-z` or `--zip` is provided, the export will be a zipfile
+in the target directory, named according to the current date.
+
The filenames generated by this command follow the format
`[date created] [correspondent] [title].[extension]`. If you want
paperless to use `PAPERLESS_FILENAME_FORMAT` for exported filenames
@override_settings(PASSPHRASE="test")
def test_export_zipped(self):
+ """
+ GIVEN:
+ - Request to export documents to zipfile
+ WHEN:
+ - Documents are exported
+ THEN:
+ - Zipfile is created
+ - Zipfile contains exported files
+ """
shutil.rmtree(os.path.join(self.dirs.media_dir, "documents"))
shutil.copytree(
os.path.join(os.path.dirname(__file__), "samples", "documents"),
@override_settings(PASSPHRASE="test")
def test_export_zipped_format(self):
+ """
+ GIVEN:
+ - Request to export documents to zipfile
+ - Export is following filename formatting
+ WHEN:
+ - Documents are exported
+ THEN:
+ - Zipfile is created
+ - Zipfile contains exported files
+ """
shutil.rmtree(os.path.join(self.dirs.media_dir, "documents"))
shutil.copytree(
os.path.join(os.path.dirname(__file__), "samples", "documents"),
self.assertTrue(os.path.isfile(expected_file))
with ZipFile(expected_file) as zip:
- print(zip.namelist())
# Extras are from the directories, which also appear in the listing
self.assertEqual(len(zip.namelist()), 14)
self.assertIn("manifest.json", zip.namelist())