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.com/paradigmxyz/mesc
cd mesc
pip install ./
Example Usage
from typing import Any, Mapping, Sequence
import mesc
# check whether mesc is enabled
enabled: bool = mesc.is_mesc_enabled()
# get the default endpoint
endpoint: Endpoint | None = mesc.get_default_endpoint()
# get the default endpoint of a network
endpoint: Endpoint | None = mesc.get_endpoint_by_network(5)
# get the default endpoint for a particular tool
endpoint: Endpoint | None = mesc.get_default_endpoint(profile='xyz_tool')
# get the default endpoint of a network for a particular tool
endpoint: Endpoint | None = mesc.get_endpoint_by_network(5, profile='xyz_tool')
# get an endpoint by name
endpoint: Endpoint | None = 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: Endpoint | None = mesc.get_endpoint_by_query(user_str, profile='xyz_tool')
# find all endpoints matching given criteria
endpoints: Sequence[Endpoint] = mesc.find_endpoints(chain_id=5)
# get non-endpoint metadata
metadata: Mapping[str, Any] = mesc.get_global_metadata(profile='xyz_tool')
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]
Metadata
Release files for mesc 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mesc-0.2.1.tar.gz | 26.6 kB | Without provenance | Details for mesc-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mesc-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for mesc-0.2.1-py3-none-any.whl |
Total release size: 53.3 kB
Release files / mesc-0.2.1.tar.gz
| Download URL | mesc-0.2.1.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ec8f7f8daae54fc2e2d3da016664db35a0c40acc1aae46f6681a0f26340b133
|
|
BLAKE2b-256 checksum How to use checksums |
a33dd0b34ffb74c7706e877f1a09374a4c38d2a5625d0fe1c87bcdc9535b5b41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / mesc-0.2.1-py3-none-any.whl
| Download URL | mesc-0.2.1-py3-none-any.whl |
|---|---|
| Size | 26.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c919cefc242ce04fc78ea4e2c3f8358d9ce368d202c0f48c920a72bbf6b9f34e
|
|
BLAKE2b-256 checksum How to use checksums |
cefb166a25261d7cca68d6cdb5d4074afc62e0f27c4ac67c6cb8599292776614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Security for mesc 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.