Skip to main content

A library for generating random text, numbers, and structured data.

Project description

This library provides utilities to generate mock data for testing purposes, including numbers, text, identifiers, and structured data.

Modules Overview

Installation

!pip install randomcontentgen

  1. Number Generator

    • Generate random integers, floats, or numbers with custom ranges.
    • Example:
      from randomcontent import generate_number
      generate_number(type="int", min=1, max=100)  # Generates an random integer between 1 and 100
      generate_number(type="probability") # Generates an random probability between 0 and 1
      generate_number(type="gaussian",mean=0, std_dev=1) # Generates an random number from Gaussian distribution
      
  2. Identifier Generator

    • Generate unique identifiers like UUIDs, credit card numbers, or custom IDs.
    • Example:
      from randomcontent import generate_identifier
      generate_identifier(type="uuid")  # Generates and random UUID-like string
      generate_identifier(type="email") # Generates an email address
      
  3. Text Generator

    • Create random names, email addresses, or custom text strings.
    • Examples:
      from randomcontent import generate_text
      generate_text(type="sentence", length=12)  # Generates a sentence
      generate_text(type="poem", num_lines=4)   # Generates a poem
      
  4. Structured Data Generator

    • Generate structured mock data based on a schema definition.
    • Example:
      from randomcontent import generate_structured_data, format_data
      schema = {"name": "random_name", "email": "random_email","age": "random_int(min=18, max=60)"}
      generate_structured_data(schema, count=5)  # List of 5 data rows
      

Formatting Data

Structured data can be saved in JSON, CSV, or Parquet formats:

  • Example:
    from randomcontent import format_data
    format_data(data, format_type="json", file_name="data")  # Save as data.json
    format_data(data, format_type="csv", file_name="data")   # Save as data.csv
    format_data(data, format_type="parquet", file_name="data")  # Save as data.parquet
    

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

randomcontent-1.0.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

randomcontent-1.0.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file randomcontent-1.0.1.tar.gz.

File metadata

  • Download URL: randomcontent-1.0.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for randomcontent-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3886e7a4402a648f4eb6e084f2c734ea943a8990b905828d61550f6e3befbada
MD5 a44bc44ad972c40c865c397fc2cf875b
BLAKE2b-256 5905ab5d5ff371896ca83496858c55ca5c4d0c273ceb7abc0c1846069a85e193

See more details on using hashes here.

File details

Details for the file randomcontent-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: randomcontent-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for randomcontent-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4406b606679c2ef6a352a824d8a26d2ac65d5a0c85e7b343988e6537b2092e0c
MD5 2c1e1c442d197c42ee2b23518b953780
BLAKE2b-256 886b9cccb7cc3742b09f06595242a49a5ab8229fe743c70131e3b37708fb2879

See more details on using hashes here.

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