This guide covers different ways to install and use the Text2Everything SDK.
The SDK is published to PyPI and can be installed with pip:
# Install the latest version
pip install h2o-text-2-everything
# Install with optional dependencies
pip install h2o-text-2-everything[integrations] # pandas, jupyter, h2o-drive
pip install h2o-text-2-everything[dev] # development tools
pip install h2o-text-2-everything[docs] # documentation tools
# Install a specific version
pip install h2o-text-2-everything==0.1.7rc3This is the recommended installation method for most users.
Once installed, you can use the SDK:
from text2everything_sdk import Text2EverythingClient
# Initialize client
client = Text2EverythingClient(
base_url="https://your-api-endpoint.com",
access_token="your-access-token",
workspace_name="workspaces/my-workspace"
)
# Create a project
project = client.projects.create(name="My Project")
print(f"Created project: {project.id}")For contributing to the SDK or local development:
# Clone the repository
git clone https://github.com/h2oai/text-2-everything.git
cd text-2-everything/text2everything_sdk
# Install in development mode with all dependencies
pip install -e ".[dev,integrations,docs]"Or install from a local wheel file:
pip install dist/h2o_text_2_everything-0.1.2-py3-none-any.whlThe SDK is published to PyPI using GitHub Actions. To publish manually:
- Create PyPI Account: Register at pypi.org
- Install Publishing Tools:
pip install build twine
-
Prepare for Publishing:
cd text2everything_sdk # Clean previous builds rm -rf dist/ build/ *.egg-info/ # Update version in setup.py if needed # Ensure README.md and requirements.txt are up to date
-
Build the Package:
python -m build
-
Test Upload to TestPyPI (recommended first):
# Upload to TestPyPI first python -m twine upload --repository testpypi dist/* # Test installation from TestPyPI pip install --index-url https://test.pypi.org/simple/ h2o-text-2-everything
-
Upload to Production PyPI:
python -m twine upload dist/* -
Verify Installation:
pip install h2o-text-2-everything
Create a .pypirc file in your home directory for authentication:
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = pypi-your-api-token-here
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-your-test-api-token-hereCreate a .env file in your project root:
# .env file
T2E_BASE_URL=https://your-api-endpoint.com
T2E_ACCESS_TOKEN=your-access-token
T2E_WORKSPACE_NAME=workspaces/my-workspaceThe SDK will automatically load these variables when running tests.
Alternatively, set environment variables:
export T2E_BASE_URL="https://your-api-endpoint.com"
export T2E_ACCESS_TOKEN="your-access-token"
export T2E_WORKSPACE_NAME="workspaces/my-workspace"For contributing to the SDK:
# Clone the repository
git clone https://github.com/h2oai/text-2-everything.git
cd text-2-everything/text2everything_sdk
# Install in development mode with all dependencies
pip install -e ".[dev,integrations,docs]"
# Run tests
python run_tests.py
# Or use pytest directly
pytest
# Format code
black .
isort .
# Type checking
mypy text2everything_sdk/- Import Errors: Make sure you're in the right directory and the package is installed
- Authentication Errors: Verify your API key and base URL are correct
- Connection Errors: Check your network connection and API endpoint
- Documentation: Check the README.md for API reference
- Examples: See the
examples/directory for usage examples - Issues: Report bugs at GitHub Issues
- v0.1.2: Current version with custom tools, nested validation, and .env support
- v0.1.1: Enhanced multipart file upload support
- v0.1.0: Initial release with core functionality
- For Users: Install from PyPI with
pip install h2o-text-2-everything - For Contributors: Use development installation with all dependencies
- For Maintainers: Follow the publishing guide above