Skip to content

Commit

Permalink
[FEATURE] Creating, Submitting, and Handling IPUMS Data Extracts (#16)
Browse files Browse the repository at this point in the history
* Ah, but you have heard of me

* Fully get all details of a given dataset

* An act of larceny

* Cleaned up script and removed export

* Added exports, comments, and Downloads

* Added Downloads dependency

* Prototype download function

* Added test extract request file

* Renamed some functions and updated references

* Updated name of API object for future and created extract info method

* Renamed documentation file

* Renamed some exports and files

* Documentation added to download function

* Added convenience wrapper around IPUMS

* Finished creation of extract download capacity

* Updated documentation and warnings

* Added example

* Add description for pirated method

* Add naive implementation and documentation

* Added documentation and implementation for extract_submit

* Added note on piracy method
  • Loading branch information
TheCedarPrince authored May 2, 2024
1 parent 67c8286 commit 268acea
Show file tree
Hide file tree
Showing 16 changed files with 1,033 additions and 539 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.0.1"
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/DataExtract.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**extractDefinition** | [***DataExtractExtractDefinition**](DataExtractExtractDefinition.md) | | [optional] [default to nothing]
**extractDefinition** | [***DataExtractDefinition**](DataExtractDefinition.md) | | [optional] [default to nothing]
**number** | **Int64** | | [optional] [default to nothing]
**status** | **String** | | [optional] [default to nothing]
**downloadLinks** | [***DataExtractDownloadLinks**](DataExtractDownloadLinks.md) | | [optional] [default to nothing]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/DataExtractExtractDefinition.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DataExtractExtractDefinition
# DataExtractDefinition


## Properties
Expand Down
2 changes: 1 addition & 1 deletion docs/src/DataExtractPostResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**extractDefinition** | [***DataExtractExtractDefinition**](DataExtractExtractDefinition.md) | | [optional] [default to nothing]
**extractDefinition** | [***DataExtractDefinition**](DataExtractDefinition.md) | | [optional] [default to nothing]
**number** | **Int64** | | [optional] [default to nothing]
**status** | **String** | | [optional] [default to nothing]
**downloadLinks** | [***DataExtractDownloadLinks**](DataExtractDownloadLinks.md) | | [optional] [default to nothing]
Expand Down
92 changes: 46 additions & 46 deletions docs/src/DefaultApi.md → docs/src/IPUMSAPI.md

Large diffs are not rendered by default.

57 changes: 28 additions & 29 deletions src/IPUMS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,61 @@ module IPUMS

import Base:
@kwdef
import Downloads:
download as dl
import OpenAPI.Clients:
Client

using DataFrames
using Dates
using HTTP
using JSON3
using OpenAPI
using OpenAPI.Clients
import OpenAPI:
Client
using TimeZones
using URIs
using EzXML

#=
Scripts used across whole of package
=#

include("structs.jl")
include("constants.jl")
include("helpers.jl")

#=
This information was generated by the OpenAPI documentation and
This information was auto-generated by the OpenAPI spec and
subsequently better incorporated into the whole of the package
=#

const API_VERSION = "v2"

include("modelincludes.jl")
include("apis/api_DefaultApi.jl")
include("apis/api_IPUMSAPI.jl")
include("piracy.jl")


include("extracts.jl")

#=
Parsers
=#

include("parsers/ddi_parser.jl")

#=
export from_json
export DataExtract
export DataExtractDownloadLinks
export DataExtractExtractDefinition
export DataExtractPost
export DataExtractPostResponse
export DataTableFull
export DataTableFullVariablesInner
export DataTableSimple
export Dataset
export DatasetFull
export DatasetFullBreakdowns
export DatasetFullBreakdownsBreakdownValuesInner
export DatasetFullGeogLevelsInner
export DatasetSimple
export Error
export Shapefile
export TimeSeriesTable
export TimeSeriesTableFull
export TimeSeriesTableFullTimeSeriesInner
export TimeSeriesTableSimple
=#
Exports
=#

export Client
export DefaultApi
export IPUMSAPI
export parse_ddi
export extract_download
end
Loading

0 comments on commit 268acea

Please sign in to comment.