https://github.com/acdh-oeaw/acdh-django-handle

A django app to create and manage handle-pids.

https://github.com/acdh-oeaw/acdh-django-handle

Science Score: 10.0%

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

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary

Keywords

acdh-django-packages django

Keywords from Contributors

interactive projection archival sequences observability autograding hacking shellcodes modular network-simulation
Last synced: 6 months ago · JSON representation

Repository

A django app to create and manage handle-pids.

Basic Info
  • Host: GitHub
  • Owner: acdh-oeaw
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 23.4 KB
Statistics
  • Stars: 1
  • Watchers: 5
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
acdh-django-packages django
Created over 7 years ago · Last pushed about 3 years ago
Metadata Files
Readme Changelog Contributing License

README.rst

=============================
acdh-django-handle
=============================

.. image:: https://badge.fury.io/py/acdh-django-handle.svg
    :target: https://badge.fury.io/py/acdh-django-handle

A django app to create and manage handle-pids_.


Quickstart
----------

Install acdh-django-handle::

    pip install acdh-django-handle

Add it to your `INSTALLED_APPS`:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'handle',
        ...
    )

Provide a handle-config dict:

.. code-block:: python

    HANDLE = {
        'resolver': "http://hdl.handle.net",
        'user': "your handle-provider user",
        'pw': "your handle-provider password",
        'url': "base url to your handle-provider api",
        'app_base_url': "the base url of your application"
    }

example:

.. code-block:: python

    HANDLE = {
        'resolver': "http://hdl.handle.net",
        'user': "user11.1234567-01",
        'pw': "password1234",
        'url': "http://pid.gwdg.de/handles/11.1234567-01/",
        'app_base_url': "https://myproject.com"
    }

The value of `app_base_url` will be concaneted with the value of the `get_absolute_url` method of the model instance you want to register a handle for.

And run

    python manage.py migrate handle


Create/register handle-pids
----

The package provides a management command to bulk create/register handle-pids. For this you'll have to
* add a `GenericRelation` property to the model class you would like register handles for
* and make sure you have a `get_absolute_url` method defined

.. code-block:: python

    from django.contrib.contenttypes.fields import GenericRelation
    from handle.models import Pid

    ...

    class Example(models.Model):
        name = models.CharField(
            max_length=255, blank=True,
        )
        ...
        pid = GenericRelation(Pid, blank=True, null=True, related_query_name="get_pid")
        ...
        def get_absolute_url(self):
            return reverse('example_detail', kwargs={'pk': self.id})

To register/create handle-pids run:

    python manage.py crate_handles example

In case your GenericRelation property is named something else than `pid` you need to pass in the name as second argument, e.g:

    python manage.py crate_handles example --pid=

Handle-Pids will only be crated for objects which do not have a handle-pid yet.


Features
--------

* Provides a `Pid` class which stores
  * a handle-pid
  * creation and modification date
  * a generic relation to any other class of your django project.
  * an overidden save-method which will register/create a handle-pid on save in case you didn't provide a handle-pid

* Provides a `handle.utils.create_handle` function to register/create a new handle-pid

* Register/Create handle-pid for any objects in your project via admin-interface.

* Provides a management command to bulk create/register handle-pids for all instances of a model-class in your project.

Build and publish
-----

.. code-block:: console

    python setup.py sdist bdist_wheel
    twine upload dist/*

Credits
-------

Tools used in rendering this package:

*  Cookiecutter_
*  `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
.. _handle-pids: http://www.handle.net/

Owner

  • Name: Austrian Centre for Digital Humanities & Cultural Heritage
  • Login: acdh-oeaw
  • Kind: organization
  • Email: acdh@oeaw.ac.at
  • Location: Vienna, Austria

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 6
  • Total Committers: 2
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.167
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Peter Andorfer P****r@o****t 5
dependabot[bot] 4****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 16 hours
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 53 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 2
  • Total versions: 2
  • Total maintainers: 1
pypi.org: acdh-django-handle

A django app to create and manage handle-pids

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 2
  • Downloads: 53 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 11.5%
Average: 21.5%
Downloads: 24.2%
Forks count: 29.8%
Stargazers count: 31.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements_dev.txt pypi
  • bumpversion ==0.5.3 development
  • wheel ==0.30.0 development
requirements_test.txt pypi
  • codecov >=2.0.0 test
  • coverage ==4.4.1 test
  • flake8 >=2.1.0 test
  • mock >=1.0.1 test
  • tox >=1.7.0 test
setup.py pypi
  • requests *