Gramps-web-desktop

Are you interested in Gramps Web, but want to try it out locally without a lot of complex tools?

Then you might be interested in gramps-web-desktop. This is a mashup between Gramps for Desktops and Gramps Web. It:

  • uses your local family trees that you have created with gramps
  • doesn’t use Docker or other complex layers
  • creates a temp user for a session
  • is alpha! only use on test family trees! make a backup!

Here is the README for full instructions: GitHub - dsblank/gramps-web-desktop: Python package to view your gramps family tree with gramps-web

This is an experimental project, and likely to change. Why does it exist? I am hoping to get more people involved in the development of gramps-web (including me!), and wanted to make it easy to use.

If you want to share your family tree with others, you’ll want to use gramps-web-api directly.

Feedback, ideas welcomed!

[Thanks for @DavidMStraub for all of the work on gramps-web, and willingness to accept changes!]

gwd

5 Likes

Looks interesting!

My attempts at installation on both Windows and MSYS2 MINGW64 on Windows failed in the step which installs PyGObject. I almost expect this to fail on Windows, but I thought MSYS2 might succeed. The logs after the initial failure summary are long, can I share them with you offline?

On Windows:

Collecting PyGObject (from gramps-desktop[GUI,i18n]==5.2.*->gramps-webapi>=2.6.0->gramps-webapi[ai]>=2.6.0->gramps-web-desktop)
  Downloading pygobject-3.50.0.tar.gz (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 5.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

Under MSYS2 MINGW64 (with a working Gramps dev environment):

Collecting PyGObject (from gramps-desktop[GUI,i18n]==5.2.*->gramps-webapi>=2.6.0->gramps-webapi[ai]>=2.6.0->gramps-web-desktop)
  Using cached pygobject-3.50.0.tar.gz (1.1 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
1 Like

Sure! No problem, feel free to send. I need to fix install packages to not download so much.

1 Like

@dsblank, I tried installing it in a venv (is that advisable?) and got some error about pycairo (I think – I don’t understand all of it). This is on debian (on a Chromebook), where I already have Gramps installed, which is why I thought of using a venv.

georgewilmes@penguin:~$ python3 -m venv gwd
georgewilmes@penguin:~$ cd gwd
georgewilmes@penguin:~/gwd$ source bin/activate
(gwd) georgewilmes@penguin:~/gwd$ pip install gramps-web-desktop
Collecting gramps-web-desktop
Downloading gramps_web_desktop-0.0.2-py3-none-any.whl (2.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 3.9 MB/s eta 0:00:00
Collecting gramps>=5.2.0
Downloading gramps-5.2.3-py3-none-any.whl (16.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.2/16.2 MB 4.8 MB/s eta 0:00:00
Collecting gramps-webapi[ai]>=2.6.0
Downloading gramps_webapi-2.6.0-py3-none-any.whl (444 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 444.8/444.8 kB 4.8 MB/s eta 0:00:00
Collecting gramps-desktop[GUI,i18n]==5.2.*
Downloading gramps_desktop-5.2.2-py3-none-any.whl (16.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.2/16.2 MB 4.7 MB/s eta 0:00:00
Collecting Click>=7.0
Downloading click-8.1.7-py3-none-any.whl (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 3.7 MB/s eta 0:00:00
Collecting Flask>=2.1.0
Downloading flask-3.1.0-py3-none-any.whl (102 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.0/103.0 kB 5.7 MB/s eta 0:00:00
Collecting Flask-Caching>=2.0.0
Downloading Flask_Caching-2.3.0-py3-none-any.whl (28 kB)
Collecting Flask-Compress
Downloading Flask_Compress-1.17-py3-none-any.whl (8.7 kB)
Collecting Flask-Cors
Downloading Flask_Cors-5.0.0-py2.py3-none-any.whl (14 kB)
Collecting Flask-JWT-Extended!=4.4.0,!=4.4.1,>=4.2.1
Downloading Flask_JWT_Extended-4.7.1-py2.py3-none-any.whl (22 kB)
Collecting Flask-Limiter>=2.9.0
Downloading Flask_Limiter-3.9.2-py3-none-any.whl (28 kB)
Collecting Flask-SQLAlchemy
Downloading flask_sqlalchemy-3.1.1-py3-none-any.whl (25 kB)
Collecting marshmallow>=3.13.0
Downloading marshmallow-3.23.1-py3-none-any.whl (49 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.5/49.5 kB 4.0 MB/s eta 0:00:00
Collecting waitress
Downloading waitress-3.0.2-py3-none-any.whl (56 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.2/56.2 kB 3.6 MB/s eta 0:00:00
Collecting webargs
Downloading webargs-8.6.0-py3-none-any.whl (31 kB)
Collecting SQLAlchemy
Downloading SQLAlchemy-2.0.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 4.8 MB/s eta 0:00:00
Collecting pdf2image
Downloading pdf2image-1.17.0-py3-none-any.whl (11 kB)
Collecting Pillow
Downloading pillow-11.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (4.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 4.8 MB/s eta 0:00:00
Collecting bleach[css]>=5.0.0
Downloading bleach-6.2.0-py3-none-any.whl (163 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.4/163.4 kB 4.6 MB/s eta 0:00:00
Collecting jsonschema
Downloading jsonschema-4.23.0-py3-none-any.whl (88 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.5/88.5 kB 4.7 MB/s eta 0:00:00
Collecting ffmpeg-python
Downloading ffmpeg_python-0.2.0-py3-none-any.whl (25 kB)
Collecting boto3
Downloading boto3-1.35.76-py3-none-any.whl (139 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.2/139.2 kB 5.3 MB/s eta 0:00:00
Collecting alembic
Downloading alembic-1.14.0-py3-none-any.whl (233 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 233.5/233.5 kB 4.0 MB/s eta 0:00:00
Collecting celery[redis]
Downloading celery-5.4.0-py3-none-any.whl (425 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 426.0/426.0 kB 4.8 MB/s eta 0:00:00
Collecting Unidecode
Downloading Unidecode-1.3.8-py3-none-any.whl (235 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235.5/235.5 kB 4.3 MB/s eta 0:00:00
Collecting pytesseract
Downloading pytesseract-0.3.13-py3-none-any.whl (14 kB)
Collecting gramps-ql>=0.3.0
Downloading gramps_ql-0.3.0-py3-none-any.whl (9.0 kB)
Collecting object-ql>=0.1.2
Downloading object_ql-0.1.2-py3-none-any.whl (6.2 kB)
Collecting sifts>=0.8.3
Downloading sifts-1.0.0-py3-none-any.whl (10 kB)
Collecting sentence-transformers
Downloading sentence_transformers-3.3.1-py3-none-any.whl (268 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 268.8/268.8 kB 4.2 MB/s eta 0:00:00
Collecting openai
Downloading openai-1.57.0-py3-none-any.whl (389 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 389.9/389.9 kB 4.1 MB/s eta 0:00:00
Collecting PyGObject
Downloading pygobject-3.50.0.tar.gz (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 4.5 MB/s eta 0:00:00
Installing build dependencies … error
error: subprocess-exited-with-error

Γ— pip subprocess to install build dependencies did not run successfully.
β”‚ exit code: 1
╰─> [77 lines of output]
Collecting meson-python>=0.12.1
Downloading meson_python-0.17.1-py3-none-any.whl (27 kB)
Collecting pycairo>=1.16
Downloading pycairo-1.27.0.tar.gz (661 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 661.5/661.5 kB 3.5 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status β€˜done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status β€˜done’
Installing backend dependencies: started
Installing backend dependencies: finished with status β€˜done’
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status β€˜error’
error: subprocess-exited-with-error

    Γ— Preparing metadata (pyproject.toml) did not run successfully.
    β”‚ exit code: 1
    ╰─> [49 lines of output]
        + meson setup /tmp/pip-install-espm7cte/pycairo_46a220b660c440df8e5ea051feeb5c06 /tmp/pip-install-espm7cte/pycairo_46a220b660c440df8e5ea051feeb5c06/.mesonpy-fdrv8jj3 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dwheel=true -Dtests=false --native-file=/tmp/pip-install-espm7cte/pycairo_46a220b660c440df8e5ea051feeb5c06/.mesonpy-fdrv8jj3/meson-python-native-file.ini
        The Meson build system
        Version: 1.6.0
        Source dir: /tmp/pip-install-espm7cte/pycairo_46a220b660c440df8e5ea051feeb5c06
        Build dir: /tmp/pip-install-espm7cte/pycairo_46a220b660c440df8e5ea051feeb5c06/.mesonpy-fdrv8jj3
        Build type: native build
        Project name: pycairo
        Project version: 1.27.0
        C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
        C linker for the host machine: cc ld.bfd 2.40
        Host machine cpu family: x86_64
        Host machine cpu: x86_64
        Program python3 found: YES (/home/georgewilmes/gwd/bin/python3)
        Compiler for C supports arguments -Wall: YES
        Compiler for C supports arguments -Warray-bounds: YES
        Compiler for C supports arguments -Wcast-align: YES
        Compiler for C supports arguments -Wconversion: YES
        Compiler for C supports arguments -Wextra: YES
        Compiler for C supports arguments -Wformat=2: YES
        Compiler for C supports arguments -Wformat-nonliteral: YES
        Compiler for C supports arguments -Wformat-security: YES
        Compiler for C supports arguments -Wimplicit-function-declaration: YES
        Compiler for C supports arguments -Winit-self: YES
        Compiler for C supports arguments -Winline: YES
        Compiler for C supports arguments -Wmissing-format-attribute: YES
        Compiler for C supports arguments -Wmissing-noreturn: YES
        Compiler for C supports arguments -Wnested-externs: YES
        Compiler for C supports arguments -Wold-style-definition: YES
        Compiler for C supports arguments -Wpacked: YES
        Compiler for C supports arguments -Wpointer-arith: YES
        Compiler for C supports arguments -Wreturn-type: YES
        Compiler for C supports arguments -Wshadow: YES
        Compiler for C supports arguments -Wsign-compare: YES
        Compiler for C supports arguments -Wstrict-aliasing: YES
        Compiler for C supports arguments -Wundef: YES
        Compiler for C supports arguments -Wunused-but-set-variable: YES
        Compiler for C supports arguments -Wswitch-default: YES
        Compiler for C supports arguments -Wno-missing-field-initializers: YES
        Compiler for C supports arguments -Wno-unused-parameter: YES
        Compiler for C supports arguments -fno-strict-aliasing: YES
        Compiler for C supports arguments -fvisibility=hidden: YES
        Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
        Did not find CMake 'cmake'
        Found CMake: NO
        Run-time dependency cairo found: NO (tried pkgconfig)
  
        ../cairo/meson.build:31:12: ERROR: Dependency "cairo" not found, tried pkgconfig
  
        A full log can be found at /tmp/pip-install-espm7cte/pycairo_46a220b660c440df8e5ea051feeb5c06/.mesonpy-fdrv8jj3/meson-logs/meson-log.txt
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed
  
  Γ— Encountered error while generating package metadata.
  ╰─> See above for output.
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— pip subprocess to install build dependencies did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

With the help of @dsblank, I got it installed and running on Fedora 37.
using:
pip install gramps-web-desktop==0.0.2

The installation was HUGE (more than 6 gb) but it launches.

However, I cannot set the Home Person.

The 1st step, according to the First login page (after signing in), is to select the Home Person and language. And that doesn’t seem to be working:

I couldn’t tell if it expected an ID, the name (in which format), needed the full name or a partial. But I looked in the Number of people statistics on the Gramps Web Home Page and tried the info from one of the 42 people in tree. Nothing worked.

So I signed into the https://demo.grampsweb.org/ (username & password = owner) to see how dialog is supposed to work:

1 Like

First, I’m working in a venv too. For cairo and the subsequent errors the package installations below worked for me on Ubuntu. Basically you and I might have had runtimes installed, but not the dev libraries and other dependencies that GWD needs.

sudo apt-get install pkg-config
sudo apt-get install icu-devtools
sudo apt install libcairo2-dev
sudo apt install libicu-dev
sudo apt install cmake
sudo apt install libgirepository1.0-dev
sudo apt install libpq-dev

Downloading gobs of stuff, still running, but this should get you going.

[UPDATE: Completed building, up and running!] :slight_smile:

1 Like

Thanks @codefarmer, I’ve done all that now but still have a problem.

When I run the gwd command without parameters, it lists my available trees, as expected. But when I try to run it specifying one of those trees (as well as a username and password, as required), it says it can’t find it:

FileNotFoundError: [Errno 2] No such file or directory: β€˜~/.gramps/grampsdb/64fdc4dc’

Yet it is there:

(gwd) georgewilmes@penguin:~/gwd$ ls -l ~/.gramps/grampsdb/64fdc4dc
total 1952
-rw-r–r-- 1 georgewilmes georgewilmes 6 Sep 10 2023 database.txt
-rw-r–r-- 1 georgewilmes georgewilmes 0 Dec 7 18:50 meta_data.db
-rw-r–r-- 1 georgewilmes georgewilmes 10 Sep 10 2023 name.txt
-rw-r–r-- 1 georgewilmes georgewilmes 1990656 Dec 7 18:50 sqlite.db

And I can open it from my regular installation of Gramps.

Any ideas, anyone?

FYIW the only unusual thing I noticed among all the installation messages was this:

DEPRECATION: psycopg2 is being installed using the legacy β€˜setup.py install’ method, because it does not have a β€˜pyproject.toml’ and the β€˜wheel’ package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the β€˜β€“use-pep517’ option. Discussion can be found at Deprecate call to `setup.py install` when `wheel` is absent for source distributions without pyproject.toml Β· Issue #8559 Β· pypa/pip Β· GitHub

1 Like

Are you using the directory name (the handle for the Tree) or the human-friendly Name of the tree?

Use the name. If there are spaces, enclose the name by quotes. And it might be case-sensitive.

Thanks all for trying this out! I see that I need to understand what pip install gramps gramps-web-api does (and doesn’t) install, and what are the minimum requirements. I’ll keep working on this if you find the idea useful.

2 Likes

It is a very interesting project.

Even if installing too much stuff, we can probably experiment with it once the change Home Person can be made to work.

At the very least, a larger number of people can experiment enough to add some User docs.

1 Like

@DavidMStraub, how could we make a dependency list for gramps-web-api that was designed for local use, without include unwanted things, like postgresql and redis? And why is the GUI part of gramps needed?

Here is the currently list of gramps-web-api requirements:

dependencies = [
    "gramps-desktop[GUI,i18n]==5.2.*",
    "Click>=7.0",
    "Flask>=2.1.0",
    "Flask-Caching>=2.0.0",
    "Flask-Compress",
    "Flask-Cors",
    "Flask-JWT-Extended>=4.2.1,!=4.4.0,!=4.4.1",
    "Flask-Limiter>=2.9.0",
    "Flask-SQLAlchemy",
    "marshmallow>=3.13.0",
    "waitress",
    "webargs",
    "SQLAlchemy",
    "pdf2image",
    "Pillow",
    "bleach[css]>=5.0.0",
    "jsonschema",
    "ffmpeg-python",
    "boto3",
    "alembic",
    "celery[redis]",
    "Unidecode",
    "pytesseract",
    "gramps-ql>=0.3.0",
    "object-ql>=0.1.2",
    "sifts>=0.8.3",
]

I used the human-friendly name, following the example provided. There are no spaces in the name of the tree, but I tried it with and without quotes anyway (single and double).

Looks like the HOME tilde isn’t being expanded. I can fix that.

1 Like

How about a QR Code generator? So that you could snap a pic with your phone or tablet to easily log in on a local network.

Eventually, such a QR code could be printed for browsing the tree at family get-togethers and reunions.

That sounds like a good idea for gramps-web, but not for this desktop version, right? This isn’t designed for access outside the local enviroment. Or did I misunderstand?

Exactly, and we have to make that very clear - if somebody manages to expose it via the internet because it β€œjust works”, it would be dangerous.

Concerning dependencies: a problem is that Gramps core still doesn’t fully separate between GUI and non-GUI parts, there are some PyGObject imports in gramps.gen if I recall correctly. Also, some of the reports need Pycairo.

Ok, that sounds like something that could be fixed. What about a reduced set of requirements for gramps-web-api?

Our setup.py divides the Gramps packages into core and gui. When I wrote the code we were discussing the possibility of publishing a gramps-core and gramps-gui package instead of a single gramps package. The idea wasn’t progressed beyond this stage.

1 Like

Benny Malengier posted a Blog entry 19 Jun 2009 about having made the Gramps engine run (well… hobble along) as a standalone CLI application without GTK libraries.

https://gramps-project.org/blog/2009/06/look-without-gui/

Yes, I remember that work, and constructing a User() instance that is either for the CLI, or for the GUI. But as far as I know, the ability to just import gramps includes some GUI stuff, and breaks more general usage of the code base.

1 Like