Installation
Prerequisites
Before installing Eternity, ensure you have the following:
- Python 3.6+: Eternity is compatible with modern Python 3 environments.
- Google Custom Search API Credentials: To use the library's data retrieval features, you will need:
- An API Key from the Google Cloud Console.
- A Programmable Search Engine ID (CX) from the Google Programmable Search Engine portal.
Installing via pip
The easiest way to install Eternity is directly from PyPI using pip:
pip install Eternity
This will automatically install the required dependencies, such as the requests library.
Installing from Source
If you wish to use the latest development version or contribute to the project, you can install the library from the source code.
-
Clone the repository:
git clone https://github.com/UditAkhourii/Eternity.git cd Eternity -
Install the package:
pip install .
Verifying the Installation
To verify that Eternity has been installed correctly, you can run a simple check in your Python shell:
import eternity
print(eternity.__version__) # If versioning is implemented
Basic Configuration Test
You can verify your installation and API credentials by initializing the Eternity client:
from eternity.eternity import Eternity
# Initialize with your Google credentials
client = Eternity(api_key="YOUR_GOOGLE_API_KEY", engine_id="YOUR_ENGINE_ID")
# Perform a test search
results = client.search("Python programming")
print(f"Successfully retrieved {len(results)} results.")
Dependencies
Eternity relies on the following third-party package:
requests: Used for handling HTTP communications with the Google Custom Search API.
This dependency is managed automatically during the pip installation process.