Skip to main content

APIS Bibsonomy

APIS Bibsonomy is a small addon to the APIS system. It allows to store references in Bibsonomy instances and use these references in APIS. It is very generic and should work with most Django installations/projects.

Installation

  • Install the package:

    pip install apis-bibsonomy

  • Add the package to your installed apps:

    INSTALLED_APPS = [
    ...
    'apis_bibsonomy'
    ]
    
  • And migrate your DB:

    python manage.py migrate

Some functionality from APIS Bibsonomy uses htmx, so you should include htmx into your web application.

Configuration

APIS Bibsonomy needs an URL of the bibsonomy or zotero instance, a username, a API token and an (optional) collection to search in.

You need to add a configuration section to your APIS settings:

APIS_BIBSONOMY = [{
   'type': 'bibsomomy', #or zotero
   'url': 'http://url.at', #url of the bibsonomy instance or zotero.org
   'user': 'username', #for zotero use the user id number found in settings
   'API key': 'api_key',
   'group': 'group'
}]

If you want the plugin to add the reference buttons to certain fields you need to add these fields to the config:

APIS_BIBSONOMY_FIELDS = ['name', 'first_name', 'profession']

Restart your server and you are good to go.

htmx

APIS Bibsonomy uses htmx. The delete buttons for references trigger deletion via the API delete route which give an empty response on success. HTMX needs to be configured to swap the content even if the response is empty:

document.body.addEventListener('htmx:beforeSwap', function(event) {
  if (event.detail.xhr.status === 204) {
    // Swap content even when the response is empty.
    event.detail.shouldSwap = true;
  }
});

Usage

not needed if you are using standard APIS templates

  • Include the base template somewhere in the header of your template:

{% include 'apis_bibsonomy/apis_bibsonomy_include.html' %}

  • Load the templatetag:

{% load bibsonomy_templatetags %}

  • Include the form somewhere in your template (set hidden=True if you intend to use buttons):

{% bibsonomy_form content_type='person' hidden=True %}

  • And finally add html tags as anker element for the reference forms to your template (dont forget to set "bibsonomy-anker" as class):

<button class="bibsonomy-anker" data-bibs-contenttype="person" data-bibs-object_pk={{instance.pk}} data-bibs-attribute="Attribute name (optional)">Ref</button>

  • If you want to batch add reference forms to attribute fields in a whole form add a hidden anker element. You need to additionally add the names of the form fields you want to have reference forms for to data-bibs-form-elements=""

<button class="bibsonomy-anker-hidden" data-bibs-contenttype="person" data-bibs-object_pk={{instance.pk}} data-bibs-form-elements="first_name|name|gender|start_date_written|lat">Ref</button>

Licenses

The book icon used for the reference link is the SVG from the Import Contacts icon from the material symbols

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apis_bibsonomy-0.15.3.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apis_bibsonomy-0.15.3-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file apis_bibsonomy-0.15.3.tar.gz.

File metadata

  • Download URL: apis_bibsonomy-0.15.3.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for apis_bibsonomy-0.15.3.tar.gz
Algorithm Hash digest
SHA256 e78d5af9859aae58c53ce0c1ccb4a6c970b37219b7da95e2482749c251e2a318
MD5 b265a55024ce684a0999f3d532ff7ac4
BLAKE2b-256 c7f5e0b6840e75a2404c0c1b05f79d7df65ac5c51f168232e8779e16d4fb3156

See more details on using hashes here.

Provenance

The following attestation bundles were made for apis_bibsonomy-0.15.3.tar.gz:

Publisher: publish.yml on acdh-oeaw/apis-bibsonomy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file apis_bibsonomy-0.15.3-py3-none-any.whl.

File metadata

  • Download URL: apis_bibsonomy-0.15.3-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for apis_bibsonomy-0.15.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8aa25609ac91bdc76945c524dac444a7b12ab06c45a7e77c37ed995d83d5cc47
MD5 181eef974a00b53b4141d29809ae94d3
BLAKE2b-256 5e179bee2520a0aa7e0c9adb732e393aaa9f75ecb42960964576a384ab9748e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for apis_bibsonomy-0.15.3-py3-none-any.whl:

Publisher: publish.yml on acdh-oeaw/apis-bibsonomy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.15.3 This release

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.3

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

1 file

0.2.1

1 file

0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page