Skip to main content

Civic Transparency Software Development Kit (SDK)

Docs PyPI Python versions CI Status License: MIT

Synthetic data generation toolkit for civic transparency research and testing.

Installation

pip install civic-transparency-sdk

What This Package Provides

  • Synthetic Data Generation: Create realistic transparency data for testing and research without requiring real user data. Generate controlled datasets with reproducible seeds for studying information dynamics.
  • Internal Data Structures: Simulation-specific types (WindowAgg, ContentHash, TopHash) for generating and manipulating synthetic transparency data.
  • Database Integration: Convert generated data to DuckDB/SQL databases for analysis with ready-to-use schemas and indexing patterns.
  • CLI Tools: Command-line utilities for generating worlds, converting formats, and managing synthetic datasets.

Note: This SDK generates synthetic data for research/testing. For implementing the PTag API specification, see civic-transparency-ptag-types, which provides the official API response types.

Quick Start

Generate synthetic data:

# Activate environment
source .venv/bin/activate  # Linux/Mac
# or
.venv\Scripts\activate     # Windows

# Generate baseline world
ct-sdk generate --world A --topic-id aa55ee77 --out world_A.jsonl

# Convert to database
ct-sdk convert --jsonl world_A.jsonl --duck world_A.duckdb --schema schema/schema.sql

The generated DuckDB files are ready for analysis with any SQL-compatible tools or custom analysis scripts.

Use Cases

  • Academic Research: Generate controlled datasets with known parameters for studying information dynamics, coordination patterns, and transparency system behaviors.
  • Algorithm Development: Build and test transparency tools using synthetic data that mimics real-world patterns without privacy concerns.
  • Testing & Validation: Create reproducible test datasets for developing transparency systems without requiring real user data.
  • Education: Provide realistic datasets for teaching transparency concepts, data analysis, and system design.

Reproducibility

All generation is deterministic:

  • Seed-based randomization: Same seed produces identical datasets
  • Version tracking: Metadata includes package versions
  • Parameter logging: All generation settings preserved in output
  • Schema versioning: Database structures fully documented

Example seeds:

  • World A (baseline): 4242
  • World B (influenced): 8484

Package Structure

ci.transparency.sdk/
├── cli/            # Command-line interface (ct-sdk)
├── digests.py      # Content fingerprinting (SimHash64, MinHashSig)
├── hash_core.py    # Content identification (HashId, ContentHash, TopHash)
├── ids.py          # ID management (WorldId, TopicId)
├── io_schema.py    # JSON serialization utilities
└── window_agg.py   # Window aggregation structure (WindowAgg)

Related Projects

  • Civic Transparency PTag Spec - Official API specification
  • Civic Transparency PTag Types - Python types for PTag API responses (use this for API implementation)
  • Civic Transparency Verify - Statistical verification tools (private)

Security Model

This package provides synthetic data generation for research and testing. It does not include:

  • Detection algorithms or thresholds
  • Verification workflows or assessment criteria
  • Operational patterns or alerting rules

These are maintained separately to prevent adversarial reverse-engineering while enabling legitimate transparency research.


Documentation

Full documentation at: civic-interconnect.github.io/civic-transparency-py-sdk/

  • Usage Guide - Getting started and common workflows
  • CLI Reference - Command-line interface details
  • SDK Reference - Core Python APIs
  • Schema Reference - Database schemas and integration

Development

See CONTRIBUTING.md for development setup and guidelines.

Versioning

This specification follows semantic versioning. See CHANGELOG.md for version history.

License

MIT © Civic Interconnect

Metadata

Release files for civic-transparency-sdk 0.1.2

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

Source distribution (sdist)

Source distribution for civic-transparency-sdk 0.1.2
File Size Uploaded Provenance
civic_transparency_sdk-0.1.2.tar.gz 102.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for civic-transparency-sdk 0.1.2
File Interpreter ABI Platform
civic_transparency_sdk-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 118.0 kB

Release files / civic_transparency_sdk-0.1.2.tar.gz

Download URL civic_transparency_sdk-0.1.2.tar.gz
Size 102.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4f8e75b0667974d4b7c88779bc4e9e918505d8354d15988c6d77b83e9d21a411
BLAKE2b-256 checksum
How to use checksums
aba184a33c8a385c35781af665e908f2806a857092d1642092f7da8da4da92d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2025.

Transparency log

Release files / civic_transparency_sdk-0.1.2-py3-none-any.whl

Download URL civic_transparency_sdk-0.1.2-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9b7d846126e0e06d70d291cf5e85333de205659ca15aecabd9dc5051f75676b
BLAKE2b-256 checksum
How to use checksums
0c01566edae1cd51ba01e55f6b23b1602ad7730eed06fe081f2d114be8714674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2025.

Transparency log

Security for civic-transparency-sdk 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for civic_transparency_sdk-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2025.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full 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