Skip to main content

Civic Transparency SDK - Development kit for transparency applications

Project description

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

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_transparency_sdk-0.1.2.tar.gz (102.9 kB view details)

Uploaded Source

Built Distribution

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

civic_transparency_sdk-0.1.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file civic_transparency_sdk-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for civic_transparency_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4f8e75b0667974d4b7c88779bc4e9e918505d8354d15988c6d77b83e9d21a411
MD5 c09435f5f0d82887c4e3ac2b570697c3
BLAKE2b-256 aba184a33c8a385c35781af665e908f2806a857092d1642092f7da8da4da92d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for civic_transparency_sdk-0.1.2.tar.gz:

Publisher: release.yml on civic-interconnect/civic-transparency-py-sdk

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_transparency_sdk-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for civic_transparency_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e9b7d846126e0e06d70d291cf5e85333de205659ca15aecabd9dc5051f75676b
MD5 e6f2f1f1283b7390410806fdd1c38e41
BLAKE2b-256 0c01566edae1cd51ba01e55f6b23b1602ad7730eed06fe081f2d114be8714674

See more details on using hashes here.

Provenance

The following attestation bundles were made for civic_transparency_sdk-0.1.2-py3-none-any.whl:

Publisher: release.yml on civic-interconnect/civic-transparency-py-sdk

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