API Reference
Core Functions
- tempdataset.create_dataset(dataset_type: str, rows: int = 500)[source]
Generate temporary datasets or save to files.
- Parameters:
dataset_type – Dataset type or filename Available types: ‘crm’, ‘customers’, ‘ecommerce’, ‘employees’, ‘inventory’, ‘marketing’, ‘retail’, ‘reviews’, ‘sales’, ‘suppliers’, ‘stocks’, ‘banking’, ‘cryptocurrency’, ‘insurance’, ‘loans’, ‘investments’, ‘accounting’, ‘payments’, ‘weather’, ‘energy’, ‘traffic’, ‘environmental’, ‘industrial’, ‘smarthome’, ‘patients’, ‘appointments’, ‘lab_results’, ‘prescriptions’, ‘medical_history’, ‘clinical_trials’, ‘social_media’, ‘user_profiles’, ‘web_analytics’, ‘app_usage’, ‘system_logs’, ‘api_calls’, ‘server_metrics’, ‘user_sessions’, ‘error_logs’, ‘performance’ Or filename with extension: ‘data.csv’, ‘data.json’
rows – Number of rows to generate (default: 500)
- Returns:
TempDataFrame containing the generated data (also saves to file if filename provided)
- Raises:
ValidationError – If parameters are invalid
DatasetNotFoundError – If dataset type is not available
DataGenerationError – If data generation fails
TempDatasetMemoryError – If memory limits are exceeded
CSVWriteError – If CSV file writing fails
JSONWriteError – If JSON file writing fails
- tempdataset.read_csv(filename: str) TempDataFrame[source]
Read CSV file into TempDataFrame.
- Parameters:
filename – Path to CSV file
- Returns:
TempDataFrame containing the CSV data
- Raises:
ValidationError – If parameters are invalid
CSVReadError – If the CSV file is malformed or cannot be read
- tempdataset.read_json(filename: str) TempDataFrame[source]
Read JSON file into TempDataFrame.
- Parameters:
filename – Path to JSON file
- Returns:
TempDataFrame containing the JSON data
- Raises:
ValidationError – If parameters are invalid
JSONReadError – If the JSON file is malformed or cannot be read
TempDataFrame Class
- class tempdataset.TempDataFrame(data: List[Dict[str, Any]], columns: List[str])[source]
Bases:
objectLightweight DataFrame-like class for data manipulation and exploration.
Provides essential methods for working with tabular data without pandas dependency.
- property columns: List[str]
Return column names.
- Returns:
List of column names
- describe() DisplayFormatter[source]
Generate descriptive statistics for numeric columns.
- Returns:
DisplayFormatter object with statistical summary
- filter(condition_func) TempDataFrame[source]
Filter rows based on a condition function.
- Parameters:
condition_func – Function that takes a row dict and returns True/False
- Returns:
New TempDataFrame with filtered rows
- Raises:
ValidationError – If condition_func is not callable
- head(n: int = 5) DisplayFormatter[source]
Display first n rows in a readable format.
- Parameters:
n – Number of rows to display (default: 5)
- Returns:
DisplayFormatter object with formatted representation of the first n rows
- Raises:
ValidationError – If n is not a positive integer
- info() DisplayFormatter[source]
Display dataset information including column types and memory usage.
- Returns:
DisplayFormatter object with dataset information
- select(columns: List[str]) TempDataFrame[source]
Select specific columns from the DataFrame.
- Parameters:
columns – List of column names to select
- Returns:
New TempDataFrame with selected columns only
- Raises:
ValidationError – If columns parameter is invalid or contains non-existent columns
- shape
Custom descriptor that allows shape to work both as property and method.
- tail(n: int = 5) DisplayFormatter[source]
Display last n rows in a readable format.
- Parameters:
n – Number of rows to display (default: 5)
- Returns:
DisplayFormatter object with formatted representation of the last n rows
- Raises:
ValidationError – If n is not a positive integer
- to_csv(filename: str) None[source]
Export to CSV file.
- Parameters:
filename – Path to output CSV file
- Raises:
ValidationError – If filename is invalid
CSVWriteError – If CSV writing fails
Core Business Dataset Classes
- class tempdataset.CrmDataset(rows: int = 500)[source]
Bases:
BaseDatasetCRM dataset generator that creates realistic customer relationship management data.
Generates 30+ columns of CRM data including: - Customer information (customer_id, name, email, company, demographics) - Account management (account_manager, creation_date, status) - Interactions (channel, notes, contact dates) - Sales pipeline (stage, deal value, probability) - Support data (tickets, satisfaction ratings) - Geographic and preference data
- class tempdataset.CustomersDataset(rows: int = 500)[source]
Bases:
BaseDatasetCustomers dataset generator that creates realistic customer profile data.
Generates comprehensive customer data including: - Personal information (names, contact details, demographics) - Geographic data (addresses, regions) - Financial data (income, spending patterns) - Account information (registration, status, preferences) - Loyalty and engagement metrics
- class tempdataset.EcommerceDataset(rows: int = 500)[source]
Bases:
BaseDatasetE-commerce dataset generator that creates realistic transaction data.
Generates comprehensive e-commerce data including: - Transaction and customer information - Product details with categories and brands - Pricing with discounts and profit calculations - Shipping and delivery information - Geographic and demographic data - Reviews and returns data
- class tempdataset.EmployeesDataset(rows: int = 500)[source]
Bases:
BaseDatasetEmployees dataset generator that creates realistic employee HR data.
Generates comprehensive employee data including: - Personal information (names, demographics, contact details) - Employment details (hire dates, departments, job titles) - Compensation (salary, bonus, total compensation) - Performance metrics (scores, reviews, training) - Work arrangements (location, status, projects) - Management hierarchy (manager relationships)
- class tempdataset.InventoryDataset(rows: int = 500)[source]
Bases:
BaseDatasetInventory dataset generator that creates realistic warehouse and stock data.
Generates 25+ columns of inventory data including: - Product information (SKU, name, category, supplier) - Stock levels (on hand, reserved, reorder thresholds) - Pricing and valuation (unit price, total value) - Warehouse location (warehouse, aisle, shelf, bin) - Restock scheduling and lead times - Special handling requirements
- class tempdataset.MarketingDataset(rows: int = 500)[source]
Bases:
BaseDatasetMarketing dataset generator that creates realistic marketing campaign data.
Generates 36 columns of marketing data including: - Campaign information (campaign_id, name, dates, status) - Channel and platform details (channel, platform, creative information) - Audience information (target_audience, audience_size, demographics) - Financial data (budget, spend, revenue, costs) - Performance metrics (impressions, clicks, conversions, rates) - Geographic data (region, country) - Engagement metrics (likes, comments, shares) - Management information (agency, manager)
- class tempdataset.RetailDataset(rows: int = 500)[source]
Bases:
BaseDatasetRetail store operations & POS transactions dataset generator.
Generates comprehensive retail data including: - Transaction information (transaction_id, receipt_number, datetime) - Store details (store_id, name, type, location) - POS and cashier information - Product details (product_id, name, category, brand) - Pricing and discount calculations - Payment and loyalty information - Inventory tracking (before/after sale) - Financial metrics (gross margin)
- class tempdataset.ReviewsDataset(rows: int = 500)[source]
Bases:
BaseDatasetReviews dataset generator that creates realistic product and service review data.
Generates 15+ columns of review data including: - Review identification (review_id, product_id, customer info) - Rating and feedback (rating, title, text, sentiment) - Verification and engagement (verified purchase, helpful votes) - Seller interaction (response from seller, response date) - Geographic and temporal data
- class tempdataset.SalesDataset(rows: int = 500)[source]
Bases:
BaseDatasetSales dataset generator that creates realistic sales transaction data.
Generates 27 columns of sales data including: - Order information (order_id, dates, priority) - Customer details (customer_id, name, email, demographics) - Product information (product_id, name, category, brand) - Financial data (prices, discounts, profit) - Geographic data (region, country, state, city) - Shipping and payment information
- class tempdataset.SuppliersDataset(rows: int = 500)[source]
Bases:
BaseDatasetSuppliers dataset generator that creates realistic supplier data.
Generates 30 columns of supplier data including: - Supplier identification (supplier_id, name) - Contact information (name, title, email, phone, fax, website) - Address details (address, city, state, country, postal code) - Business classification (type, industry, product categories) - Performance metrics (rating, on-time delivery, lead time) - Contract information (dates, value, payment terms) - Order history and statistics
Financial Dataset Classes
- class tempdataset.StocksDataset(rows: int = 500)[source]
Bases:
BaseDatasetStocks dataset generator that creates realistic stock market data.
Generates 20 columns of stock data including: - Basic stock info (ticker, company, sector, industry) - OHLCV data (open, high, low, close, volume) - Financial metrics (market cap, PE ratio, dividend yield) - Market performance indicators
- class tempdataset.BankingDataset(rows: int = 500)[source]
Bases:
BaseDatasetBanking dataset generator that creates realistic banking transaction data.
Generates 20 columns of banking data including: - Transaction details (ID, type, amount, currency) - Account information (account ID, type, balances) - Merchant and location data - Fraud detection indicators
- class tempdataset.CryptocurrencyDataset(rows: int = 500)[source]
Bases:
BaseDatasetCryptocurrency dataset generator that creates realistic crypto trading data.
Generates 20 columns of cryptocurrency data including: - Basic crypto info (symbol, name, blockchain) - OHLCV data with extreme volatility - Market metrics (market cap, supply, volume) - Blockchain statistics (hash rate, difficulty, fees)
- class tempdataset.InsuranceDataset(rows: int = 500)[source]
Bases:
BaseDatasetInsurance dataset generator that creates realistic insurance data.
Generates 20 columns of insurance data including: - Policy information (ID, type, coverage, premiums) - Claims data (claim ID, amounts, status) - Risk assessment and agent information - Geographic and temporal data
- class tempdataset.LoansDataset(rows: int = 500)[source]
Bases:
BaseDatasetLoans dataset generator that creates realistic loan data.
Generates 20 columns of loan data including: - Loan application and approval information - Loan terms and payment details - Risk assessment and collateral information - Payment status and branch data
- class tempdataset.InvestmentsDataset(rows: int = 500)[source]
Bases:
BaseDatasetInvestment portfolio dataset generator.
- class tempdataset.AccountingDataset(rows: int = 500)[source]
Bases:
BaseDatasetAccounting dataset generator for general ledger entries.
IoT Sensors Dataset Classes
- class tempdataset.WeatherDataset(rows: int = 500)[source]
Bases:
BaseDatasetWeather dataset generator that creates realistic weather sensor data.
Generates weather sensor readings including: - Record identification (record_id, timestamp, location_id) - Geographic data (city, country, coordinates) - Temperature and humidity metrics - Atmospheric pressure and wind data - Precipitation and weather conditions - Air quality and visibility metrics
- class tempdataset.EnergyDataset(rows: int = 500)[source]
Bases:
BaseDatasetEnergy dataset generator that creates realistic energy meter data.
Generates energy consumption and production data including: - Reading identification (reading_id, timestamp, meter_id) - Location and energy source information - Consumption and production metrics - Cost calculations and tariff plans - Peak demand and outage tracking - CO2 emissions calculations
- class tempdataset.TrafficDataset(rows: int = 500)[source]
Bases:
BaseDatasetTraffic dataset generator that creates realistic traffic sensor data.
Generates traffic monitoring data including: - Record identification (record_id, timestamp, sensor_id) - Road and location information - Vehicle counts and speed measurements - Traffic density and congestion levels - Incident tracking and weather impact - Public transport delays
- class tempdataset.EnvironmentalDataset(rows: int = 500)[source]
Bases:
BaseDatasetEnvironmental dataset generator that creates realistic environmental sensor data.
Generates environmental monitoring data including: - Record identification (record_id, timestamp, location_id) - Geographic information (city, country) - Air quality measurements (PM2.5, PM10, gases) - Noise level monitoring - Air Quality Index calculations - Weather correlation data
- class tempdataset.IndustrialDataset(rows: int = 500)[source]
Bases:
BaseDatasetIndustrial dataset generator that creates realistic industrial sensor data.
Generates industrial monitoring data including: - Sensor identification (sensor_reading_id, timestamp, machine_id, factory_id) - Location and operational status - Machine performance metrics (temperature, vibration, pressure, RPM) - Power consumption and oil levels - Fault detection and maintenance scheduling - Predictive failure analysis
- class tempdataset.SmartHomeDataset(rows: int = 500)[source]
Bases:
BaseDatasetSmart Home dataset generator that creates realistic smart home IoT data.
Generates smart home device data including: - Event identification (event_id, timestamp, home_id) - Device information (room, device_type, device_id) - Device status and environmental readings - Motion detection and security monitoring - Home automation triggers and alerts
Healthcare Dataset Classes
- class tempdataset.PatientsDataset(rows: int = 500)[source]
Bases:
BaseDatasetPatients dataset generator for healthcare records.
- class tempdataset.AppointmentsDataset(rows: int = 500)[source]
Bases:
BaseDatasetAppointments dataset generator for medical scheduling.
- class tempdataset.LabResultsDataset(rows: int = 500)[source]
Bases:
BaseDatasetLab results dataset generator for medical testing.
- class tempdataset.PrescriptionsDataset(rows: int = 500)[source]
Bases:
BaseDatasetPrescriptions dataset generator for medication records.
- class tempdataset.MedicalHistoryDataset(rows: int = 500)[source]
Bases:
BaseDatasetMedical history dataset generator for patient conditions.
Technology Dataset Classes
- class tempdataset.WebAnalyticsDataset(rows: int = 500)[source]
Bases:
BaseDatasetWeb analytics dataset generator for website traffic data.
- class tempdataset.AppUsageDataset(rows: int = 500)[source]
Bases:
BaseDatasetApp usage dataset generator for application analytics.
- class tempdataset.SystemLogsDataset(rows: int = 500)[source]
Bases:
BaseDatasetSystem logs dataset generator for server and application logs.
- class tempdataset.ApiCallsDataset(rows: int = 500)[source]
Bases:
BaseDatasetAPI calls dataset generator for API usage analytics and monitoring.
- class tempdataset.ServerMetricsDataset(rows: int = 500)[source]
Bases:
BaseDatasetServer metrics dataset generator for system monitoring and performance analysis.
- class tempdataset.UserSessionsDataset(rows: int = 500)[source]
Bases:
BaseDatasetUser sessions dataset generator for user behavior analytics and session tracking.
- class tempdataset.ErrorLogsDataset(rows: int = 500)[source]
Bases:
BaseDatasetError logs dataset generator for application error tracking and debugging.
Social Media Dataset Classes
Bases:
BaseDatasetSocial Media dataset generator that creates realistic social media post data.
Generates social media posts with: - Post information (post_id, dates, type, content) - User details (user_id, platform) - Engagement metrics (likes, comments, shares, views) - Content analysis (hashtags, mentions, sentiment) - Geographic data (location)
Generate social media dataset rows.
List of dictionaries representing social media post rows
Return column schema with types.
Dictionary mapping column names to their data types
Bases:
BaseDatasetUser Profiles dataset generator that creates realistic social media user profiles.
Generates user profiles with: - User information (user_id, username, personal details) - Account details (join_date, platform, status) - Social metrics (followers, following, posts) - Profile content (bio, interests, connections) - Geographic data (location)
Generate user profiles dataset rows.
List of dictionaries representing user profile rows
Return column schema with types.
Dictionary mapping column names to their data types