Skip to main content

A Python Wrapper for the Proof of Humanity Rest API

Project description

pypoh

A Python Wrapper for the Proof of Humanity Rest API.

Overview

With pypoh you can easily access all the information available at https://app.proofofhumanity.id/ and integrate it in you apps and/or Data Analysis tools.

  • Check if an ETH address has a registered profile at POH.
  • Download a list of Humans with all their data (registry history, given vouches, received vouches, name, photo link, etc).
  • Use the built-in Human() class to manage this data faster.

How to use it

Import

You can easily import pypoh with:

import pypoh

Or import only the methods you need with:

from pypoh import Human, ping, get_list_of_humans

Human Class Usage

pypoh comes with a class called "Human" that has all the data for a single real human registered at Proof of Humanity.

human = Human(address="0xSOME_ETH_ADDRESS")

Some Class Methods:

print(human.get_status_history)

{ "status": "VOUCHING", "time": "2022-01-11T01:13:06.790Z" }

print(human.get_given_vouches)

{ "eth_address": "0xf49a19f72d0e106df462cfd6b5bebe42b6001616", "status": "VOUCHING", "vanity_id": 1, "display_name": "satoshin", "first_name": "Satoshi", "last_name": "Nakamoto", "registered": true, "photo": "https://ipfs.kleros.io/ipfs/QmXmLgii8brfAP7edaabbRHey5VKvFhqqpSFfJf4sD1Lf6/image.jpg", "video": "https://ipfs.kleros.io/ipfs/QmXmLgii8brfAP7edaabbRHey5VKvFhqqpSFfJf4sD1Lf6/video.mp4", "bio": "Chancellor on brink of second bailout for banks.", "profile": "https://app.proofofhumanity.id/profile/0xf49a19f72d0e106df462cfd6b5bebe42b6001615", "registered_time": "2022-01-11T01:11:25.486Z", "creation_time": "2022-01-11T01:11:25.486Z" }

print(human.get_received_vouches)

{ "eth_address": "0xf49a19f72d0e106df462cfd6b5bebe42b6001616", "status": "VOUCHING", "vanity_id": 1, "display_name": "satoshin", "first_name": "Satoshi", "last_name": "Nakamoto", "registered": true, "photo": "https://ipfs.kleros.io/ipfs/QmXmLgii8brfAP7edaabbRHey5VKvFhqqpSFfJf4sD1Lf6/image.jpg", "video": "https://ipfs.kleros.io/ipfs/QmXmLgii8brfAP7edaabbRHey5VKvFhqqpSFfJf4sD1Lf6/video.mp4", "bio": "Chancellor on brink of second bailout for banks.", "profile": "https://app.proofofhumanity.id/profile/0xf49a19f72d0e106df462cfd6b5bebe42b6001615", "registered_time": "2022-01-11T01:11:25.486Z", "creation_time": "2022-01-11T01:11:25.486Z" }

Independent Methods

  • get_raw_list_of_humans: It returns a list of dicts with each human information based on the number and the "order_by" configuration you want.
  • get_raw_set_of_addresses: Similar to the previous ones but it returns a python set instead of a list. It is a bit faster.
  • get_list_of_humans: Similar to the previous ones, but this one returns a list of already instantiated Humans instead.
  • ping: Returns True if there is a correct conection to the Rest API.
  • is_registered: Returns True if the given ETH address is registered at Proof of Humanity.

Example of usage:

list_of_humans = pypoh.get_list_of_humans(amount=10, order_by= "registered_time", order_direction = "desc", include_unregistered = False)

Acknowledgements

This python Wrapper uses this Rest API: https://api-kovan.poh.dev

License

MIT License Copyright (c) 2018 YOUR NAME Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

pypoh-0.105.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypoh-0.105-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pypoh-0.105.tar.gz.

File metadata

  • Download URL: pypoh-0.105.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for pypoh-0.105.tar.gz
Algorithm Hash digest
SHA256 4b3e16c7b183621339a79ed5157b0b662bfc831eb4f24d859dd3db24d34e4e47
MD5 664f0aee88d8735ec425dc37ecb42f7e
BLAKE2b-256 a2fee108bb6bf595cef4c5bd39c859cecba8231c8e6880b2d343952da6a04a21

See more details on using hashes here.

File details

Details for the file pypoh-0.105-py3-none-any.whl.

File metadata

  • Download URL: pypoh-0.105-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for pypoh-0.105-py3-none-any.whl
Algorithm Hash digest
SHA256 64f82fadfba10336a6ac248778d869790ed1fda9b79788e92ca0f6f5774f857c
MD5 ceb33c182dc40455cfbfb3bc8df39eeb
BLAKE2b-256 c5c1ff61c8f8c9110bc546a031a8e91da6ba4048959b19db93a5275b96aa8354

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page