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

[FEATURE] Creating, Submitting, and Handling IPUMS Data Extracts #16

Merged
merged 22 commits into from
May 2, 2024

Conversation

TheCedarPrince
Copy link
Member

@TheCedarPrince TheCedarPrince commented Apr 18, 2024

This PR introduces the following features through a variety of modifications and new functionalities added:

  • Submit an extract request
  • Download an extract
  • Find out information about an extract
  • Convenience wrapper for creating an API object (done out of crankiness)

It encompasses documentation, tests, and these features.

@TheCedarPrince TheCedarPrince added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 18, 2024
@TheCedarPrince TheCedarPrince marked this pull request as ready for review April 28, 2024 03:50
@TheCedarPrince
Copy link
Member Author

Hey @00krishna , the good news is is that this branch is ready for review! There are a lot of changes I introduced mostly with regards to documentation and the API for extracts, but the new and improved API is this to submit and work with extracts:

using IPUMS

api = IPUMSAPI("https://api.ipums.org/", Dict("Authorization" => "Your_Key"))

test_extract_definition = "test/testdata/example_extract_request.json"

res = extract_submit(api, "nhgis", test_extract_definition)

metadata, defn, msg = extract_info(api, res.number, "nhgis")

extract_list(api, "nhgis", "2")

Let me know what you think and how it works for you!

The big question here is I don't know how best to test these features. Do you have any ideas/suggestions?

@00krishna
Copy link
Collaborator

Hey Jacob. I looked over the code and it look good. I just made a few small comments about content, but nothing major.

The api looks good. I suppose as we practice with it, we can always polish it.

In terms of testing, that is a good question. I think the download functionality itself is tested by the OpenAPI.jl package folks. You could try and save a local file to the test directory, and then try to download locally? That is one way to do it. Meaning you really only need to test everything after the download.

@TheCedarPrince TheCedarPrince merged commit 268acea into main May 2, 2024
3 of 4 checks passed
@TheCedarPrince TheCedarPrince deleted the tcp-extracts branch May 2, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants