https://github.com/saherpathan/citation_project
Fetching data from a paginated API endpoint
https://github.com/saherpathan/citation_project
aiohttp api-endpoints data-fetching flask-application python
Last synced: about 2 months ago
JSON representation
Fetching data from a paginated API endpoint
- Host: GitHub
- URL: https://github.com/saherpathan/citation_project
- Owner: Saherpathan
- License: mit
- Created: 2024-05-21T19:59:07.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-16T18:51:18.000Z (9 months ago)
- Last Synced: 2025-01-20T04:35:34.609Z (3 months ago)
- Topics: aiohttp, api-endpoints, data-fetching, flask-application, python
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Citation Project
## Description
A Python script fetches data from a paginated API endpoint provided by BeyondChats. It identifies sources for each response and returns the citations as a JSON array. Additionally, there is an optional Flask app provided for a user-friendly interface to access the citations.## Setup
1. **Clone the Repository:**
```bash
git clone https://github.com/Saherpathan/Citation_project.git
cd Citation_project
```2. **Install Dependencies:**
```bash
pip install -r requirements.txt
```## Usage
### Running the Script
To run the script and fetch citations from the API, execute the following command:
```bash
python main.py
```The citations will be printed to the console.
### Running the Flask App
1. Ensure Flask is installed:
```bash
pip install Flask
```2. Run the Flask app:
```bash
python app.py
```3. Access the endpoint:
Open your browser and navigate to [http://127.0.0.1:5000/citations](http://127.0.0.1:5000/citations) to view the citations in a user-friendly interface.## Project Structure
- `main.py`: The main Python script for fetching data and processing citations.
- `app.py`: Flask application script for providing a user interface.
- `requirements.txt`: Contains a list of Python dependencies.
- `README.md`: This file providing information about the project.## API Endpoints
`/citations`: Returns citations for all objects retrieved from the API.
## License
[MIT License](LICENSE)
## Contributor
SAHER PATHAN