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 iterator/generator #35

Open
gzt5142 opened this issue Apr 20, 2023 · 2 comments
Open

Feature iterator/generator #35

gzt5142 opened this issue Apr 20, 2023 · 2 comments

Comments

@gzt5142
Copy link
Owner

gzt5142 commented Apr 20, 2023

The CrawlerSource object holds information and methods about sources.
Right now, we have a separate function which takes that source to generate a collection of features (via ijson and a download function). Because that code will never be used without access to a specific feature, I believe it would be better to turn it into a method on the CrawlerSource object.

sources = src.SQLRepo(db_uri)   # ...or CSVRepo() ...or JSONrepo()
source = sources.get(source_id=13)
for f in source.get_features():
   # yada, yada, yada
@gzt5142
Copy link
Owner Author

gzt5142 commented Apr 20, 2023

The main question here is whether to download the entire JSON data from the source, then parse the local file, or whether it is safe to create Feature instances from the network stream directly.

@dblodgett-usgs
Copy link

As long as it is happening in a temp table, streaming would be preferable?

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