This python package is the heart of Papermerge project. It consists of a set of reusable Django apps which are consumed across different bundles of Papermerge Document Management System (DMS).
Technically speaking, it contains following Django apps:
papermerge.core
- the epicenter of Papermerge projectpapermerge.notifications
- Django Channels app for sending notifications via websocketspapermerge.search
- Thin RESTful API layer over elasticsearch
This package is intended to be part of Django project like this one for example.
Papermerge is an open source document management system (DMS) primarily designed for archiving and retrieving your digital documents. Instead of having piles of paper documents all over your desk, office or drawers - you can quickly scan them and configure your scanner to directly upload to Papermerge DMS. Papermerge DMS on its turn will extract text data from the scanned documents using Optical Character Recognition (OCR) technology the index it and make it searchable. You will be able to quickly find any (scanned!) document using full text search capabilities.
Papermerge is perfect tool to manage documents in PDF, JPEG, TIFF and PNG formats.
- RESTul API
- Documents of pdf, jpg, png, tiff formats are supported
- OCR (Optical Character Recognition) of the documents (uses OCRmyPDF)
- Full Text Search of the scanned documents (uses elasticsearch)
- Document Versions
- User defined metadata per folder/document/page
- Tags - assign colored tags to documents or folders
- Documents and Folders - users can organize documents in folders
- Multi-User (Groups, Roles)
- User permissions management
- Document permissions management
- Page Management - delete, reorder, cut & paste pages (uses PikePDF)
- Automation
Online documentation is available at https://docs.papermerge.io
Use poetry to switch into python virtual environment:
poetry shell
Then install all dependencies in current python virtual environment:
poetry install
Test suite is devided into two big groups:
- tests.core
- tests.search
First group (tests.core) is concerned with tests for papermerge.core
while
second one (tests.search) is concerned with tests for papermerge.search
. In
order to run tests.core
tests you need to have redis up and running; in
order to run test.search
you need to both redis and elasticsearch up and
running.
Before running core tests suite, make sure redis service is up and running. Run tests:
DJANGO_SETTINGS_MODULE=tests.config.core_settings PYTHONPATH=. pytest tests/core/
Another way to invoke pytest, which automatically adds current working directory to PYTHONPATH:
DJANGO_SETTINGS_MODULE=tests.config.core_settings python -m pytest tests/core/
Disable warning during test runs:
DJANGO_SETTINGS_MODULE=tests.config.core_settings python -m pytest --disable-warnings tests/core/
One handy shortcut to invoke pytests in python virtual environment:
DJANGO_SETTINGS_MODULE=tests.config.core_settings poetry run python -m pytest --disable-warnings tests/core/
You can use run-tests.sh
bash script to run core tests:
./run-tests.sh core
Before running search tests suite, make sure both redis and elasticsearch services are up and running:
DJANGO_SETTINGS_MODULE=tests.config.search_settings poetry run python -m pytest --disable-warnings tests/search/
You can use run-tests.sh
bash script to run tests for search app:
./run-tests.sh search