5 ms·
Ask HN: What would you call a package whose purpose is to import data?
Let's assume you're writing Go, Python, or any other language in which `import` is a reserved keyword. Let's assume also that you're writing a new package, whose purpose is to "import" data.
What do you name this package?
Our team went through this exercise semi-recently, and we're curious about how everyone else would think about it. Here's a (non-exhaustive) list of options we considered: imports, ingest, dataimport, ímport, impørt.
- btilly 9mo agoI like semantically different words for unrelated things. So I'd stay away from import. I've called this kind of thing load, initialize, get_all, and so on. I may also call it something based on where the data is stored if that is important. For example from_csv. I might also name it based on what it is for. For example load_config. Whatever seems clearest, and fits best with how the project itself does things.
- andsoitis 9mo ago> imports, ingest, dataimport, ímport, impørt. a few good principles (not rules) for naming libraries: a) signal abstraction level b) avoid being too literal for it constrains evolution c) pronounceable and spellable d) prefer nouns over verbs because libraries are things not actions e) metaphors beat descriptions Consequently, I would avoid imports, ímport, impørt "Ingest" feels like it is in a good direction. Any good reason not to use it?
- ctc24 9mo agoAgreed, I like `ingest` as well. It does somewhat violate principle d), but the other solutions violate more of those. And to your point, they're principles, not rules.
- scaredreally 9mo agoHow about `importer`?
- starcharstar 9mo ago[dead]
- al_borland 9mo agoThe misspellings of import sound like they’d be a nightmare. Something like ingest sounds much better. To come up with other names I’d probably think about additional context. What is being imported, how is it being done? Can those concepts be spun into a name?
- ctc24 9mo agoI'm with you on the misspellings. This is why we ultimately ruled out any of those options.
- zahlman 9mo agoWhat does "importing data" exactly mean in your context? What is special about this data that your package can do something useful that's specific to the data? What is special about the importing task that your users wouldn't rather just `with open(filename) as f:`? Not rhetorical questions. You presumably have real reasons to create the package; meditating on them will bring you closer to an understanding. The reason that naming things is one of the "hard CS problems" is that it requires actually paying attention to your own work and a solution can't be looked up elsewhere.
- tacostakohashi 9mo agoSounds a bit like ETL - extract, transform and load.
- nrhrjrjrjtntbt 9mo agoimporter importers advantage: still single words correctly spelt. describes the library instead of abstractly the topic of the library
- horladoyin 9mo agoImporter seems like a good one.
- gethly 9mo agoLoad and related expressions would be appropriate. Import implies the data is being put into the code, just like the plugins/modules.
- moomoo11 9mo agodataloader dataloader.loadAll dataloader.open dataloader.import