Skip to content

Should we convert uploaded file metadata into Python types? #2727

Closed
@pbugnion

Description

@pbugnion

Following PRs #2724 and #2666 , the FileUpload.value traitlet looks like:

[{'name': 'example.csv',
  'type': 'text/csv',
  'size': 2548,
  'lastModified': 1536574751152,
  'content': <memory at 0x11d51ab88>}]

It is defined as List(Dict()).

We could consider the following, in increasing order of complexity:

  1. change lastModified to be a datetime object. We should check browser compatibility on whether it's always expressed as a timestamp.
  2. define a namedtuple or a Python class that exposes the attributes, rather than a dict. This would make the attributes more discoverable.

notifying @jtpio , @jasongrout who have been working on this.

Metadata

Metadata

Assignees

Labels

backwards-incompatibleresolved-lockedClosed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions