Skip to main content

Synthwave: A Stream of Synthetic Events

The goal here is to provide a stream of synthetic data similar to events you would see in a normal business. This can be used to generate data for testing, development, and for learning.

The user defines the events they want emitted and this will write them to stdout, a file, or POST as JSON data to a URL (not tested yet).

Name and email data generated by GPT-3.

Installation

You should use an environment manager like Poetry or venv.

With Poetry:

poetry add synthwave

Otherwise:

pip install synthwave

Usage

Define the events you want generated in a Python file. See example.py for an example:

class AccountCreated(Event):
    user_id = field.UUID()
    properties = field.Object(
        first_name=field.GivenName(),
        last_name=field.FamilyName(),
        age=field.Integer(13, 95),
        email_address=field.EmailAddress(),
        location=field.Location() | field.Null(0.5),
    )


class PageView(Event):
    user_id = field.UUID(repeat_prob=0.1)
    properties = field.Object(
        page_url=field.URL()
        referring_url=field.URL("google.com")
    )

Then start the generation, in your terminal:

python -m synthwave -e example.py --interval 0.1

Here, -e points to the file with your event definitions and --interval sets the time between synthetic events. You can also write the events to a file with the -o flag:

python -m synthwave -e example.py --interval 0.1 -o outfile.txt

The above definition will emit events that look like:

{
    'event': 'account_created',
    'event_id': '24a4f6ae-06dc-4df9-b67d-faac490ce890',
    'timestamp': '2023-05-25T15:22:55.419+00:00',
    'user_id': 'b18a2f0e-7257-41c0-8f1c-9c63c275b342',
    'properties': {
        'first_name': 'Parron',
        'last_name': 'Akori',
        'age': 95,
        'email_address': 'cleon@anache.net',
        'location': None
}

{
    'event': 'page_view', 
    'event_id': '8ad8e917-b9ff-4bca-83d1-d1a98cf97db3',
    'timestamp': '2023-05-24T04:34:11.871+00:00',
    'user_id': '7663a2a9-154b-4cc9-8a1b-44fcc806046f', 
    'properties': {
        'page_url': 'https://wow.app/perpetual/arbitrary/egregious',
        'referring_url': 'https://google.com/sequentially/achingly/egregious'
    }
}

Metadata

Release files for synthwave 0.1.7

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

Source distribution (sdist)

Source distribution for synthwave 0.1.7
File Size Uploaded Provenance Actions
synthwave-0.1.7.tar.gz 26.6 kB Without provenance Details for synthwave-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for synthwave 0.1.7
File Interpreter ABI Platform Actions
synthwave-0.1.7-py3-none-any.whl Python 3 none any Details for synthwave-0.1.7-py3-none-any.whl

Total release size: 53.7 kB

Release files / synthwave-0.1.7.tar.gz

Download URL synthwave-0.1.7.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
82cd26c4d967873546c701e69b13a3491607095bd9de6805b63f70ca48270ba5
BLAKE2b-256 checksum
How to use checksums
dcc3c573814126e7eb74dfd8a53a5da959c1d58f537b8aeafcf7417503bfee78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.3 Darwin/22.5.0

Release files / synthwave-0.1.7-py3-none-any.whl

Download URL synthwave-0.1.7-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed4fdee599919e2401bf9923ca56a8d50eae3187f91f9bcbcdc12299700e5359
BLAKE2b-256 checksum
How to use checksums
5302ce66a41f617477066ef2ebd6fda6966aeebb44c71ccdf7e125148b3bca34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.3 Darwin/22.5.0

Security for synthwave 0.1.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.

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.

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