Skip to main content

UriPoint

Overview

UriPoint is a flexible Python library for creating, managing, and interacting with network endpoints across multiple protocols. It provides a unified interface for handling various communication protocols and includes a built-in server for serving live endpoints with HTTP method support.

Key Features

Persistent Endpoint Management

UriPoint provides a robust CLI for creating and managing endpoints that persist across sessions.

How It Works

  1. Configuration Storage

    • Endpoints are stored in ~/.uripoint_config.yaml
    • Automatically saves and loads endpoint configurations
    • Maintains state between CLI sessions
  2. Endpoint Creation

    • Supports multiple creation methods
    • Prevents duplicate endpoint registration
    • Stores endpoint details with associated metadata
    • Configurable HTTP methods
  3. Live Server

    • Built-in HTTP server for serving endpoints
    • Multi-port support
    • Protocol-specific handlers
    • HTTP method validation
    • CORS support

Installation

pip install uripoint

CLI Usage

Endpoint Creation Methods

  1. Full URI Approach with HTTP Methods
# Create an endpoint with full URI and specific HTTP methods
uripoint --uri http://localhost:8080/api/users --data '{"response": {"status": "OK"}}' --method GET POST PUT
  1. Component-Based Approach
# Create an endpoint using individual components
uripoint --hostname localhost --path /api/status --protocol http --port 8001 --data '{"status": "OK"}' --method GET

Endpoint Management

# List all configured endpoints
uripoint --list

# Serve all endpoints as a live server
uripoint --serve

# Test endpoints
uripoint --test

# Detach specific endpoints
uripoint --detach "http://localhost:9000/api/hello" "http://localhost:9001/metrics"

# Detach all endpoints
uripoint --detach

HTTP Method Configuration

Endpoints can be configured to accept specific HTTP methods:

# Example endpoint configuration
endpoints:
  "http://localhost:9000/api/users":
    response:
      users: []
    content_type: "application/json"
    methods: ["GET", "POST", "PUT", "DELETE"]  # Allowed methods

  "http://localhost:9000/api/status":
    response:
      status: "OK"
    content_type: "application/json"
    methods: ["GET"]  # Read-only endpoint

Server Example

Create test endpoints with method configuration:

from uripoint import UriPointCLI

def setup_test_endpoints():
    cli = UriPointCLI()

    # Create a read-only endpoint
    cli.create_endpoint(
        uri='http://localhost:9000/api/status',
        data={
            'response': {'status': 'OK'},
            'methods': ['GET']
        }
    )

    # Create a full CRUD endpoint
    cli.create_endpoint(
        uri='http://localhost:9000/api/users',
        data={
            'response': {'users': []},
            'methods': ['GET', 'POST', 'PUT', 'DELETE']
        }
    )

setup_test_endpoints()

Then run the server:

# Start the server
uripoint --serve

# Test different methods
curl -X GET http://localhost:9000/api/users
curl -X POST http://localhost:9000/api/users -d '{"name": "John"}'
curl -X PUT http://localhost:9000/api/users/1 -d '{"name": "John Doe"}'
curl -X DELETE http://localhost:9000/api/users/1

# Check allowed methods
curl -X OPTIONS http://localhost:9000/api/users

Supported Protocols

Web Protocols

  • HTTP/HTTPS
    • RESTful API endpoints
    • Method-specific handling (GET, POST, PUT, DELETE, etc.)
    • CORS support
    • Static file serving
    • Proxy support
    • See examples/endpoint_demo/

[Rest of protocol documentation remains unchanged...]

Protocol Examples

Each protocol comes with a comprehensive example demonstrating its usage:

# HTTP Example with Methods
from uripoint import UriPointCLI

def setup_http():
    cli = UriPointCLI()
    cli.create_endpoint(
        uri='http://localhost:9000/api/users',
        data={
            'response': {'users': []},
            'methods': ['GET', 'POST', 'PUT', 'DELETE']
        }
    )

[Rest of examples remain unchanged...]

Configuration File Location

  • Path: ~/.uripoint_config.yaml
  • Format: YAML
  • Contents: List of endpoint configurations with method support

Contributing

Contributions are welcome! Please see CONTRIBUTING.md

License

This project is licensed under the terms of the LICENSE file in the project root.

Changelog

See CHANGELOG.md for version history and updates.

Metadata

Release files for uripoint 1.2.0

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

Source distribution (sdist)

Source distribution for uripoint 1.2.0
File Size Uploaded
uripoint-1.2.0.tar.gz 33.7 kB Details

Built distribution (wheel)

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

Total release size: 50.3 kB

Release files / uripoint-1.2.0.tar.gz

Download URL uripoint-1.2.0.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1cfdefad4d252dd9a1ed88c3938ec77055f55b34a1dec5278dd40a33ed45acee
BLAKE2b-256 checksum
How to use checksums
0c857a21c4a0e6a23ce4bc68bab8b4ad59221713c3f80d75cf699356ae3d0057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.3

Release files / uripoint-1.2.0-py3-none-any.whl

Download URL uripoint-1.2.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a987988e9b01f3e39e9480a60c6522ced4f5a58029c57f796576be4da6299d3a
BLAKE2b-256 checksum
How to use checksums
962d1dc0ded92391591f1f23b5162f759f540da9675f15f7bbb393338581164f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.3

Release history Release notifications | RSS feed

1.9.7

2 release files

1.9.6

2 release files

1.9.5

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

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