![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Python module which loads and saves data structures based on the file extension.
pip install loadsave
import loadsave
data = loadsave.load(filename)
... manipulating data ...
loadsave.save(data, filename)
Saving data can be a bit unintuitive.
csv
requires data to be a list of dictionarieswav
requires data to be a tuple or list of the form (y,sr)
exactly how it would be returned by load('example.wav')
This module attempts to follow a generic procedure for reading and writing common data storage formats using only the file extension for guidance.
The motivation here is as follows; Most of the time, the most generic approach to opening a file will work. It's may not be the most computationaly efficient way, but if loading time is not a bottleneck for your workflow, you might as well spend your time manipulating the data as opposed figuring out how to load it into python. The goal of Datastore is to make implementing these generic approaches as fast as possible. If it doesn't work, well at least you didn't waste much time. Otherwise, you just skipped a monotonous task and can get on with real work.
import loadsave
d = [{'id': [1,2,3,4],'otherID':[4,3,2,1]}]
# save this dict as a pickle
loadsave.save(d, 'test.pkl')
'test.pkl'
can be replaced with 'test.json'
, or 'test.csv'
. Attempting to save it to 'test.wav'
will return an error, because d
is not an acceptable format for an audio waveform.
However, if d = [0,1,2,3,4]
you could call loadsave.save((d,44100),'test.wav')
. csv
s require a list of dictionaries, so trying to save this as a csv will fail
loadsave.load('example.wav')
dict
, list
, str
, int
, float
, bool
, and None
FAQs
One-line loading and saving to/from various file formats (csv, wav, pkl, json)
We found that loadsave demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.