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.20251202.tar.gz (20.0 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.20251202-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for petnames-0.2.20251202.tar.gz
Algorithm Hash digest
SHA256 19e42a588ff6ca4a1aca99aa0c5e67d00326503314d7caf64aee2dccc177c4f1
MD5 275c97629b1ecc7e03948c3526c11060
BLAKE2b-256 903ef3153f5a2d2f9b6e86d0a6eca8c3273a53263e502d0020ddf0d65e097f5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for petnames-0.2.20251202-py3-none-any.whl
Algorithm Hash digest
SHA256 05092a09920bcd956d509906a94852689803cf7e57ab2b5a0689d200005739ca
MD5 4b789ddfdd71463e90fde3551dba54d8
BLAKE2b-256 0b1ff94368f404d9cb18768b37be8b9df41f64028bb44cd6e87f65a904376549

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