Skip to main content

Civic Exchange Protocol for Python projects

Project description

Civic Exchange Protocol (CEP)

PyPI Python versions License: Apache 2.0 CI Status Docs Security Policy

Interoperable data standards for describing entities, relationships, and value exchanges across civic systems.

Overview

The Civic Exchange Protocol defines a coherent, verifiable way to describe:

  • Entities (organizations, agencies, districts, people)
  • Relationships (grant awards, contracts, reporting relationships)
  • Exchanges of value (payments, disbursements, transfers)

CEP records are:

  • JSON Schema–validated
  • Fully typed
  • Deterministic and versioned
  • Extensible across jurisdictions and data ecosystems
  • Designed for cross-system interoperability

Documentation: https://civic-interconnect.github.io/civic-exchange-protocol/

Repository Structure

/
├── schema/                     # Official CEP JSON Schemas
│   ├── cep.entity.schema.json
│   ├── cep.relationship.schema.json
│   ├── cep.exchange.schema.json
│   └── cep.entity.identifier-scheme.schema.json
│
├── vocabulary/                 # Versioned controlled vocabularies
│   ├── entity-type.v1.0.0.json
│   ├── exchange-type.v1.0.0.json
│   ├── exchange-role.v1.0.0.json
│   ├── party-role.v1.0.0.json
│   ├── value-type.v1.0.0.json
│   └── resolution-method.v1.0.0.json
│
├── src/python/                 # Python reference implementation
│   ├── src/civic_exchange_protocol/
│   └── tests/
│
├── src/rust/                   # Rust reference implementation
│   ├── cep-core/
│   ├── cep-entity/
│   ├── cep-exchange/
│   └── cep-relationship/
│
├── docs/                       # MkDocs documentation site
└── .github/workflows/          # CI, Docs deploy, PyPI release

Python Reference Implementation

Install from PyPI:

pip install civic-exchange-protocol

CLI entrypoint:

cx --help

Includes:

  • Pydantic models for Entity / Relationship / Exchange
  • Deterministic record hashing
  • Attestation helpers
  • Built-in JSON Schema validator
  • Test vectors for conformance

Rust Reference Implementation

The repository includes a Rust workspace with:

  • cep-core
  • cep-entity
  • cep-exchange
  • cep-relationship

To build:

cd src/rust
cargo build

Each crate inherits version, license, and repository metadata from the workspace root.

Schemas

Official schemas live under /schema and are published with stable URLs such as:

https://raw.githubusercontent.com/civic-interconnect/civic-exchange-protocol/main/schema/cep.entity.schema.json

Documentation includes a browser-embedded validator using Ajv.

Security Policy

We support responsible disclosure through GitHub’s Private Vulnerability Report feature.

See: SECURITY.md

Contributing

Project details


Download files

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

Source Distribution

civic_exchange_protocol-0.0.3.tar.gz (204.5 kB view details)

Uploaded Source

Built Distribution

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

civic_exchange_protocol-0.0.3-py3-none-any.whl (48.0 kB view details)

Uploaded Python 3

File details

Details for the file civic_exchange_protocol-0.0.3.tar.gz.

File metadata

  • Download URL: civic_exchange_protocol-0.0.3.tar.gz
  • Upload date:
  • Size: 204.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for civic_exchange_protocol-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ff0bcc44748791f30cabeab4f96e390ce55fb09ad2b18687730d555e3c0b55a3
MD5 55f8dcfc79d8876ee3d68f5bf6000a46
BLAKE2b-256 32c8a9ab675a206525fdf258ae959cff6d78289b945471a76e51cef0cb97691f

See more details on using hashes here.

Provenance

The following attestation bundles were made for civic_exchange_protocol-0.0.3.tar.gz:

Publisher: release-python.yml on civic-interconnect/civic-exchange-protocol

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

File details

Details for the file civic_exchange_protocol-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for civic_exchange_protocol-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d60b17139953364b63e4e589d485ff141a4ab2e50242465f58014ed6d2d70d4
MD5 68eec3aae5a9647940cb0444fbc4468a
BLAKE2b-256 26966646a3852778719f57f50967a6eb63fecfa11c36a0789ffb70fd03e09103

See more details on using hashes here.

Provenance

The following attestation bundles were made for civic_exchange_protocol-0.0.3-py3-none-any.whl:

Publisher: release-python.yml on civic-interconnect/civic-exchange-protocol

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page