{"id":17247576,"url":"https://github.com/jcarbaugh/python-webfinger","last_synced_at":"2025-04-14T05:31:49.303Z","repository":{"id":57477656,"uuid":"514021","full_name":"jcarbaugh/python-webfinger","owner":"jcarbaugh","description":"Python WebFinger client","archived":false,"fork":false,"pushed_at":"2019-05-13T14:38:43.000Z","size":32,"stargazers_count":43,"open_issues_count":2,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T13:29:33.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/webfinger","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcarbaugh.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-02-11T22:53:55.000Z","updated_at":"2025-02-06T03:17:39.000Z","dependencies_parsed_at":"2022-09-18T20:21:22.239Z","dependency_job_id":null,"html_url":"https://github.com/jcarbaugh/python-webfinger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fpython-webfinger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fpython-webfinger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fpython-webfinger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fpython-webfinger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcarbaugh","download_url":"https://codeload.github.com/jcarbaugh/python-webfinger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953107,"owners_count":21023947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T06:38:21.361Z","updated_at":"2025-04-14T05:31:49.064Z","avatar_url":"https://github.com/jcarbaugh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========\nwebfinger\n=========\n\nA simple Python client implementation of `WebFinger RFC 7033 \u003chttp://tools.ietf.org/html/rfc7033\u003e`_.\n\nWebFinger is a discovery protocol that allows you to find information about people or things in a standardized way. See the `spec \u003chttp://tools.ietf.org/html/rfc7033\u003e`_ or `webfinger.net \u003chttp://webfinger.net\u003e`_ for more information.\n\n::\n\n    \u003e\u003e\u003e from webfinger import finger\n    \u003e\u003e\u003e wf = finger('acct:eric@konklone.com')\n    \u003e\u003e\u003e wf.subject\n    acct:eric@konklone.com\n    \u003e\u003e\u003e wf.avatar\n    https://secure.gravatar.com/avatar/ac3399caecce27cb19d381f61124539e.jpg?s=400\n    \u003e\u003e\u003e wf.profile\n    https://konklone.com\n    \u003e\u003e\u003e wf.properties.get('http://schema.org/name')\n    Eric Mill\n\n\nInstallation\n============\n\nAvailable on `PyPI as webfinger \u003chttps://pypi.python.org/pypi/webfinger\u003e`_.\n\n  pip install webfinger\n\n\nfinger\n======\n\nfinger(resource, rel=None)\n    *finger* is a convenience method for instantiating a WebFingerClient object and making the request. The *resource* parameter is a URI of the resource about which you are querying. The optional *rel* parameter can be either a string or a list of strings that will limit the response to the specific relations. WebFinger servers are **not** required to obey the *rel* parameter, so you should handle the response accordingly.\n\n    WebFingerClient supports additional options, so check that out if *finger* does not meet your needs.\n\n\nWebFinger Client\n================\n\nWebFingerClient(timeout=None, official=False)\n    Instantiates a client object. The optional *timeout* parameter specifies the HTTP request timeout. The optional *official* parameter is a boolean that determines if the client will use `unofficial endpoints`_.\n\nfinger(resource, host=None, rel=None, raw=False)\n    The client *finger* method prepares and executes the WebFinger request. *resource* and *rel* are the same as the parameters on the standalone *finger* method. *host* should only be specified if you want to connect to a host other than the host in the resource parameter. Otherwise, this method extracts the host from the *resource* parameter. *raw* is a boolean that determines if the method returns a WebFingerResponse object or the raw JRD response as a dict.\n\n    If the *host* parameter is passed to this method, unofficial endpoints are ignored. You're asking for a specific host so who am I to disagree?\n\n\nWebFinger Response\n==================\n\nThe WebFinger response object provides handy properties for easy access and the raw JRD response. Read the `spec for specifics of the JRD response \u003chttp://tools.ietf.org/html/rfc7033#section-4.4\u003e`_.\n\n\nProperties\n----------\n\nsubject\n  The URI of the thing that the response JRD describes.\n\naliases\n  A list of additional URIs that identify the subject.\n\nproperties\n  A dict of URIs and values that provides information about the subject.\n\nlinks\n  A list of dicts that define external resources for the subject.\n\njrd\n  A dict of the raw JRD response.\n\n\nMethods\n-------\n\nrel(relation, attr='href')\n  A convenience method that provides basic access to links. The *relation* parameter is a URI for the desired link. The *attr* parameter is the key of the returned value of the link that matches *relation*. Returns a string if *relation* and *attr* exist, otherwise *None*.\n\n  ::\n\n    \u003e\u003e\u003e wf.rel('http://webfinger.net/rel/avatar')\n    https://secure.gravatar.com/avatar/ac3399caecce27cb19d381f61124539e.jpg?s=400\n\n  The response JRD may have multiple entries with the same relation URI. The *rel* method will select the first one, since order is meant to imply priority. If you need to see all of the values, you'll have to iterate over the *links* property and pull them out yourself.\n\n  ::\n\n    \u003e\u003e\u003e rel = 'http://webfinger.net/rel/avatar'\n    \u003e\u003e\u003e [l.get('href') for l in rel.links if l.get('rel') == rel]\n\n  If *attr* is None, the full dict for the link will be returned.\n\n\n\nRelation Properties\n-------------------\n\nThe following common link relation types are supported as properties of the response object:\n\n* activity_streams: http://activitystrea.ms/spec/1.0\n* avatar: http://webfinger.net/rel/avatar\n* hcard: http://microformats.org/profile/hcard\n* open_id: http://specs.openid.net/auth/2.0/provider\n* opensocial: http://ns.opensocial.org/2008/opensocial/activitystreams\n* portable_contacts: http://portablecontacts.net/spec/1.0\n* profile: http://webfinger.net/rel/profile-page\n* webfist: http://webfist.org/spec/rel\n* xfn: http://gmpg.org/xfn/11\n\nExample::\n\n    \u003e\u003e\u003e wf.avatar\n    https://secure.gravatar.com/avatar/ac3399caecce27cb19d381f61124539e.jpg?s=400\n\n\n.. _unofficial endpoints:\n\nUnofficial Endpoints\n====================\n\nWhile Facebook and Twitter do not officially support WebFinger, the `webfinger-unofficial project \u003chttps://github.com/snarfed/webfinger-unofficial\u003e`_ provides a proxy for basic subject information. By default, python-webfinger will attempt to use the unofficial endpoints for facebook.com and twitter.com resource domains. This behavior can be disabled by passing *True* to the *official* parameter::\n\n    \u003e\u003e\u003e wf = finger('acct:konklone@twitter.com', official=True)\n\n\nDependencies\n============\n\n* `requests \u003chttps://pypi.python.org/pypi/requests\u003e`_\n\n\nLicense\n=======\n\npython-webfinger is distributed under the `BSD license \u003chttp://creativecommons.org/licenses/BSD/\u003e`_.\n\nSee LICENSE for the full terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcarbaugh%2Fpython-webfinger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcarbaugh%2Fpython-webfinger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcarbaugh%2Fpython-webfinger/lists"}