Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Not stable

Peerpedia Core

PyPI Python

Zero-dependency protocol layer for PeerPedia — the peer-reviewed academic publishing platform built on Git.

peerpedia-core          ← this package: protocols, types, exceptions
├── peerpedia-storage   ← SQL + Git backends   (separate package)
├── peerpedia-transport ← HTTP / P2P transport  (separate package)
├── peerpedia-compute   ← scoring & reputation  (separate package)
├── peerpedia-social    ← notifications, shares (separate package)
└── peerpedia-app       ← CLI, server, REPL     (separate package)

What this package is

peerpedia-core defines the contracts — every other PeerPedia package depends on this one. It contains:

  • Types — frozen dataclasses for Article, Review, User, Scores, Version, query types, and write payloads. All storage-agnostic, no IO.
  • Protocols — typing.Protocol classes for storage backends, lifecycle state machines, sync, auth, authorization, compilation, and scoring.
  • Exceptions — semantic exception hierarchy with machine-readable codes.
  • Crypto protocols — algorithm-agnostic SigningKey / PublicKey interfaces.
  • Lifecycle dispatcher — execute() reduces an action+context through a pluggable state machine.
  • Peerpedia facade — dependency-injection wrapper that wires protocols into a usable engine.

The Scores type is a generic Mapping[str, float] wrapper — the compute plugin (peerpedia-compute) defines which dimensions exist and how they are aggregated. Aggregate scores are a read-side projection over review data, not an article attribute stored in core.

What this package is NOT

  • Not a storage backend. See peerpedia-storage for SQLAlchemy and GitPython implementations of the storage protocols.
  • Not a scoring algorithm. See peerpedia-compute for average, reputation-weighted, and sedimentation engines.
  • Not a CLI, server, or REPL. See peerpedia-app.

Quick start

from peerpedia_core import Peerpedia
from peerpedia_core.types import Article, ArticleId, User, UserId

# Peerpedia needs concrete backends — swap these with real implementations
# from peerpedia-storage in production:
#
#   from peerpedia_storage import SqlArticleStorage, SqlUserStorage, SqlLifecycle
#
from tests.conftest import MemArticleStorage, MemLifecycle, MemUserStorage

storage = MemArticleStorage()
pp = Peerpedia(
    storage=storage,
    lifecycle=MemLifecycle(storage),
    user_storage=MemUserStorage(),
)

# Create an article
aid = pp.create()

# Revise it
article = Article(id=aid, title="My Paper", status="draft", authors=("Alice",))
pp.revise(aid, content="# Hello World", article=article)

# Read metadata back
meta = pp.read_meta(aid)
print(meta.title)  # "My Paper"

Note: The Mem* backends above live in tests/conftest.py and are only available in editable/dev installs. Production code imports from peerpedia-storage (SQLAlchemy + GitPython) or peerpedia-transport instead.

Protocols

This table shows every protocol in core and which package implements it.

Protocol File Implemented by
ArticleMetaStorage protocols/storage/article.py peerpedia-storage
ArticleContentStorage protocols/storage/article.py peerpedia-storage
ArticleStorage protocols/storage/article.py peerpedia-storage
ReviewMetaStorage protocols/storage/review.py peerpedia-storage
ReviewContentStorage protocols/storage/review.py peerpedia-storage
UserStorage protocols/storage/user.py peerpedia-storage
Lifecycle protocols/lifecycle.py peerpedia-app
AuthProvider protocols/auth.py peerpedia-transport
Authorizer protocols/authorizer.py peerpedia-app
ScoringEngine protocols/scoring.py peerpedia-compute
Compiler protocols/compiler.py peerpedia-app
ArticleSync protocols/sync.py peerpedia-transport
ReviewSync protocols/sync.py peerpedia-transport

Exceptions

All business-logic errors inherit from PeerpediaError:

PeerpediaError            code="ERROR"
  ├── NotFoundError       code="NOT_FOUND"
  ├── NotAuthorizedError  code="NOT_AUTHORIZED"
  ├── ConflictError       code="CONFLICT"
  │   └── MergeConflictError  code="MERGE_CONFLICT"
  └── BadRequestError     code="BAD_REQUEST"

Each carries structured context (permission, resource_type, conflicting_entity, etc.) for typed error handling.

Requirements

  • Python ≥ 3.11
  • Zero dependencies

License

AGPL-3.0 — see LICENSE.

Metadata

Release files for peerpedia-core 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peerpedia-core 0.2.1
File Size Uploaded Provenance
peerpedia_core-0.2.1.tar.gz 31.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for peerpedia-core 0.2.1
File Interpreter ABI Platform
peerpedia_core-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 64.0 kB

Release files / peerpedia_core-0.2.1.tar.gz

Download URL peerpedia_core-0.2.1.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
93d26518db7f8be3c23577d428574ba5dd8e778e49d1bdff6f79189405e949ca
BLAKE2b-256 checksum
How to use checksums
776e1f52d66ef7c812855fe5d504968cf7f28c76be3fb487c7429e67364fadcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / peerpedia_core-0.2.1-py3-none-any.whl

Download URL peerpedia_core-0.2.1-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fccb68c4a9155602ef5dd2ad7f4ac7a348f56877925bf8af725297134611fd4
BLAKE2b-256 checksum
How to use checksums
d8d21e2cc0bc8fd87990c25be1a31cfb5c46d536c52cf159797a91e9ca7dd676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for peerpedia-core 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

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