Python: Find the Requests module version, licence, copyright information, author, author email, document url, title and description
1. Requests Module Metadata
Write a Python program to find the Requests module – version, licence, copyright information, author, author email, document url, title and description.
Sample Solution:
Python Code:
import requests
print("Python Requests module - version:",requests.__version__)
print("Licence:",requests. __license__)
print("Copyright:",requests.__copyright__)
print("Author:",requests.__author__)
print("Author email:",requests.__author_email__)
print("Document url, title, description:")
print(requests.__url__)
print(requests.__title__)
print(requests.__description__)
Sample Output:
Python Requests module - version: 2.22.0 Licence: Apache 2.0 Copyright: Copyright 2019 Kenneth Reitz Author: Kenneth Reitz Author email: [email protected] Document url, title, description: http://python-requests.org requests Python HTTP for Humans.
For more Practice: Solve these Related Problems:
- Write a Python program to import the Requests module and print its version, license, and copyright information using its __version__ and other attributes.
- Write a Python script that retrieves and prints the author, author email, document URL, title, and description of the Requests module by accessing its metadata attributes.
- Write a Python function that checks if the Requests module contains specific metadata attributes (like __license__ and __doc__), and prints them in a formatted summary.
- Write a Python program to compare the metadata (version, license, etc.) of the Requests module with another HTTP library and display the differences.
Go to:
Previous: Python Requests Exercise Home.
Next: Write a Python code to check the status code issued by a server in response to a client's request made to the server. Print all of the methods and attributes available to objects on successful request.
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.