Skip to main content

Django Ethereum Utilities

A collection of helpers to make it easier to work with Ethereum from your Django app.

Currently this only consists of a custom model field which stores Ethereum addresses in the checksummed format.

Install

pip install django-ethereum

Fields

EthereumAddressField

A CharField which automatically converts an Ethereum address into its checksummed representation.

    from django_ethereum.fields import EthereumAddressField

    class MyModel(models.Model):
        address = EthereumAddressField()

    my_model = MyModel(address="0x627306090abab3a6e1400e9345bc60c78a8bef57")
    my_model.save()
    print(my_model.address)
    "0x627306090abaB3A6e1400e9345bC60c78a8BEf57"  # Note capitalisation

If the address is invalid a ValidationError will be raised.

Note that the address is stored in the checksummed format. If you want to compare against a non-checksummed address you will need to perform a case-insensitive match (or preferably convert the address to a checksummed address before comparing):

    MyModel.objects.filter(address__iexact=non_checksummed_address)
    # Or
    MyModel.objects.filter(address__iexact=Web3.toChecksumAddress(non_checksummed_address))

Metadata

Release files for django-ethereum 0.0.4

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

Source distribution (sdist)

Source distribution for django-ethereum 0.0.4
File Size Uploaded Provenance Actions
django-ethereum-0.0.4.tar.gz 3.3 kB Without provenance Details for django-ethereum-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-ethereum 0.0.4
File Interpreter ABI Platform Actions
django_ethereum-0.0.4-py3-none-any.whl Python 3 none any Details for django_ethereum-0.0.4-py3-none-any.whl

Total release size: 6.7 kB

Release files / django-ethereum-0.0.4.tar.gz

Download URL django-ethereum-0.0.4.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3b30c7c0f34c1c0560b2838cb0790cd88bd24f5fc81b26ab6bb31c27c15649aa
BLAKE2b-256 checksum
How to use checksums
dae0e546036d8798833c802cd45e84340506cf7d173fcdaa35e994af338b5aa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_ethereum-0.0.4-py3-none-any.whl

Download URL django_ethereum-0.0.4-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d1e87452af45ba5a7cd92e61e18bd94d47ce3fd171b36132d21e776e0da402c
BLAKE2b-256 checksum
How to use checksums
7cf6ddc86d4fc38531b6fc409780d6c721bcb48d12d7c687b2f4b200f20871d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-ethereum 0.0.4

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.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

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