{ "info": { "author": "Jason Carver", "author_email": "ut96caarrs@snkmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Database :: Front-Ends", "Topic :: Internet :: Finger", "Topic :: Internet :: Name Service (DNS)", "Topic :: Security :: Cryptography", "Topic :: System :: Distributed Computing", "Topic :: System :: Systems Administration :: Authentication/Directory", "Topic :: Utilities" ], "description": "Ethereum Name Service via Python\n================================\n\n|Join the chat at https://gitter.im/ens-py/Lobby|\n\nAccess the Ethereum Name Service using this python library. Note: **this\nis a work in progress**\n\nUsing this library is not a way to skip learning how ENS works. If you\nare registering a name, a small misunderstanding can cause you to lose\n**all** your deposit. Go `read about\nENS `__ first. Your\nfunds are your responsibility.\n\nBeta-quality warning\n--------------------\n\nThis is a preview for developers, and an invitation for contributions.\nPlease do not use this in production until this warning is removed,\nespecially when putting funds at risk. Examples of funds being at risk\ninclude: sending ether/tokens to resolved addresses and participating in\nname auctions.\n\nIf you supply the a domain with type ``bytes``, it will be assumed to be\nUTF-8 encoded, like in `Ethereum\ncontracts `__.\n\nSetup\n-----\n\n::\n\n pip install ens\n\nAny issues? See `Setup details <#setup-details>`__\n\nUsage\n-----\n\nAll examples in Python 3\n\nName info\n~~~~~~~~~\n\nGet address from name\n^^^^^^^^^^^^^^^^^^^^^\n\nDefault to {name}.eth:\n\n::\n\n from ens import ens\n\n\n # look up the hex representation of the address for a name\n\n eth_address = ens.address('jasoncarver.eth')\n\n assert eth_address == '0x5b2063246f2191f18f2675cedb8b28102e957458'\n\n\n # ens.py will assume you want a .eth name if you don't specify a full name\n\n assert ens.address('jasoncarver') == eth_address\n\nGet name from address\n^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n domain = ens.name('0x5b2063246f2191f18f2675cedb8b28102e957458')\n\n\n # name() also accepts the bytes version of the address\n\n assert ens.name(b'[ c$o!\\x91\\xf1\\x8f&u\\xce\\xdb\\x8b(\\x10.\\x95tX') == domain\n\n\n # confirm that the name resolves back to the address that you looked up:\n\n assert ens.address(domain) == '0x5b2063246f2191f18f2675cedb8b28102e957458'\n\nGet owner of name\n^^^^^^^^^^^^^^^^^\n\n::\n\n eth_address = ens.owner('exchange.eth')\n\nSet up your name\n~~~~~~~~~~~~~~~~\n\nPoint your name to your address\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDo you want to set up your name so that ``ens.address()`` will show the\naddress it points to?\n\n::\n\n ens.setup_address('jasoncarver.eth', '0x5b2063246f2191f18f2675cedb8b28102e957458')\n\nYou must already be the owner of the domain (or its parent).\n\nIn the common case where you want to point the name to the owning\naddress, you can skip the address\n\n::\n\n ens.setup_address('jasoncarver.eth')\n\nYou can claim arbitrarily deep subdomains. *Gas costs scale up with the\nnumber of subdomains!*\n\n::\n\n ens.setup_address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth')\n\nWait for the transaction to be mined, then:\n\n::\n\n assert ens.address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth') == \\\n '0x5b2063246f2191f18f2675cedb8b28102e957458'\n\nPoint your address to your name\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDo you want to set up your address so that ``ens.name()`` will show the\nname that points to it?\n\nThis is like Caller ID. It enables you and others to take an account and\ndetermine what name points to it. Sometimes this is referred to as\n\"reverse\" resolution.\n\n::\n\n ens.setup_name('jasoncarver.eth', '0x5b2063246f2191f18f2675cedb8b28102e957458')\n\nIf you don't supply the address, ``setup_name`` will assume you want the\naddress returned by ``ens.address(name)``.\n\n::\n\n ens.setup_name('jasoncarver.eth')\n\nIf the name doesn't already point to an address, ``ens.setup_name`` will\ncall ``ens.setup_address`` for you.\n\nWait for the transaction to be mined, then:\n\n::\n\n assert ens.name('0x5b2063246f2191f18f2675cedb8b28102e957458') == 'jasoncarver.eth'\n\nAuctions for names ending in .eth\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGet auction status\n^^^^^^^^^^^^^^^^^^\n\nExample with domain 'payment.eth':\n\n::\n\n from ens.registrar import Status\n\n\n status = ens.registrar.status('payment')\n\n\n # if you forget to strip out .eth, ens.py will do it for you\n\n assert ens.registrar.status('payment.eth') == status\n\n\n # these are the possible statuses\n\n assert status in (\n Status.Open,\n Status.Auctioning,\n Status.Owned,\n Status.Forbidden,\n Status.Revealing,\n Status.NotYetAvailable\n )\n\n\n # if you get the integer status from another source, you can compare it directly\n\n assert Status.Owned == 2\n\nStart auctions\n^^^^^^^^^^^^^^\n\n::\n\n # start one auction (which tips people off that you're interested)\n\n ens.registrar.start('you_saw_him_repressin_me_didnt_ya')\n\n\n # start many auctions (which provides a bit of cover)\n\n ens.registrar.start(['exchange', 'tickets', 'payment', 'trading', 'registry'])\n\nBid on auction\n^^^^^^^^^^^^^^\n\nBid on a 'trading.eth' with 5211 ETH, and secret \"I promise I will not\nforget my secret\":\n\n::\n\n from web3utils import web3\n\n ens.registrar.bid(\n 'trading',\n web3.toWei('5211', 'ether'),\n \"I promise I will not forget my secret\",\n transact={'from': web3.eth.accounts[0]}\n )\n\n(if you want to \"mask\" your bid, set a higher value in the transact\ndict)\n\nReveal your bid\n^^^^^^^^^^^^^^^\n\nYou must **always** reveal your bid, whether you won or lost. Otherwise\nyou will lose the full deposit.\n\nExample of revealing your bid on 'registry.eth' with 0.01 ETH, and\nsecret \"For real, though: losing your secret means losing ether\":\n\n::\n\n ens.registrar.reveal(\n 'registry',\n web3.toWei('0.01', 'ether'),\n \"For real, though: losing your secret means losing ether\",\n transact={'from': web3.eth.accounts[0]}\n )\n\nClaim the name you won\n^^^^^^^^^^^^^^^^^^^^^^\n\naka \"Finalize\" auction, which makes you the owner in ENS.\n\n::\n\n ens.registrar.finalize('gambling')\n\nGet detailed information on an auction\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFind out the owner of the auction Deed -- see `docs on the\ndifference `__\nbetween owning the name and the deed\n\n::\n\n deed = ens.registrar.deed('ethfinex')\n\n assert deed.owner() == '0x9a02ed4ca9ad55b75ff9a05debb36d5eb382e184'\n\nWhen was the auction completed? (a timezone-aware datetime object)\n\n::\n\n close_datetime = ens.registrar.close_at('ethfinex')\n\n assert str(close_datetime) == '2017-06-05 08:10:03+00:00'\n\nHow much is held on deposit?\n\n::\n\n from decimal import Decimal\n\n deposit = ens.registrar.deposit('ethfinex')\n\n assert web3.fromWei(deposit, 'ether') == Decimal('0.01')\n\nWhat was the highest bid?\n\n::\n\n top_bid = ens.registrar.top_bid('ethfinex')\n\n assert web3.fromWei(top_bid, 'ether') == Decimal('201709.02')\n\nSetup details\n-------------\n\nIf Python 2 is your default, or you're not sure\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn your shell\n\n::\n\n if pip --version | grep \"python 2\"; then\n python3 -m venv ~/.py3venv\n source ~/.py3venv/bin/activate\n fi\n\nNow, with Python 3\n~~~~~~~~~~~~~~~~~~\n\nIn your shell: ``pip install ens``\n\n*ens.py* requires an up-to-date Ethereum blockchain, preferably local.\nIf your setup isn't working, try running ``geth --fast`` until it's\nfully-synced. I highly recommend using the default IPC communication\nmethod, for speed and security.\n\n\"No matching distribution found for ens\"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you are seeing something like:\n\n::\n\n Collecting ens\n Could not find a version that satisfies the requirement ens (from versions: )\n No matching distribution found for ens\n\nThen retry the first Setup section, to make sure you're in Python 3\n\nOptionally, a custom web3 provider\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn Python:\n\n::\n\n from ens import ENS\n from web3 import IPCProvider \n\n ens = ENS(IPCProvider('/your/custom/ipc/path'))\n\nDeveloper Setup\n---------------\n\n::\n\n git clone git@github.com:carver/ens.py.git\n cd ens.py/\n\n python3 -m venv venv\n . venv/bin/activate\n\n pip install -e .\n pip install -r requirements-dev.txt\n\nTesting Setup\n~~~~~~~~~~~~~\n\nRe-run flake on file changes:\n\n::\n\n $ when-changed -s -1 -r ens/ tests/ -c \"clear; echo; echo \\\"running flake - $(date)\\\"; warn()\n {\n notify-send -t 5000 'Flake8 failure \u26a0\u26a0\u26a0\u26a0\u26a0' 'flake8 on ens.py failed'\n }\n if ! git diff | flake8 --diff | grep \"\\.py\"; then if ! flake8 ens/ tests/; then warn; fi else warn; fi; echo done\"\n\nWhy does ens.py require python 3?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n*Short version*\n\nIt turns out that the distinction between ``str`` and ``bytes`` is\nimportant. If you want to write code for the future (Ethereum), don't\nuse a language from the past.\n\n*Long version*\n\nInteracting with the EVM requires clarity on the bits you're using. For\nexample, a sha3 hash expects to receive a series of bytes to process.\nCalculating the sha3 hash of a string is (or should be) a Type Error;\nthe hash algorithm doesn't know what to do with a series of characters,\naka Unicode code points. As the caller, you need to know which thing\nyou're calculating the hash of: 1. a series of bytes:\n``b'[ c$o!\\x91\\xf1\\x8f&u\\xce\\xdb\\x8b(\\x10.\\x95tX'`` 2. the bytes\nrepresented by a string in hex format:\n``'0x5b2063246f2191f18f2675cedb8b28102e957458'`` 3. the bytes generated\nby encoding a string using utf-8: **Oops, the bytes from #1 cannot be\nread using utf-8!** 4. the bytes generated by encoding a string using\nutf-16: ``'\u205b\u2463\u216f\\uf191\u268f\uce75\u8bdb\u1028\u952e\u5874'``\n\nPython 3 doesn't let you ignore a lot of these details. That's good,\nbecause precision in dealing with the EVM is critical. Ether is at\nstake.\n\nIf you are resistant -- I get it, I've been there. It is not intuitive\nfor most people. But it's seriously worth it to `learn about\nencoding `__\nif you're going to develop on top of Ethereum. Your ETH depends on it!\n\n.. |Join the chat at https://gitter.im/ens-py/Lobby| image:: https://badges.gitter.im/ens-py/Lobby.svg\n :target: https://gitter.im/ens-py/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/carver/ens.py", "keywords": "ethereum eth web3 web3.py ENS", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ens", "package_url": "https://pypi.org/project/ens/", "platform": "", "project_url": "https://pypi.org/project/ens/", "project_urls": { "Homepage": "https://github.com/carver/ens.py" }, "release_url": "https://pypi.org/project/ens/0.6.1/", "requires_dist": [ "pytz", "web3 (<4,>=3.16.1)" ], "requires_python": ">=3.5", "summary": "Ethereum Name Service, made easy in Python", "version": "0.6.1" }, "last_serial": 3225216, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "14a96c355267ec811f37b5796d171628", "sha256": "24c5c61dfabda233fbfdd4f005bec4ad247626a6c936b49ac91c853adad86165" }, "downloads": -1, "filename": "ens-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "14a96c355267ec811f37b5796d171628", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 11954, "upload_time": "2017-07-24T00:26:16", "url": "https://files.pythonhosted.org/packages/c8/82/a3773f89ac3978ecddfb5e1674727111fdccac78c586acfd6c324299a3dd/ens-0.0.1-py3-none-any.whl" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "f4eabbb8a65d103e743c403df0d23dae", "sha256": "cb67fab3321f8c98ac2e3639a57aaf2a803a6481830f1a5ed4d3df4a1a4a115d" }, "downloads": -1, "filename": "ens-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "f4eabbb8a65d103e743c403df0d23dae", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.5", "size": 12692, "upload_time": "2017-07-24T19:31:47", "url": "https://files.pythonhosted.org/packages/6a/ee/9e652de3c7f1de9b04fb45dcbac6644c664a163255176f58dd1842d85cb1/ens-0.1.0-py2-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1aa02e513a5976834d758ef2d125a7a5", "sha256": "6a05aadf3d3accb081829fd5794e9dd53ac9756b633f1252f7cf5faecf5ae938" }, "downloads": -1, "filename": "ens-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1aa02e513a5976834d758ef2d125a7a5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 13641, "upload_time": "2017-07-25T18:13:13", "url": "https://files.pythonhosted.org/packages/90/e9/b6d5814ffaf719ea2b212d9d89feb50e22e38fa4d5ba2f22aa50cd55a01c/ens-0.2.0-py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "b642d6881d1dcf4062c79671a107152e", "sha256": "7d95b41c242e3312133fe6ce3ace622b1033e71ba1f435bed3188443548ae992" }, "downloads": -1, "filename": "ens-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b642d6881d1dcf4062c79671a107152e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 13659, "upload_time": "2017-07-25T18:32:01", "url": "https://files.pythonhosted.org/packages/ac/da/ede07a91d948e07e3d34f678fbcb4f07c6b1a10b9bee111f6312612dc6c4/ens-0.3.0-py3-none-any.whl" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "8d39719d277f0677c5a98b88efcf621e", "sha256": "ba95ccde4d3754b34178834dbea8aeff5bcba64b83c08a541adf3dcfea35cf1b" }, "downloads": -1, "filename": "ens-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8d39719d277f0677c5a98b88efcf621e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 15974, "upload_time": "2017-07-29T00:13:08", "url": "https://files.pythonhosted.org/packages/92/88/9430af7cc543d792fd7160e1f23d7439b4500512210ae9f570b8287571c8/ens-0.4.0-py3-none-any.whl" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "0265bae8e9f1c20608e53587cf619aaf", "sha256": "4f989c45b14f4f27f9c42d487b2adf38c0608add27eec77ddda924a89fe6929f" }, "downloads": -1, "filename": "ens-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0265bae8e9f1c20608e53587cf619aaf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 15783, "upload_time": "2017-08-10T22:33:06", "url": "https://files.pythonhosted.org/packages/c0/c5/ba605f3e8cd5cf9c28de07d6811b745fdd502a83953af5c516e426837f06/ens-0.5.0-py3-none-any.whl" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "01b8e6f9f3dddb86fb28f6eaf444657a", "sha256": "cbba256c713b166f2e52d1b89deaf4cef32ca06e977047d5c6930fe55f687e70" }, "downloads": -1, "filename": "ens-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "01b8e6f9f3dddb86fb28f6eaf444657a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 16012, "upload_time": "2017-08-22T22:54:48", "url": "https://files.pythonhosted.org/packages/e2/5d/ef517c4479a3fe2e8a7ec02302014583ca44ad2958f29650e4a64090b943/ens-0.5.1-py3-none-any.whl" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "98ae90fc7be1a57e1eb6fa824e19dd37", "sha256": "1cbfd1c6d20ac442e1496d0cb620aff78635efba757f994759b7c3a11425e759" }, "downloads": -1, "filename": "ens-0.5.2-py3-none-any.whl", "has_sig": false, "md5_digest": "98ae90fc7be1a57e1eb6fa824e19dd37", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 16092, "upload_time": "2017-08-22T23:12:19", "url": "https://files.pythonhosted.org/packages/05/4d/920d57b2560aa336e957eae10c90608bb92daa0ebea751a56bdb39bc6eee/ens-0.5.2-py3-none-any.whl" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "b585b8d51ad111bf94b600ad099542da", "sha256": "ee966a3b23a7451623910efdf90f9512fd150e080b2c4ba2e200a735fe49cbfe" }, "downloads": -1, "filename": "ens-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b585b8d51ad111bf94b600ad099542da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 17896, "upload_time": "2017-10-04T00:28:38", "url": "https://files.pythonhosted.org/packages/25/37/8616facc9066ec226792309821f7132fdb62d91c21a35902c8afeb52572e/ens-0.6.0-py3-none-any.whl" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "bfe38c19bc546ed900708a354e266a75", "sha256": "a4cc0b60c09a874384fa795676600da80ed5120ae265f29007d4a4d69436ee1c" }, "downloads": -1, "filename": "ens-0.6.1-py3-none-any.whl", "has_sig": false, "md5_digest": "bfe38c19bc546ed900708a354e266a75", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 18182, "upload_time": "2017-10-04T14:55:53", "url": "https://files.pythonhosted.org/packages/ad/a8/9172ad1cd2afc878843a9bca43bc1225d3446d452b34a46b4d7f4b0bc188/ens-0.6.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bfe38c19bc546ed900708a354e266a75", "sha256": "a4cc0b60c09a874384fa795676600da80ed5120ae265f29007d4a4d69436ee1c" }, "downloads": -1, "filename": "ens-0.6.1-py3-none-any.whl", "has_sig": false, "md5_digest": "bfe38c19bc546ed900708a354e266a75", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 18182, "upload_time": "2017-10-04T14:55:53", "url": "https://files.pythonhosted.org/packages/ad/a8/9172ad1cd2afc878843a9bca43bc1225d3446d452b34a46b4d7f4b0bc188/ens-0.6.1-py3-none-any.whl" } ] }