René's URL Explorer Experiment


Title: How to handle common, non-primitive data types · Issue #70 · labthings/python-labthings · GitHub

Open Graph Title: How to handle common, non-primitive data types · Issue #70 · labthings/python-labthings

X Title: How to handle common, non-primitive data types · Issue #70 · labthings/python-labthings

Description: This is likely going to be an open question for a while, but there are my current thoughts. All input is welcome. I feel like, by and large, data collected from lab instruments can sensibly be converted to primitive data types. The most ...

Open Graph Description: This is likely going to be an open question for a while, but there are my current thoughts. All input is welcome. I feel like, by and large, data collected from lab instruments can sensibly be conv...

X Description: This is likely going to be an open question for a while, but there are my current thoughts. All input is welcome. I feel like, by and large, data collected from lab instruments can sensibly be conv...

Opengraph URL: https://github.com/labthings/python-labthings/issues/70

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to handle common, non-primitive data types","articleBody":"This is likely going to be an open question for a while, but there are my current thoughts. All input is welcome.\r\n\r\nI feel like, by and large, data collected from lab instruments can sensibly be converted to primitive data types. The most common types I have in mind are Numpy arrays, and Pandas data frames. Both of these can be represented easily with primitive data types.\r\n\r\nThere are however cases where data will be collected that cannot be converted to a primitive type.\r\n\r\nIn the new `cbor` branch, I've added a section to the JSON encoder that will base64 encode `bytes` Python objects. I've correspondingly included a Marshmallow `Bytes` field to handle validating binary data in this format. It populates the documentation with information about the string values being a base64 encoded block of binary data. Everything is fine on that front.\r\n\r\nHowever, as @rwb27 has mentioned in the past, sometimes the binary data collected will be big enough that the b64 encoding overhead could become problematic. To handle these cases, I've included support for clients to accept `application/cbor` responses instead of `application/json`.\r\n\r\nCBOR has built in support for binary encoded data, so if a client requests a CBOR response, no encoding overhead is introduced. The data gets passed directly to the CBOR response, otherwise identical to the JSON response, but with the binary section unencoded.\r\n\r\nThis solution isn't perfect though. The Thing Description is required to be JSON. This is fine in most cases as it accurately describes the base64 encoded binary blobs. However, it means that the CBOR response will deviate from the Thing Description, receiving a `bytes` type value where the Description says a `string` will be returned.\r\n\r\nI currently feel however that the cases where large, non-primitive data files are being collected with such high frequency that CBOR encoding is required are infrequent enough that, given proper documentation, this solution could still be fine.\r\n\r\nAgain, thoughts are welcome.\r\n\r\n**Note:** The CBOR branch is useful even aside from this. It's a much more compact data format that JSON, so for many cases it may be beneficial to actually communicate over BSON even without needing to transfer `bytes` objects. It was easy to add support, and doesn't affect the JSON functionality at all.","author":{"url":"https://github.com/jtc42","@type":"Person","name":"jtc42"},"datePublished":"2020-05-02T18:51:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/70/python-labthings/issues/70"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f25bdc0c-2e9a-9bdd-3ed7-4a159647207d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id999E:87397:377169:477DEC:699051BB
html-safe-nonce346a2a9c2271cf8a58cde96bd3c07fcbdc624103c6377cc08fcba661c3cffacb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTlFOjg3Mzk3OjM3NzE2OTo0NzdERUM6Njk5MDUxQkIiLCJ2aXNpdG9yX2lkIjoiMTE0NDQ0NTI5MzkyOTk3NjI1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacdd4e3a4886f7625130fe2ef97271e5d8527149ad7a8f1269c0c44cb1727ba85b
hovercard-subject-tagissue:611251729
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/labthings/python-labthings/70/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d8608622ff6038a684a02300c7ac972d5f883602a6e37b109a9307db49c7c7f3/labthings/python-labthings/issues/70
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d8608622ff6038a684a02300c7ac972d5f883602a6e37b109a9307db49c7c7f3/labthings/python-labthings/issues/70
og:image:altThis is likely going to be an open question for a while, but there are my current thoughts. All input is welcome. I feel like, by and large, data collected from lab instruments can sensibly be conv...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejtc42
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/labthings/python-labthings git https://github.com/labthings/python-labthings.git
octolytics-dimension-user_id58913024
octolytics-dimension-user_loginlabthings
octolytics-dimension-repository_id234552142
octolytics-dimension-repository_nwolabthings/python-labthings
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id234552142
octolytics-dimension-repository_network_root_nwolabthings/python-labthings
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/labthings/python-labthings/issues/70#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Flabthings%2Fpython-labthings%2Fissues%2F70
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Flabthings%2Fpython-labthings%2Fissues%2F70
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=labthings%2Fpython-labthings
Reloadhttps://patch-diff.githubusercontent.com/labthings/python-labthings/issues/70
Reloadhttps://patch-diff.githubusercontent.com/labthings/python-labthings/issues/70
Reloadhttps://patch-diff.githubusercontent.com/labthings/python-labthings/issues/70
labthings https://patch-diff.githubusercontent.com/labthings
python-labthingshttps://patch-diff.githubusercontent.com/labthings/python-labthings
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Flabthings%2Fpython-labthings
Fork 2 https://patch-diff.githubusercontent.com/login?return_to=%2Flabthings%2Fpython-labthings
Star 19 https://patch-diff.githubusercontent.com/login?return_to=%2Flabthings%2Fpython-labthings
Code https://patch-diff.githubusercontent.com/labthings/python-labthings
Issues 14 https://patch-diff.githubusercontent.com/labthings/python-labthings/issues
Pull requests 10 https://patch-diff.githubusercontent.com/labthings/python-labthings/pulls
Actions https://patch-diff.githubusercontent.com/labthings/python-labthings/actions
Projects 0 https://patch-diff.githubusercontent.com/labthings/python-labthings/projects
Security 0 https://patch-diff.githubusercontent.com/labthings/python-labthings/security
Insights https://patch-diff.githubusercontent.com/labthings/python-labthings/pulse
Code https://patch-diff.githubusercontent.com/labthings/python-labthings
Issues https://patch-diff.githubusercontent.com/labthings/python-labthings/issues
Pull requests https://patch-diff.githubusercontent.com/labthings/python-labthings/pulls
Actions https://patch-diff.githubusercontent.com/labthings/python-labthings/actions
Projects https://patch-diff.githubusercontent.com/labthings/python-labthings/projects
Security https://patch-diff.githubusercontent.com/labthings/python-labthings/security
Insights https://patch-diff.githubusercontent.com/labthings/python-labthings/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/labthings/python-labthings/issues/70
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/labthings/python-labthings/issues/70
How to handle common, non-primitive data typeshttps://patch-diff.githubusercontent.com/labthings/python-labthings/issues/70#top
https://patch-diff.githubusercontent.com/rwb27
https://patch-diff.githubusercontent.com/ChasNelson1990
https://patch-diff.githubusercontent.com/jtc42
discussionhttps://github.com/labthings/python-labthings/issues?q=state%3Aopen%20label%3A%22discussion%22
https://github.com/jtc42
https://github.com/jtc42
jtc42https://github.com/jtc42
on May 2, 2020https://github.com/labthings/python-labthings/issues/70#issue-611251729
@rwb27https://github.com/rwb27
ChasNelson1990https://patch-diff.githubusercontent.com/ChasNelson1990
jtc42https://patch-diff.githubusercontent.com/jtc42
rwb27https://patch-diff.githubusercontent.com/rwb27
discussionhttps://github.com/labthings/python-labthings/issues?q=state%3Aopen%20label%3A%22discussion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.