Skip to main content

Open source metadata processing framework

Project description

offchain

Documentation | Zora API


offchain is a library for parsing NFT metadata. It's used by Zora's indexer & API. It can handle metadata of many standards (OpenSea, ZORA, Nouns), hosted in many places (ipfs, http, dataURIs), and normalize them into a consistent format.

Our goal with this project is to democratize access to NFT metadata.

pip install offchain
from offchain import MetadataPipeline, Token

pipeline = MetadataPipeline()
token = Token(
    collection_address="0x5180db8f5c931aae63c74266b211f580155ecac8",
    token_id=9559
)
metadata = pipeline.run([token])[0]

metadata.name               # -> 'antares the improbable'
metadata.description        # -> 'You are a WITCH who bathes in the tears of...'
metadata.standard           # -> OPENSEA_STANDARD
metadata.attributes         # -> [Attribute(trait_type='Skin Tone', ...]
metadata.image              # -> MediaDetails(size=2139693, sha256=None, uri='https://cryptocoven.s3.amazonaws.com/2048b255aa1d02045eef13cdd7100479.png', mime_type='image/png')
metadata.additional_fields  # -> [MetadataField(...), ...]

See documentation for more examples and tutorials.

Contributing

We welcome contributions that add support for new metadata standards, new ways of retreiving metadata, and ways of normalizing them to a consistent form. We are commited to integrating contributions to our indexer and making the results available in our API.

You should be able to contribute a new standard for metadata, and have NFTs that adhere to that metadata standard be returned correctly from queries to api.zora.co. We hope this helps to foster innovation in how NFTs are represented, where metadata is stored, and what is expressed in that metadata.

Features

  • Multiple metadata standards: represent metadata any way you wish
  • Multiple transport protocols: store metadata where you want
  • Composible for custom applications: only parse the standards you care about
  • Future proof: extensible to new formats, locations, etc. The more gigabrain the better.

Development

This project is developed using Python 3.9. Here's a recommended setup:

Poetry

This project uses poetry for dependency management and packaging. Install poetry:

curl -sSL https://install.python-poetry.org | python3 -

Setup

poetry install

Pre-commit

Pre-commit runs checks to enforce coding standards on every commit

pip install pre-commit  # into global python path
pre-commit install

Testing

poetry run python -m pytest tests/

Documentation

This project uses mkdocs and mkdocs-material for documentation.

poetry run mkdocs serve

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

offchain-0.1.2.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

offchain-0.1.2-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file offchain-0.1.2.tar.gz.

File metadata

  • Download URL: offchain-0.1.2.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/20.6.0

File hashes

Hashes for offchain-0.1.2.tar.gz
Algorithm Hash digest
SHA256 91275626bc998b831b935f1fb3b3b5eca27860610e2ede7d7b9172382b28acff
MD5 8c8f2371641b8c360c7b956fef899f9e
BLAKE2b-256 514db6e5b30f86cc73e6406c3c109afe5c6ad4ccdfceb6d4388c88e52d78a616

See more details on using hashes here.

File details

Details for the file offchain-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: offchain-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/20.6.0

File hashes

Hashes for offchain-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b13a7dd7c344b4bdb6b4375ffc4c48406a0943ba0ad602c6d0c8a53b5809d51
MD5 fc0c36f0c9c7ecbaa84d3064f4a3a55f
BLAKE2b-256 41791bff75fc056d4ccd2c317accd25f125afcfb5935db1cf557d00b3973c3d1

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