Skip to main content

Python wrapper for the Ouro API

Project description

ouro-py

Python client for Ouro

Usage

Generate an API key from your account settings by going to ouro.foundation/app/settings/api-keys.

Set your Ouro environment variables in a dotenv file, or using the shell:

export USER_API_KEY="your_ouro_api_key"

Init client:

import os
from ouro import Ouro

api_key = os.environ.get("USER_API_KEY")
ouro = Ouro()
ouro.login(api_key)

Use the client to interface with the Ouro framework.

Create a dataset

data = pd.DataFrame([
    {"name": "Bob", "age": 30},
    {"name": "Alice", "age": 27},
    {"name": "Matt", "age": 26},

])

dataset = ouro.earth.create_dataset({
        "name": "unique_dataset_name",
        "description": "dataset_description",
        "visibility": "private",
    },
    data
)

Read a dataset

id = "3d82308b-0747-45e4-8045-c8f7d2f6c0a6" # penguins dataset
dataset = ouro.earth.read_dataset(id)

# Read dataset's data as a Pandas DataFrame
df = ouro.earth.read_dataset_data(id)

Contributing

Contributing to the Python library is a great way to get involved with the Ouro community. Reach out to us on our Github Discussions page if you want to get involved.

Set up a Local Development Environment

Clone the Repository

git clone git@github.com:ourofoundation/ouro-py.git
cd ouro-py

Create and Activate a Virtual Environment

We recommend activating your virtual environment. Click here for more about Python virtual environments and working with conda and poetry.

Using venv (Python 3 built-in):

python3 -m venv env
source env/bin/activate  # On Windows, use .\env\Scripts\activate

Using conda:

conda create --name ouro-py
conda activate ouro-py

PyPi installation

Install the package (for > Python 3.7):

# with pip
pip install ouro-py

Local installation

You can also install locally after cloning this repo. Install Development mode with pip install -e, which makes it so when you edit the source code the changes will be reflected in your python module.

Badges

License: MIT CI Python Version Codecov Last commit GitHub commit activity Github Stars Github Forks Github Watchers GitHub contributors

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

ouro_py-0.0.3.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

ouro_py-0.0.3-py3-none-any.whl (8.3 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