Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFR-2306: Integrating with Airtable to get backlist records #449

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions processes/util/airtable_integration.py

This file was deleted.

34 changes: 34 additions & 0 deletions services/sources/publisher_backlist_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from datetime import datetime, timedelta, timezone
import os
import requests
from typing import Optional

from logger import create_log
from mappings.record_mapping import RecordMapping
from .source_service import SourceService


logger = create_log(__name__)


class PublisherBacklistService(SourceService):
def __init__(self):
self.airtable_auth_token = os.environ.get('AIRTABLE_KEY', None)

pass

def get_records(
self,
full_import: bool=False,
start_timestamp: datetime=None,
offset: Optional[int]=None,
limit: Optional[int]=None
) -> list[RecordMapping]:
pass

def get_publisher_backlist_records(self):
headers = {"Authorization": f"Bearer {self.airtable_auth_token}"}

response = requests.get('https://api.airtable.com/v0/appBoLf4lMofecGPU/Publisher%20Backlists%20%26%20Collections%20%F0%9F%93%96?view=UofMichigan%20Press&maxRecords=3', headers=headers)

return response.json()
Loading