sfcparse
The easy to use library for your data, configuration, and save files
Simple File Configuration Parse == sfcparse
sfcparse makes data serialization even simpler and has feature-rich content to easily create custom stored data using the familiar python types you already work with and know!
Import or Export custom, or industry-common, data, config, and save files easily for your python program or script.
Use python data types for your data (literally use python data types as stored values importing them securely using any text file created.
Supports json, yaml, ini, xml using the common & native libraries with the idea of simpler abstraction.
Use built-in features for locking your data, referencing data, importing stored values back into your class object, easily formatting large data sets, and other quick and easy tools like getting/comparing the hash of a file.
Project Goal
To provide a simple and easy experience in importing/exporting data, config, and save files!
Have the freedom to import your own custom (config, data, save) plain text file with any file extension using python's native data types for your projects. The data type you see in your file will be read the same in python!
Give convenient and simpler support for other serialization libraries as well!
Can't I just import .py files or use pickle you might ask?
This library maintains a different secure approach with techniques to ensure importing python data is not susceptible to code execution like what you would expect when you import a py or pickle file (as by design, and not to detract from their native power!) to just access variables or attributes and their values. Python's documentation also states that pickle is insecure for that reason as well, but there are methods to make pickle secure for that purpose. It is more widely accepted to use common data serialization formats designed for storing values if wanting to just import your values or data back whether you use sfcparse or not, but sfcparse does just that as well using python's native types to make your life easier with secure mechanics. Some of the techniques include only allowing the import of primitive data types, name duplication protection so all name references in a file need to be unique, and name reference locking to protect against re-assignment (essentially creating immutability on any immutable primitive type like a "str"), and more.
Oh, and you can pickle sfcparse objects if you wanted to as well.
Install
Source Code
PyPI
Last updated