Skip to main content

PetName and Distributed Directory Name resolver

Project description

PetName and Distributed Directory Name resolver

petnames resolves names to machine addresses (or any other value humans find difficult to remember).

Resolution starts from the local database on your device, which can contain references to any Distributed Directory service.

For a name like : servers.work.server1

  • servers is resolved locally to a collection

  • work is found in the local collection, pointing to a remote directory

  • server1 is submitted as a query to that directory

  • The directory returns a PetName record, containing: addr = abcd..eeff

  • Your application can initiate a connection to that address.

The local database contains entries which can point directly to resources (e.g. on P2P networks) or to other directories e.g. a community-run directory, commercial directory, government directory, etc.

BETA SOFTWARE!

This is still a work-in-progress. Currently only the local-directory resolving is implemented, but this is already useful to save having to copy-paste X25519 Ids, Bitcoin addresses, etc.

Try it:

  • Install the package with pip install petnames
  • Create a file ~/.local/share/petnames/local/server1.txt containing lines like these:
suggested_name=Server One
addr = aabbccddeeffaabbccddeeffaabbccdd
  • Run ddig server1 which should display the properties you created

Command-line usage:

ddig NAME [PROPERTY]

NAME is a sequence of names joined by periods

PROPERTY is the record property you want to retrieve (default: 'all')

Application integration:

from petnames import get_property

addr1 = get_property(arg1, "b_addr")
if addr1:
    connect(addr1)

Further information

See the examples at : https://codeberg.org/skyguy/petnames

Feedback welcome!

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

petnames-0.2.20251201.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

petnames-0.2.20251201-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file petnames-0.2.20251201.tar.gz.

File metadata

  • Download URL: petnames-0.2.20251201.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for petnames-0.2.20251201.tar.gz
Algorithm Hash digest
SHA256 53ad2bc25150879f54fd9126cdb521772218f8ff60abae7d25fd21ebd2e3e9f2
MD5 9ac22c447b3e3d8fcb20b5ab21bcba2f
BLAKE2b-256 e482c9c8f2844e7d2cb927c18ebdacffee67cbe2185b4fa93860e1780396d8b1

See more details on using hashes here.

File details

Details for the file petnames-0.2.20251201-py3-none-any.whl.

File metadata

File hashes

Hashes for petnames-0.2.20251201-py3-none-any.whl
Algorithm Hash digest
SHA256 bfe695f8743df632192d09b1c8aa08f9ce9d6d530a9ca6e0211c15ade957ac6c
MD5 7f0e99cf175db7effcf71cc75864d3e8
BLAKE2b-256 0def0e4c770c15a6e7416d573670b2a053e89d8597badab3bac870fc3fed7862

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