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

[Proposal/Task] Rewrite CSV Import Format #261

Closed
hay-kot opened this issue Feb 5, 2023 · 3 comments · Fixed by #290
Closed

[Proposal/Task] Rewrite CSV Import Format #261

hay-kot opened this issue Feb 5, 2023 · 3 comments · Fixed by #290
Assignees
Labels
proposal Early stage, looking for feedback task
Milestone

Comments

@hay-kot
Copy link
Owner

hay-kot commented Feb 5, 2023

Problem

The current import format is brittle and is not extendable beyond what is concretely supported.

  • All fields must be specified
  • Order matters, mis-ordered fields will cause havoc
  • No way to support custom fields

Proposed Changes

Predefined Column Headers

Instead of relying on ordered imports use a . separated syntax for HomeBox values. So

HB.name would map to the Name field for the item.

This has numerous benefits

  1. Allows users to specify fields outside of Homebox, since we would ignore any field that doesn't match HB.*
  2. Easily supports custom fields with HB.field.<name> which would eliminate the need for another syntax like tags where we use ; separated entries.
  3. Only a required subset of fields would be required, this would simplify a lot of users spreadsheets.
  4. Adding fields without conflict should be very straight forward.

Implementation Notes

  • Fields would be snake cased HB.warrant_expires replaces Warranty Expires
  • HB.field.<name> will split on the second . and take whatever left as the field name so HB.field.Amazon URL would map to Amazon URL

Add Parent Item Support

Add HB.parentItem column that takes a ImportRef to the parent item type. Child items will be linked to parent items.

Note: This will require code changes to sort imports in order of dependencies (i.e. parent items are created first)

Add Support for Nested locations

The HB.location column would now support a / separated syntax allowing for specifying nested locations.

Example:

Storage Unit 117 / Left Shelve / Row 2 / Box A Would create 4 locations

  • Storage Unit 117
  • Left Shelve (Parent = Storage Unit 117)
  • Row 2 (Parent = Left Shelve)
  • Box A (Parent = Row 2)

The item would then use Box A the last location as it's location.

Other Considerations

  • Making these changes would break everyone's import file
  • Exporting into this format should be more straight forward than the existing format
@hay-kot hay-kot added task proposal Early stage, looking for feedback labels Feb 5, 2023
@hay-kot hay-kot added this to the v0.9.0 milestone Feb 5, 2023
@greyduk
Copy link

greyduk commented Feb 6, 2023

I think the plan as described is just about perfect.

You can alleviate the broken import file a bit by providing a csv code snippet of the new formats for the old structure. That way I can just copy and paste it into my old file overwriting the old headers. After that's sorted, I can add in other headers, move columns around, etc

@wazabees
Copy link

I've read through the proposal and I think it looks great. Because I have So. Much. Stuff. to add into HomeBox, I haven't gotten started yet because I haven't felt the current format has the robustness it needs.

@hay-kot hay-kot self-assigned this Feb 15, 2023
@calrock27
Copy link

I started building my home inventory in the previous import format - by the time I actually got to a point where it could be uploaded, you overhauled it!

The new import schema is MUCH better. Thank you for such an awesome project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Early stage, looking for feedback task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants