Skip to main content

Vepi - Vena ETL Python Interface

A Python package for interacting with Vena's ETL API, providing a simple interface for data import, export, and job management operations.

note this is not an official Vena package this is a hobby project.

Installation

pip install vepi

Configuration

Create a configuration file (e.g., config.py) with your Vena API credentials:

HUB = 'eu1'  # e.g., us1, us2, ca3
API_USER = 'your_api_user'
API_KEY = 'your_api_key'
TEMPLATE_ID = 'your_template_id'
MODEL_ID = 'your_model_id'  # Optional, needed for exports
JOB_TEMPLATE_ID = 'your_job_template_id'  # Template ID for job operations

Usage

Basic Setup

from vepi import VenaETL

# Initialize the client
vena_etl = VenaETL(
    hub=HUB,
    api_user=API_USER,
    api_key=API_KEY,
    template_id=TEMPLATE_ID,
    model_id=MODEL_ID
)

Job Management

Running a Job

The simplest way to run a job is using the run_job method:

# Run a job and wait for completion
result = vena_etl.run_job(
    poll_interval=5,  # How often to check job status (seconds)
    timeout=3600     # Maximum time to wait (seconds)
)

# Check the result
print(f"Job status: {result.get('status')}")
print(f"Job ID: {result.get('id')}")
print(f"Model: {result.get('modelName')}")

Step-by-Step Job Management

For more control, you can manage jobs step by step:

# Create a new job
job_id = vena_etl.create_job()
print(f"Created job with ID: {job_id}")

# Get job status
status = vena_etl.get_job_status(job_id)
print(f"Current status: {status.get('status')}")

# Submit the job
submit_result = vena_etl.submit_job(job_id)
print(f"Submission result: {submit_result}")

# Wait for completion
final_status = vena_etl.wait_for_job_completion(job_id)
print(f"Final status: {final_status.get('status')}")

Canceling a Job

# Cancel a running job
cancel_result = vena_etl.cancel_job(job_id)
print(f"Cancel result: {cancel_result.get('status')}")

Importing Data

Using DataFrame (start_with_data)

import pandas as pd

# Create a DataFrame with your data
data = {
    'Value': ['1000', '2000'],
    'Account': ['3910', '3910'],
    'Entity': ['V001', 'V001'],
    'Department': ['D10', 'D10'],
    'Year': ['2020', '2020'],
    'Period': ['1', '2'],
    'Scenario': ['Actual', 'Actual'],
    'Currency': ['Local', 'Local'],
    'Measure': ['Value', 'Value']
}
df = pd.DataFrame(data)

# Import the data
vena_etl.start_with_data(df)

Using File (start_with_file)

You can upload data in three ways:

  1. From a CSV file:
# Upload from a CSV file
vena_etl.start_with_file("path/to/your/data.csv")
  1. From a DataFrame:
# Upload from a DataFrame
df = pd.DataFrame(data)
vena_etl.start_with_file(df)
  1. From a file-like object:
# Upload from a file-like object
with open("data.csv", "r") as f:
    vena_etl.start_with_file(f)

Exporting Data

# Export data with custom page size
exported_data = vena_etl.export_data(page_size=10000)
print(f"Exported {len(exported_data)} records")

Getting Dimension Hierarchy

# Get dimension hierarchy
hierarchy = vena_etl.get_dimension_hierarchy()
print("Dimension hierarchy:")
print(hierarchy)

Error Handling

The package includes comprehensive error handling for:

  • Invalid credentials
  • Missing required fields
  • API communication errors
  • Data validation errors
  • Job submission errors
  • Job cancellation errors

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for vepi 0.1.3

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

Source distribution (sdist)

Source distribution for vepi 0.1.3
File Size Uploaded Provenance Actions
vepi-0.1.3.tar.gz 11.0 kB Without provenance Details for vepi-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 20.7 kB

Release files / vepi-0.1.3.tar.gz

Download URL vepi-0.1.3.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5babd29aa2b9976f58ebe6038bbe18ce69f7bd6b4de049afa0fc381630efc095
BLAKE2b-256 checksum
How to use checksums
59b6cb6e33d9dbdbc09530be70e1465ccb91fcdd8d0894a80ef2e0a7e970f1fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / vepi-0.1.3-py3-none-any.whl

Download URL vepi-0.1.3-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8dacc414ee23a70d662303c1eb1c498a48e59eb7a5110936f48098b1304ede8
BLAKE2b-256 checksum
How to use checksums
5247f3ba3b15d2adb9508da6a1ccd05713f3cf54a4b57a5fa707499bfed5d93a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Security for vepi 0.1.3

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