Skip to main content

MESC is the Multiple Endpoint Shared Configuration Standard

Project description

Python MESC Implementation

This is a reference implementation of the Python MESC Standard

It has no external dependencies.

Installation

From PyPI

pip install mesc

From Source

git clone https://github/paradigmxyz/mesc
cd mesc
pip install ./

Example Usage

import mesc

# get the default endpoint
endpoint = mesc.get_default_endpoint()

# get the default endpoint of a network
endpoint = mesc.get_endpoint_by_network(5)

# get the default endpoint for a particular tool
endpoint = mesc.get_default_endpoint(profile='xyz_tool')

# get the default endpoint of a network for a particular tool
endpoint = mesc.get_endpoint_by_network(5, profile='xyz_tool')

# get an endpoint by name
endpoint = mesc.get_endpoint_by_name('local_goerli')

# parse a user-provided string into a matching endpoint
# (first try 1. endpoint name, then 2. chain id, then 3. network name)
endpoint = mesc.get_endpoint_by_query(user_str, profile='xyz_tool')

# find all endpoints matching given criteria
endpoints = mesc.find_endpoints(chain_id=5)

Reference

from typing import Any, MutableMapping, TypedDict, Literal, Sequence

class RpcConfig(TypedDict):
    mesc_version: str
    default_endpoint: str | None
    endpoints: MutableMapping[str, Endpoint]
    network_defaults: MutableMapping[str, str]
    network_names: MutableMapping[str, str]
    profiles: MutableMapping[str, Profile]
    global_metadata: MutableMapping[str, Any]

class Endpoint(TypedDict):
    name: str
    url: str
    chain_id: str | None
    endpoint_metadata: MutableMapping[str, Any]

class Profile(TypedDict):
    name: str
    default_endpoint: str | None
    network_defaults: MutableMapping[str, str]

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

mesc-0.1.4.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

mesc-0.1.4-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file mesc-0.1.4.tar.gz.

File metadata

  • Download URL: mesc-0.1.4.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.30.0

File hashes

Hashes for mesc-0.1.4.tar.gz
Algorithm Hash digest
SHA256 569dcaed6e50c0028cc7bd1717a2c6d0d842f9502f0ecd4790a992c755a9f14d
MD5 4fdf5a5d1d99b8a2d651015b4d34df42
BLAKE2b-256 176e4d146ac3b19936ca1ca13eb564bb57f69644b2ab7ca345cc3e4fdf5e74bc

See more details on using hashes here.

File details

Details for the file mesc-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: mesc-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.30.0

File hashes

Hashes for mesc-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3b9a554eb36ab2aeee006d059b8c6bb9f27d57711af98e6b9e046288a2743627
MD5 47567849141ff2b7ad0b6ba7e29dce11
BLAKE2b-256 554241ff36c6e000cc1de645c1f883f3e85dc446e8744dba2d29feca8f572ca5

See more details on using hashes here.

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