mep-django

Shakespeare and Company Project - Python/Django web application

https://github.com/princeton-cdh/mep-django

Science Score: 85.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    4 of 12 committers (33.3%) from academic institutions
  • Institutional organization owner
    Organization princeton-cdh has institutional domain (cdh.princeton.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

digital-humanities django lending-library python
Last synced: 6 months ago · JSON representation ·

Repository

Shakespeare and Company Project - Python/Django web application

Basic Info
Statistics
  • Stars: 5
  • Watchers: 15
  • Forks: 1
  • Open Issues: 53
  • Releases: 7
Topics
digital-humanities django lending-library python
Created over 8 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation Zenodo

README.rst

mep-django
==========

.. sphinx-start-marker-do-not-remove


Python/Django web application for the `Shakespeare and Company Project
`_,
a digital humanities project based on the archives of Sylvia Beach's
bookstore and lending library in Paris.

(This project was previously called "Mapping Expatriate Paris" or MEP).

Python 3.12 / Django 5 / Node 18 / Postgresql 14 / Solr 9

.. image:: https://github.com/Princeton-CDH/mep-django/workflows/unit_tests/badge.svg
    :target: https://github.com/Princeton-CDH/mep-django/actions?query=workflow%3Aunit_tests
    :alt: Unit Test status

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3834179.svg
   :target: https://doi.org/10.5281/zenodo.3834179

.. image:: https://codecov.io/gh/Princeton-CDH/mep-django/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/Princeton-CDH/mep-django/branch/main
    :alt: Code coverage

.. image:: https://www.codefactor.io/repository/github/princeton-cdh/mep-django/badge
   :target: https://www.codefactor.io/repository/github/princeton-cdh/mep-django
   :alt: CodeFactor

For specifics on the architecture and code, read `current release documentation `_.

Development instructions
------------------------

Initial setup and installation:

- Recommended: create and activate a python virtual environment using the
python version in `.python-version` using `pyenv `_.

   - `pyenv install` will install the specified version of python, if needed;
     `pyenv local` will report the configured version
   - Run `python -m venv env`  to create a new virtual environment named `env`
   - `source env/bin/activate` to activate the virtual environment

- Install required python dependencies::

    # install python dependencies, including dev dependencies
    pip install -e '.[dev]'

- Install javascript dependencies::

    npm install

- Compile static assets (css and javascript) with sourcemaps for development::

    npm run build:qa

- Copy sample local settings and configure for your environment::

    cp mep/settings/local_settings.py.sample mep/settings/local_settings.py

Remember to add a ``SECRET_KEY`` setting!

- Run the manage command to create your Solr core and configure the schema::

    python manage.py solr_schema

  The manage command will automatically reload the core to ensure schema
  changes take effect.

- Run the migrations::

    python manage.py migrate

- Index all indexable content into Solr::

    python manage.py index

- optionally, you can populate the Wagtail CMS with stub pages for the main
  navigation::

    python manage.py setup_site_pages

- If running this application on MariaDB/MySQL, you must make sure that
  time zone definitions are installed. On most flavors of Linux/MacOS,
  you may use the following command, which will prompt
  for the database server's root password::

    mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p

  If this command does not work, make sure you have the command line utilities
  for MariaDB/MySQL installed and consult the documentation for your OS for
  timezone info. Windows users will need to install a copy of the zoneinfo
  files.

  See `MariaDB `_'s
  info on the utility for more information.

Note that the admin index page will not reflect some changes without a manual
update - you will need to edit ``mep/dashboard.py`` to control the display and
ordering of admin items. More information is available in the `django-admin-tools
docs `_.

If you make changes to js or scss files and need to rebuild static assets::

    npm run build:qa

This will compile and minify all assets to ``static/`` with sourcemaps.
Alternatively, to run a production build without sourcemaps, you can use::

    npm run build:prod

Finally, for iterative frontend development, you can activate a webpack dev
server with hot reload using::

    npm start

Switching between the webpack dev server and serving from ``static/`` requires a
restart of your Django dev server to pick up the changed file paths.

Copy the project Solr configset in ``solr_conf`` into your solr server configset
directory. For a local install::

    cp -r solr_conf /path/to/solr/server/solr/configsets/shxco
    chown solr:solr -R /path/to/solr/server/solr/configsets/shxco

Create Solr collection with the configured configset (use create_core with
Solr standalone and create_collection with SolrCloud)::

    solr create_core -c shxco -n shxco

You will also need to configure Django to use the Solr instance in
``local_settings.py``::


    SOLR_CONNECTIONS["default"].update(
        {
            'URL': 'http://localhost:8983/solr/',
            'COLLECTION': 'shxco_dev',
            'CONFIGSET': 'shxco'
        }
    )


Unit Tests
----------

Python unit tests are written with `py.test `_ but use
Django fixture loading and convenience testing methods when that makes
things easier. To run them, first install development requirements::

    pip install -e '.[dev]'

Run tests using py.test::

    pytest

Javascript unit tests are written with `jest `__. To run
them::

    npm run test:unit


Accessibility Tests
-------------------

Automated accessibility tests run in travis using `pa11y-ci `_.
To run them locally, ensure that you have compiled frontend assets and a running
server::

    npm run build:prod
    python manage.py runserver --insecure

Then, run pa11y-ci to craw the sitemap and test for accessibility issues::

    npm run test:a11y

Running with ``DEBUG`` enabled will include the (inaccessible) Django
debug toolbar, so you'll probably want to turn it off.

Setup pre-commit hooks
~~~~~~~~~~~~~~~~~~~~~~

If you plan to contribute to this repository, please run the following command::

    pre-commit install

This will add a pre-commit hook to automatically format python code with `black `_.

Because these styling conventions were instituted after multiple releases of development on this project, ``git blame`` may not reflect the true author of a given line. In order to see a more accurate ``git blame`` execute the following command::

    git blame  --ignore-revs-file .git-blame-ignore-revs

Or configure your git to always ignore styling revision commits::

    git config blame.ignoreRevsFile .git-blame-ignore-revs

Documentation
-------------

Documentation is generated using `sphinx `_.
To generate documentation, first install development requirements::

    pip install -r dev-requirements.txt

Then build documentation using the customized make file in the `docs`
directory::

    cd sphinx-docs
    make html

To build and publish documentation for a release, add the ``gh-pages`` branch
to the ``docs`` folder in your worktree::

  git worktree add -B gh-pages docs origin/gh-pages

In the ``sphinx-docs`` folder, use ``make docs`` to build the HTML documents
and static assets, add it to the docs folder, and commit it for publication on
Github Pages. After the build completes, push to GitHub from the ``docs`` folder.

License
-------
This project is licensed under the `Apache 2.0 License `_.

©2024 Trustees of Princeton University. Permission granted via Princeton Docket #21-3743-1 for distribution online under a standard Open Source license.

Owner

  • Name: Center for Digital Humanities at Princeton
  • Login: Princeton-CDH
  • Kind: organization
  • Email: cdh-info@princeton.edu
  • Location: Princeton, New Jersey

Citation (CITATION.cff)

# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.0.3
message: If you use this software, please cite it using these metadata.
title: 'Princeton-CDH/mep-django'
doi: 10.5281/zenodo.4458099
authors:
- given-names: Rebecca Sutton
  family-names: Koeser
  affiliation: Princeton University
  orcid: https://orcid.org/0000-0002-8762-8057
- given-names: Nick
  family-names: Budak
  affiliation: Princeton University
  orcid: https://orcid.org/0000-0002-4542-0899
- given-names: Gissoo
  family-names: Doroudian
  affiliation: Princeton University
  orcid: https://orcid.org/0000-0002-6702-6964
- given-names: Kevin
  family-names: McElwee
  affiliation: Princeton University
  orcid: https://orcid.org/0000-0002-9973-560X
- given-names: Benjamin
  family-names: Hicks
- given-names: Xinyi
  family-names: Li
  orcid: https://orcid.org/0000-0002-6114-3182
version: '1.5.4'
date-released: 2021-12-03
repository-code: https://github.com/Princeton-CDH/mep-django
license: Apache-2.0
references:
- type: website
  title: Shakespeare and Company Project
  year: 2020
  authors:
  - name: The Center for Digital Humanities at Princeton
    website: https://cdh.princeton.edu
  url: https://shakespeareandco.princeton.edu/

GitHub Events

Total
  • Create event: 12
  • Release event: 2
  • Issues event: 22
  • Watch event: 1
  • Delete event: 9
  • Member event: 1
  • Issue comment event: 48
  • Push event: 44
  • Pull request review comment event: 4
  • Pull request review event: 11
  • Pull request event: 18
Last Year
  • Create event: 12
  • Release event: 2
  • Issues event: 22
  • Watch event: 1
  • Delete event: 9
  • Member event: 1
  • Issue comment event: 48
  • Push event: 44
  • Pull request review comment event: 4
  • Pull request review event: 11
  • Pull request event: 18

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 2,452
  • Total Committers: 12
  • Avg Commits per committer: 204.333
  • Development Distribution Score (DDS): 0.419
Past Year
  • Commits: 98
  • Committers: 2
  • Avg Commits per committer: 49.0
  • Development Distribution Score (DDS): 0.459
Top Committers
Name Email Commits
rlskoeser r****r@p****u 1,424
Nick Budak t****y@g****m 595
Benjamin Hicks b****s@g****m 271
gissoo 4****o 62
Ben Silverman b****n@p****m 53
Ryan Heuser r****r@p****u 26
Kevin McElwee k****e@g****m 9
codefactor-io s****t@c****o 7
xinyil x****i@n****U 2
xinyil x****x@g****m 1
xinyil x****i@n****U 1
xinyil x****i@X****1 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 119
  • Total pull requests: 71
  • Average time to close issues: 3 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 10
  • Total pull request authors: 6
  • Average comments per issue: 4.31
  • Average comments per pull request: 1.38
  • Merged pull requests: 47
  • Bot issues: 0
  • Bot pull requests: 14
Past Year
  • Issues: 16
  • Pull requests: 26
  • Average time to close issues: 19 days
  • Average time to close pull requests: 10 days
  • Issue authors: 6
  • Pull request authors: 3
  • Average comments per issue: 1.06
  • Average comments per pull request: 0.92
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • rlskoeser (61)
  • meg-codes (17)
  • jkotin (14)
  • jerielizabeth (7)
  • elspethgreen (5)
  • quadrismegistus (4)
  • blms (4)
  • mnaydan (3)
  • thatbudakguy (3)
  • laurejt (1)
Pull Request Authors
  • rlskoeser (37)
  • dependabot[bot] (14)
  • blms (11)
  • quadrismegistus (4)
  • thatbudakguy (4)
  • meg-codes (1)
Top Labels
Issue Labels
chore (10) bug (8) awaiting testing (7) wontfix (4) enhancement (1) 🚧 maintenance (1) 👇this sprint (1)
Pull Request Labels
dependencies (14) javascript (14)

Dependencies

package-lock.json npm
  • 1260 dependencies
package.json npm
  • @babel/core ^7.2.2 development
  • @babel/preset-env ^7.3.1 development
  • @types/d3 ^5.7.2 development
  • @types/dom-inputevent ^1.0.5 development
  • @types/esri-leaflet ^2.1.5 development
  • @types/jest ^24.0.11 development
  • @types/leaflet ^1.5.5 development
  • @types/masonry-layout ^4.2.1 development
  • autoprefixer ^9.4.6 development
  • awesome-typescript-loader ^5.2.1 development
  • babel-core ^7.0.0-bridge.0 development
  • babel-jest ^24.6.0 development
  • babel-loader ^8.0.5 development
  • browserslist ^4.16.0 development
  • caniuse-lite ^1.0.30001165 development
  • clean-webpack-plugin ^1.0.1 development
  • css-loader ^2.1.0 development
  • file-loader ^3.0.1 development
  • jest ^24.0.0 development
  • jest-environment-jsdom-fourteen ^0.1.0 development
  • jest-marbles ^2.3.1 development
  • mini-css-extract-plugin ^0.5.0 development
  • node-sass ^4.14.1 development
  • node-sass-glob-importer ^5.3.0 development
  • optimize-css-assets-webpack-plugin ^5.0.1 development
  • postcss-loader ^3.0.0 development
  • sass-loader ^7.1.0 development
  • source-map-loader ^0.2.4 development
  • style-loader ^0.23.1 development
  • terser-webpack-plugin ^1.2.1 development
  • ts-jest ^24.0.1 development
  • typescript ^3.4.1 development
  • webpack ^4.29.0 development
  • webpack-bundle-tracker ^0.4.2-beta development
  • webpack-cli ^3.3.11 development
  • webpack-dev-server ^3.11.0 development
  • whatwg-fetch ^3.0.0 development
  • d3 ^5.12.0
  • esri-leaflet ^2.3.1
  • leaflet ^1.5.1
  • masonry-layout ^4.2.2
  • rxjs ^6.5.1
  • tablesort ^5.1.0
dev-requirements.txt pypi
  • django-debug-toolbar * development
  • pytest >=5 development
  • pytest-cov * development
  • pytest-django >=3.4.7 development
  • pytest-ordering * development
  • sphinx * development
  • wheel * development
requirements.txt pypi
  • Django >=3.0,<3.1
  • beautifulsoup4 <4.9
  • bleach *
  • cached_property *
  • django-apptemplates *
  • django-autocomplete-light ==3.5.1
  • django-cas-ng <4.2
  • django-csp *
  • django-fullurl *
  • django-grappelli >=2.14.1
  • django-markdownify <0.9
  • django-tabular-export *
  • django-webpack-loader <1.0
  • django-widget-tweaks *
  • djiffy >=0.6
  • eulxml *
  • parasolr >=0.6.1,<0.7
  • progressbar2 *
  • psycopg2-binary <2.9
  • pucas >=0.6
  • py-flags *
  • pymarc *
  • python-dateutil *
  • rdflib <6.0
  • rdflib-jsonld <0.6.2
  • stop_words *
  • tweepy *
  • unidecode *
  • viapy >=0.2
  • wagtail >=2.10,<2.11
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v2 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/autobuild v1 composite
  • github/codeql-action/init v1 composite
.github/workflows/unit_tests.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-node v2-beta composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite
  • codecov/codecov-action v1 composite
  • rtCamp/action-slack-notify master composite
  • postgres 12 docker
  • solr 8.6 docker