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

Script to download candidate finance data information #2

Open
tommy-stone opened this issue Oct 23, 2019 · 8 comments
Open

Script to download candidate finance data information #2

tommy-stone opened this issue Oct 23, 2019 · 8 comments
Assignees

Comments

@tommy-stone
Copy link

tommy-stone commented Oct 23, 2019

  1. Go to https://public.netfile.com/pub2/?aid=CSD
  2. Select 2020 from the date
  3. Click export all
  4. Download file to downloads/raw/efile_SD_CSD_2020.zip
  5. Extract the file, rename it and move it to downloads/static/efile_SD_CSD_2020.xlsx
  • There is no API, we will have to use some sort of software like selenium to run through this process
@tommy-stone tommy-stone self-assigned this Dec 11, 2019
@nancyheiss
Copy link

I will take this one.

@tommy-stone
Copy link
Author

@nancyheiss I updated the description for 2020. The 2019 information will be static so we don't need to download this file, only the 2020 file. Currently there is no information in the file but this should change at the end of the month. Netfile also updated it so that the file is downloaded as a zip file. I added some more steps in the comments to download the zip and expand etc. etc.

@nancyheiss
Copy link

@tommy-stone looks like I need permissions to the repo? I tried to push my branch (cloned with [email protected]:opensandiego/disclosure-backend-static.git) but got this error:
ERROR: Permission to opensandiego/disclosure-backend-static.git denied to nancyheiss.
fatal: Could not read from remote repository.

@tommy-stone
Copy link
Author

@nancyheiss Should be good now. Give it another try

@tommy-stone
Copy link
Author

Additional steps for the download portion

  1. After the download is complete, check that the file exists (efile_CSD_2020.zip)
    a. if the file doesn't exist, create an error in the error log with the timestamp ERROR
  2. Extract the file from the zip
  3. Perform verification steps that the new file (in ~/downloads/efile_CSD_2020.xlsx) is the same size or bigger than downloads/static/efile_SD_CSD_2020.xlsx
  4. If the verification passes, create a entry in the error log with timestamp SUCCESS
  5. Delete the efile_SD_CSD_2020.xlsx in /downloads/static/ and rename/move the efile_CSD_2020.xlsx to downloads/static/efile_SD_CSD_2020.xlsx

1 similar comment
@tommy-stone
Copy link
Author

Additional steps for the download portion

  1. After the download is complete, check that the file exists (efile_CSD_2020.zip)
    a. if the file doesn't exist, create an error in the error log with the timestamp ERROR
  2. Extract the file from the zip
  3. Perform verification steps that the new file (in ~/downloads/efile_CSD_2020.xlsx) is the same size or bigger than downloads/static/efile_SD_CSD_2020.xlsx
  4. If the verification passes, create a entry in the error log with timestamp SUCCESS
  5. Delete the efile_SD_CSD_2020.xlsx in /downloads/static/ and rename/move the efile_CSD_2020.xlsx to downloads/static/efile_SD_CSD_2020.xlsx

@nancyheiss
Copy link

@tommy-stone for some reason your name was not showing up in the list of potential reviewers for me to select from in this PR: caciviclab#207
Can you please try running the shell script and let me know what issues you run into?

@nancyheiss
Copy link

@tommy-stone I didn't realize my PR was going to caciviclab instead of opensandiego. I made a new commit, but when I try to create a pull request it keeps going to caciviclab. I'm not sure how to fix that.
Here is my branch: https://github.com/opensandiego/disclosure-backend-static/tree/downloadCandidateFinanceInfo

@tommy-stone tommy-stone removed their assignment Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants