The wikipedia_search project provides a Python script for searching Wikipedia articles and generating URLs for the search results. It includes error handling for cases where no search results are found or the search process fails.
- Clone this repository to your local machine.
- Ensure you have Python 3.12 installed.
To use the wikipedia_search script, follow these steps:
- Import the
wikipedia_searchfunction from the script. - Call the function with your search query and an optional language parameter.
- The wikipedia_search function will return a dictionary containing Wikipedia article titles as keys and their corresponding URLs as values.
Here's an example of how to use the wikipedia_search script:
from wikipedia_search import wikipedia_search
query = "Python (programming language)"
language = "en"
results = wikipedia_search(query, language)
print(results)We have included a set of tests in the tests folder. To run these tests using pytest, follow these steps:
- Make sure you have pytest installed. If not, you can install it using pip:
pip install pytest- Navigate to the project's root directory in your terminal.
- Run the following command to execute the tests:
pytest .\tests\tests_wikipedia_search.pyThis will run the test suite and provide feedback on the functionaltox ity and correctness of the wikipedia_search script.
pytest --cov-report term-missing --cov=wikipedia_searchWe welcome contributions from the open-source community. If you'd like to contribute to this project, please follow our Contribution Guidelines:
To contribute, follow these steps:
- Fork this repository.
- Create a new folder with the name of your module.
- Inside this folder, include your Python helper module with appropriate documentation including README.md file.
- Create a Pull Request with a clear description of your contribution.
- The folder name must be the same as the script name inside the folder. (
lower letter, with_separation instead of space.) - there should be only a single script, you can include code for the standalone script in the
if __name__ = "__main__":block. - The folder must contain
README.mdfile and arequirements.txtfile if needed. Referextract_images_from_pdfin the repo, for a better understanding!! :)
Remember, no contribution is too small! Every line of code makes a difference. Let's build something amazing together! Happy coding!!
Description: Briefly describe what this module does.
Usage:
# Example code demonstrating how to use the module
# Import the module
import module_name
# Call a function from the module
module_name.function_name(argument)This project is licensed under the MIT License.