Skip to content

Commit 94b63b1

Browse files
committed
feat: add citation helper and update README for scholarly use
1 parent d1179c5 commit 94b63b1

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Native Python bindings for ArcadeDB (forked from the official Java project).
88
[![Test Python Bindings](https://github.com/humemai/arcadedb-embedded-python/actions/workflows/test-python-bindings.yml/badge.svg)](https://github.com/humemai/arcadedb-embedded-python/actions/workflows/test-python-bindings.yml)
99
[![Test Python Examples](https://github.com/humemai/arcadedb-embedded-python/actions/workflows/test-python-examples.yml/badge.svg)](https://github.com/humemai/arcadedb-embedded-python/actions/workflows/test-python-examples.yml)
1010
[![Release to PyPI](https://github.com/humemai/arcadedb-embedded-python/actions/workflows/release-python-packages.yml/badge.svg)](https://github.com/humemai/arcadedb-embedded-python/actions/workflows/release-python-packages.yml)
11+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18399208.svg)](https://doi.org/10.5281/zenodo.18399208)
1112

1213
---
1314

@@ -75,6 +76,20 @@ This repo is a fork of ArcadeDB Java. For the server, Java API, and core databas
7576
- Issues (Python bindings): https://github.com/humemai/arcadedb-embedded-python/issues
7677
- ArcadeDB Discord: https://discord.gg/w2Npx2B7hZ
7778

79+
## 🧾 Citing
80+
81+
If you use this project in scholarly work, please cite the version you used via Zenodo:
82+
83+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18399208.svg)](https://doi.org/10.5281/zenodo.18399208)
84+
85+
You can also get a version-specific DOI URL from the installed package:
86+
87+
```python
88+
import arcadedb_embedded as arcadedb
89+
90+
arcadedb.cite()
91+
```
92+
7893
## 📄 License
7994

8095
Both upstream ArcadeDB (Java) and this ArcadeDB Embedded Python project are licensed under Apache 2.0, fully open and free for everyone, including commercial use.

bindings/python/src/arcadedb_embedded/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
# Import batch processing
1515
from .batch import BatchContext
1616

17+
# Import citation helper
18+
from .citation import cite
19+
1720
# Import core database classes
1821
from .core import (
1922
Database,
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"""Citation helpers for ArcadeDB Embedded Python."""
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
7+
from ._version import __version__
8+
from .exceptions import ArcadeDBError
9+
10+
# Map released package versions to Zenodo version-specific DOIs.
11+
# Update this mapping on each release.
12+
_VERSION_DOI_MAP = {
13+
"26.1.1.post3": "10.5281/zenodo.18399749",
14+
}
15+
16+
17+
def cite(version: Optional[str] = None) -> str:
18+
"""Return the DOI URL for a given ArcadeDB Embedded Python version.
19+
20+
Parameters
21+
----------
22+
version : str or None
23+
The version to cite. If None, the current installed version is used.
24+
25+
Returns
26+
-------
27+
doi_url : str
28+
The DOI URL for the given version.
29+
30+
Raises
31+
------
32+
ArcadeDBError
33+
If the requested version is not found in the citation index.
34+
35+
Examples
36+
--------
37+
>>> import arcadedb_embedded as arcadedb
38+
>>> arcadedb.cite("26.1.1.post3")
39+
"https://doi.org/10.5281/zenodo.18399749"
40+
"""
41+
42+
if version is None:
43+
version = __version__
44+
45+
if version not in _VERSION_DOI_MAP:
46+
if "dev" in version:
47+
raise ArcadeDBError(
48+
f"Version {version} is not yet released and therefore does not yet have a citable DOI."
49+
)
50+
raise ArcadeDBError(f"Version {version} not found in the citation index")
51+
52+
return f"https://doi.org/{_VERSION_DOI_MAP[version]}"

0 commit comments

Comments
 (0)