A Python library for reading and writing .spc files
Project description
Lucy SPC
Lucy SPC is a Python library ( name inspired by the character Lucy Pevensie from the Narnia movie series ) provides functionalities to read and write .spc (Special Configuration) files, allowing easy conversion to and from JSON format.
Installation
You can install Lucy SPC via pip:
pip install lucy-spc
Usage
Reading .spc Files
import lucy_spc as cf
# Initialize Config object with the path to the .spc file
spc = cf.Config("example.spc")
# Read the .spc file and convert it to JSON format
json_data = spc.readLucy()
# Print the JSON data
print(json_data)
Modifying JSON Data
# Modify the JSON data as needed
spc.jsonData["aws2"]["secret_key"] = "new_secret_key"
# Write the modified JSON data back to the .spc file
spc.writeLucy()
Writing .spc Files
# Create a new JSON object with the desired configuration
new_config = {
"connection1": {
"plugin": "aws",
"secret_key": "my_secret_key",
"access_key": "my_access_key",
"regions": ["us-east-1", "us-west-2"]
},
"connection2": {
"plugin": "gcp",
"secret_key": "another_secret_key",
"access_key": "another_access_key",
"regions": ["us-central1", "us-west1"]
}
}
# Initialize Config object with a new .spc file path
new_spc = cf.Config("new_config.spc")
# Assign the new JSON data
new_spc.jsonData = new_config
# Write the JSON data to a new .spc file
new_spc.writeLucy()
Contributing
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License.
Acknowledgements
- This library was inspired by the character Lucy Pevensie from the Narnia movie series.
- Special thanks to myself.
Change Log
0.0.1 (12/03/2024)
- Initial version. basic read and write functionality.
0.0.2 (12/03/2024)
- Modified readme description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lucy-spc-0.0.2.tar.gz
(3.7 kB
view details)
File details
Details for the file lucy-spc-0.0.2.tar.gz
.
File metadata
- Download URL: lucy-spc-0.0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d75bd96269a8a97cc01b1d1952e3b197d4993ed63ea2adbd18290ae8e8a937fa |
|
MD5 | c971c2bd42a6231eee86140f9ff13e13 |
|
BLAKE2b-256 | 523bb36554c92c05b1f1081674852a75d86a08ddf203569da1c35f39be000f07 |