Skip to content

arthur-schnitzler/pmb-service

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flake8 Lint Test codecov

PMB-SERVICE

lightweight APIS-PMB instance to generate TEI/XML dumps

maybe in future also with PMB CRUD included

install

  • clone the repo
  • create a virtual env python -m venv venv
  • activate it source venv/bin/activate
  • install packages pip install -r requirements_dev.txt
  • get a recent db-dump (./dump_and_restore.sh) (create a postgres-db pmb and run ./dump_and_restore.sh, make sure you tunneled to production db first)
  • set env variables
  • run python manage.py runserver
  • (create a superuser) python manage.py creatsuperuser

jupyter notebook

  • pip install notebook (1 time)
  • set env varibles ./set_env_variables
  • python manage.py shell_plus --lab

cheat-sheet

process gnd-beacon

python manage.py process_beacon --beacon=https://thun-korrespondenz.acdh.oeaw.ac.at/beacon.txt --domain=thun-korrespondenz

python manage.py process_beacon --beacon=https://raw.githubusercontent.com/Auden-Musulin-Papers/amp-entities/main/out/beacon.txt --domain=Auden-Musulin-Papers

python manage.py process_beacon --beacon=https://raw.githubusercontent.com/Hanslick-Online/hsl-entities/main/out/beacon.txt --domain=Hanslick

set up new instance

in order to avoid errors on a new instance you'll need to set an environment variable PMB_NEW=whatever. After you run the inital python manage.py migrate you should unset PMB_NEW

vite

  • bundling js-code (used for network-vis) is not part of the docker-setup
  • for development make sure the vite-dev-server is running pnpm run vite
  • for building new bundle, run pn run build

reset sequence

BEGIN; 
SELECT setval(pg_get_serial_sequence('"django_migrations"','id'), coalesce(max("id"), 1), max("id") IS NOT null) FROM "django_migrations";
COMMIT;

About

maybe a new PMB, maybe just some wasted time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 74.4%
  • HTML 15.2%
  • Jupyter Notebook 9.3%
  • JavaScript 0.4%
  • CSS 0.3%
  • Shell 0.3%
  • Dockerfile 0.1%