opensea_ingest.py
def start_ingest(start_date, end_date, rate_limiting=2):
    """Ingests NFT transactions (backfilling) from the defined time period.

    Args:
        start_date ([type]): first timestamp when the ingestion should start from
        end_date ([type]): final timestamp when the ingestion should finish at
        rate_limiting (int, optional): Rate limit for the API. Defaults to 2.
    """
    cursor = conn.cursor()
    keep_ingesting = True
    print("Start ingesting data between {} and {}".format(start_date, end_date))
    while keep_ingesting:
        multiple_events = fetch_multiple_events(start_date, end_date, rate_limiting=rate_limiting)
        for one_batch in multiple_events:
            if one_batch != None:
                # check if batch is in the correct time period
                current_batch_time = datetime.fromisoformat(one_batch[-1]['event_time']).replace(tzinfo=timezone.utc)
                if len(one_batch) > 0 and current_batch_time >= start_date:
                    insert_values(cursor, one_batch)
                    print("Data has been backfilled until this time: {}".format(current_batch_time))
                else:
                    keep_ingesting = False
                    break
            else:
                keep_ingesting = False
                break
        end_date = fetch_earliest_date(conn)
    print("All rows have been inserted from the defined time period!")
Ingests NFT transactions (backfilling) from the defined time period.

    Args:
        start_date ([type]): first timestamp when the ingestion should start from
        end_date ([type]): final timestamp when the ingestion should finish at
        rate_limiting (int, optional): Rate limit for the API. Defaults to 2.
    
Ingests NFT transactions (backfilling) from the defined time period.
Ingests NFT transactions ( backfilling ) from the defined time period .
def start_ingest(start_date, end_date, rate_limiting=2):
    cursor = conn.cursor()
    keep_ingesting = True
    print("Start ingesting data between {} and {}".format(start_date, end_date))
    while keep_ingesting:
        multiple_events = fetch_multiple_events(start_date, end_date, rate_limiting=rate_limiting)
        for one_batch in multiple_events:
            if one_batch != None:
                current_batch_time = datetime.fromisoformat(one_batch[-1]['event_time']).replace(tzinfo=timezone.utc)
                if len(one_batch) > 0 and current_batch_time >= start_date:
                    insert_values(cursor, one_batch)
                    print("Data has been backfilled until this time: {}".format(current_batch_time))
                else:
                    keep_ingesting = False
                    break
            else:
                keep_ingesting = False
                break
        end_date = fetch_earliest_date(conn)
    print("All rows have been inserted from the defined time period!")
def start_ingest ( start_date , end_date , rate_limiting = 2 ) : cursor = conn . cursor ( ) keep_ingesting = True print ( "Start ingesting data between {} and {}" . format ( start_date , end_date ) ) while keep_ingesting : multiple_events = fetch_multiple_events ( start_date , end_date , rate_limiting = rate_limiting ) for one_batch in multiple_events : if one_batch != None : current_batch_time = datetime . fromisoformat ( one_batch [ - 1 ] [ 'event_time' ] ) . replace ( tzinfo = timezone . utc ) if len ( one_batch ) > 0 and current_batch_time >= start_date : insert_values ( cursor , one_batch ) print ( "Data has been backfilled until this time: {}" . format ( current_batch_time ) ) else : keep_ingesting = False break else : keep_ingesting = False break end_date = fetch_earliest_date ( conn ) print ( "All rows have been inserted from the defined time period!" )
Ingests NFT transactions (backfilling) from the defined time period.
Ingests NFT transactions ( backfilling ) from the defined time period .
"""Ingests NFT transactions (backfilling) from the defined time period.

    Args:
        start_date ([type]): first timestamp when the ingestion should start from
        end_date ([type]): final timestamp when the ingestion should finish at
        rate_limiting (int, optional): Rate limit for the API. Defaults to 2.
    """ # check if batch is in the correct time period
start_date
first timestamp when the ingestion should start from
first timestamp when the ingestion should start from
end_date
final timestamp when the ingestion should finish at
final timestamp when the ingestion should finish at
rate_limiting
Rate limit for the API. Defaults to 2.
Rate limit for the API . Defaults to 2 .
2