I have a script which uses the pyfpds wrapper (https://github.com/18F/pyfpds) to extract contract data from the FPDS Atom Feed (www.fpds.gov).

Following is the code I have and this used to work till last week. Presently, this doesn't work if I have a date field filter in the get() method.

from pyfpds import Contracts
from datetime import datetime, timedelta

def main():
    c = Contracts()
    print("\nSearching in PIID: "+piid)
    yesterday = datetime.strftime(datetime.now() - timedelta(2), '%Y-%m-%d')
    records = c.get(agency_name="SECURITIES AND EXCHANGE COMMISSION",last_modified_date=yesterday)
# end of main()
if __name__ == '__main__':

The code works without any issues if I remove the date field filter from the get() method.

I also tried with other date fields such as signed_date and created_on, and it doesn't make any difference.

Is there any specific change in FPDS Atom Feed which prevents the date filters in the requests?


I was actually using the wrong format for date. It should be something like this:

records = c.get(agency_name=o['name'], last_modified_date="["+str(next_date)+","+str(next_date)+"]")


records = c.get(agency_name=o['name'], last_modified_date="[2018/12/17,2018/12/21]")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.