New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-sett

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-sett

load and save settings from/ to a json file

  • 0.0.0
  • PyPI
  • Socket score

Maintainers
1

json-sett

Read settings from and save them to a json file.

Requirements

  • json-convenience

Install

install using pip: python -m pip install json-sett

Usage

  • import the 'Settings' class: from json_sett import Settings
  • initialize it: my_settings = Settings(file=<your_file_path>
  • then access your settings as attributes of the 'my_settings' object:
    say your json file contains the key 'settingA' you can access its value like that: my_settings.settingA
  • change the value of a setting like that: my_settings.settingA = <your_new_value>
    this will NOT save that value to the file
  • to save all settings use: my_settings.save()

File restrictions

The settings must all be at the top level in the json file.
This is a valid example:

{
  "settingA": "valueA",
  "settingB": 14
}

This is an invalid example:

{
  "settingA": "valueA",
  "settingB": {
    "settingC": true
  }
}

Adding support for the invalid example e.g. being able to order settings in groups would be nice. Might do that some time.

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc