cenpy-devs / cenpy

Explore and download data from Census APIs
Other
183 stars 44 forks source link

explore making api years possible #59

Open dfolch opened 5 years ago

dfolch commented 5 years ago

I'm liking the new API. For ACS, the new model is products.ACS(year).

ljwolf commented 5 years ago

I'm liking the new API.

thanks!

What about doing this for decennial too: products.Decennial(year)? I'm currently working with 2000 decennial data and 2020 is just around the corner. On a possibly related note: it seems that 2000 geography is not in the Census' API.

I didn't do 2000 because tigerweb doesn't do 2000, like you note. The product API relies on the TIGERweb stuff to build lists of IDs to query for in the main census API. I can look at that in the future, and would totally welcome a solution here based on local computation, or an API endpoint for the 2000 census in TIGERweb (paging @loganpowell :smile:)

How does the new ACS model handle 1 yr vs 3 yr vs 5 yr estimates?

Briefly, it doesn't, but I made sure that it can be extended. If you want to try, add a span=5 keyword to the __init__, and use that instead of the 5 in line 345 (like, APIConnection('ACSDT{}Y{}'.format(span, year)')), I'll merge that if it works. I bet it will.

loganpowell commented 5 years ago

Hi folks,

I'm not directly connected to the Tigerweb team, but you can put in a request by sending this in an email to: geo.geography@census.gov

L

ljwolf commented 5 years ago

Looking into this cenpy.explorer.available()most of the APIs exposed are 1 year and 5 year... seeing only one ACSSF3Y and no ACSDT3Y. I'm building the new cenpy API off of the ACSDT products, so I'll only be able to support 1 & 5 year estimates.

ljwolf commented 5 years ago

There are some pretty significant corner cases using this because of the missing data due to population sizes. You can routinely have queries fail because they exist as geographic areas, but don't have any data in the census's data API. I think it might be best to just document really thoroughly how the 1-years can be gotten from the older API, especially since they're not really going to have issues with the geo-in-geo stuff

MaxGhenis commented 4 years ago

Could you share how to get 1-year ACS estimates? I'm assuming from this that it's 5-year by default:

https://github.com/cenpy-devs/cenpy/blob/7aaf4b15917b7e9c343c0905e3ec0250f270d66d/cenpy/products.py#L673-L674

Though printing the ACS object makes it a bit confusing...

acs = cenpy.products.ACS(2018)
acs

Connection to American Community Survey: 1-Year Estimates: Detailed Tables 5-Year(ID: https://api.census.gov/data/id/ACSDT5Y2018) With MapServer: Census Current (2018) WMS