A Pronouns over DNS specification compliant Python API.
If you want to fetch someones pronouns from their domain, see the below:
Note that we support both synchronous and asynchronous lookups.
import asyncio
import podns.dns
async def main() -> None:
domain = "abigail.sh"
podns.dns.fetch_pronouns_from_domain_sync(domain)
await podns.dns.fetch_pronouns_from_domain_async(domain)
if __name__ == "__main__":
asyncio.run(main())If you already have fetched the users pronouns, or are just parsing a raw literal:
import podns.parser
podns.parser.parse_pronoun_records([
"she/her",
"they/them/theirs;preferred"
])For all user-level APIs (that is, podns.dns.fetch_pronouns_from_domain_* and podns.parser.parse_pronoun_records), there is an optional kwarg, pedantic, that defaults to False.
- Setting this to
Truewill raise errors on all specification-violating parse errors from the provided records. - Setting this to
Falsewill only raise errors on egregious specification violations that make parsing impossible. When set toFalse, podns will do its' best to infer intent when met with trivial violations, it will however never return apodns.pronouns.PronounsResponsethat violates the specification.
Note
there was exactly zero usage of generative ai involved during the development of this package, including autocomplete.