Skip to main content

Hopara Python Library

Project description

Pyhopara

Pyhopara is the Hopara Python SDK. It's main purpose is to ingest data from Python/Pandas.

Install

pip install hopara

Before using Pyhopara you should setup your environment. This is achieved by installing the Hopara CLI and sign-in or sign-up:

npm install -g hopara
hopara signup

Basic usage:

import hopara as hp

hopara = hp.Hopara()

table = hp.Table('table_name')
table.add_column('column1', hp.ColumnType.INTEGER)
table.add_column('column2', hp.ColumnType.STRING)

hopara.create_table(table)

rows = [{'column1': 1, 'column2': 'a'},
        {'column1': 2, 'column2': 'b'},
        {'column1': 3, 'column2': 'c'}]
hopara.insert_rows(table, rows)

With pandas DataFrame:

import hopara as hp
import hopara.from_pandas as hpd
import pandas as pd

hopara = hp.Hopara()

df = pd.DataFrame({
    'column1': [1, 2, 3],
    'column2': ['a', 'b', 'c']
})
table = hpd.get_table('table_name', df)

hopara.create_table(table)
hopara.insert_rows(table, hpd.get_rows(df))

Please check the Hopara and Table sections for additional options.

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

hopara-1.20.0.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

hopara-1.20.0-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page