Metadata-Version: 2.4
Name: civic-exchange-protocol
Version: 0.0.3
Summary: Civic Exchange Protocol for Python projects
Author-email: Civic Interconnect <info@civic-interconnect.org>
License-Expression: Apache-2.0
Project-URL: Documentation, https://civic-interconnect.github.io/civic-exchange-protocol/
Project-URL: Homepage, https://github.com/civic-interconnect/civic-exchange-protocol
Project-URL: Issues, https://github.com/civic-interconnect/civic-exchange-protocol/issues
Project-URL: Source, https://github.com/civic-interconnect/civic-exchange-protocol
Keywords: civic,interconnect,protocol,government,provenance
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: fastapi
Requires-Dist: pydantic
Requires-Dist: typer
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: defusedxml; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-env; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: validate-pyproject; extra == "dev"
Provides-Extra: docs
Requires-Dist: mike; extra == "docs"
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-gen-files; extra == "docs"
Requires-Dist: mkdocs-git-revision-date-localized-plugin; extra == "docs"
Requires-Dist: mkdocs-include-markdown-plugin; extra == "docs"
Requires-Dist: mkdocs-literate-nav; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocs-static-i18n; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.18; extra == "docs"
Requires-Dist: ruff; extra == "docs"
Dynamic: license-file

# Civic Exchange Protocol (CEP)

[![PyPI](https://img.shields.io/pypi/v/civic-exchange-protocol.svg)](https://pypi.org/project/civic-exchange-protocol/)
[![Python versions](https://img.shields.io/pypi/pyversions/civic-exchange-protocol.svg)](https://pypi.org/project/civic-exchange-protocol/)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![CI Status](https://github.com/civic-interconnect/civic-exchange-protocol/actions/workflows/ci-python.yml/badge.svg)](https://github.com/civic-interconnect/civic-exchange-protocol/actions/workflows/ci-python.yml)
[![Docs](https://img.shields.io/badge/docs-mkdocs--material-blue)](https://civic-interconnect.github.io/civic-exchange-protocol/)
[![Security Policy](https://img.shields.io/badge/security-policy-orange)](SECURITY.md)

> 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

```text
/
├── 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:

```bash
pip install civic-exchange-protocol
```

CLI entrypoint:

```bash
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:

```bash
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:

```text
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](SECURITY.md)

## Contributing

- See [CONTRIBUTING.md](./CONTRIBUTING.md)
- See [DEVELOPER.md](./DEVELOPER.md)
