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.
Metadata
Release files for lucy-spc 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lucy-spc-0.0.2.tar.gz | 3.7 kB | Without provenance | Details for lucy-spc-0.0.2.tar.gz |
Release files / lucy-spc-0.0.2.tar.gz
| Download URL | lucy-spc-0.0.2.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d75bd96269a8a97cc01b1d1952e3b197d4993ed63ea2adbd18290ae8e8a937fa
|
|
BLAKE2b-256 checksum How to use checksums |
523bb36554c92c05b1f1081674852a75d86a08ddf203569da1c35f39be000f07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.9
|
Security for lucy-spc 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.