pyrefdev 2025.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pyrefdev/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """pyref.dev is a fast, convenient way to access Python reference docs."""
pyrefdev/__main__.py ADDED
@@ -0,0 +1,27 @@
1
+ import argparse
2
+ import webbrowser
3
+ import sys
4
+
5
+ from pyrefdev.mapping import MAPPING
6
+
7
+
8
+ def main():
9
+ parser = argparse.ArgumentParser(
10
+ prog="pyrefdev",
11
+ description="pyref.dev is a fast, convenient way to access Python reference docs.",
12
+ )
13
+ parser.add_argument("symbol")
14
+ ns = parser.parse_args()
15
+
16
+ symbol = ns.symbol
17
+ if not (url := MAPPING.get(symbol)):
18
+ url = MAPPING.get(symbol.lower())
19
+ if url:
20
+ webbrowser.open_new_tab(url)
21
+ else:
22
+ print(f"{symbol} not found", file=sys.stderr)
23
+ sys.exit(1)
24
+
25
+
26
+ if __name__ == "__main__":
27
+ main()