Skip to main content

A Python package for interacting with Vena's ETL API

Project description

Vepi - Vena ETL Python Interface

A Python package for interacting with Vena's ETL API, providing a simple interface for data import and export 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

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
)

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

License

MIT

Contributing

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

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

vepi-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

vepi-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vepi-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for vepi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0882719690689b14286768de4c23a4ce49215be10fd855ad601bf739c323afb0
MD5 822dc2eef5fe7e0d8cac6a869cf18357
BLAKE2b-256 a3bf4b086bb0fc2c1ea264b2c462fe3aac13454d340c88a45267e5045e6bd5a2

See more details on using hashes here.

File details

Details for the file vepi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vepi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for vepi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 393c7fc134a206fc6083a6945f3bf9296bf7c25595891e278c9ac517fdea0788
MD5 030de7d8b9853cb1299a83ab450ef5af
BLAKE2b-256 5d90f082c979760c395d95fff9f21abd8f36e1fe254fbe447e9008253457c3a1

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