Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Releases: palazzem/pysettings

v0.4.0

09 Jun 12:58
afca36d
Compare
Choose a tag to compare

What's Changed

  • feat: add SettingsWrapper to simplify settings override in tests by @palazzem in #13

Milestone: v0.4.0
Full Changelog: v0.3.0...v0.4.0

0.3.0

08 Jun 17:45
2a6b6e0
Compare
Choose a tag to compare

What's Changed

  • deps: update all dependencies by @palazzem in #10
  • tests(tox): ensure all versions of Python are properly tested by @palazzem in #11
  • fix(settings): ensure copy and deepcopy works with a Setting instance by @palazzem in #12

Milestone: v0.3.0
Full Changelog: v0.2.0...v0.3.0

0.2.0

02 Oct 18:02
Compare
Choose a tag to compare
  • Added support for Python 3.9 and 3.10
  • Minimum Python supported version is now 3.7

Check 0.2.0 milestone for more details.

0.1.0

14 Mar 20:12
1be6779
Compare
Choose a tag to compare

Release

This is a first release for pysettings-validator library, which includes the following capabilities:

  • Store your application settings without using global objects.
  • Extend your settings using a BaseSettings class. The resulting class can be validated
    using a settings.is_valid() method.
  • Fields are represented with an Option field that takes validators as parameter.
    It's possible to set a default value if the option is not set by users.
  • Out of the box validators: not_null, is_https_url.
  • It's possible to add custom validators as functions.

Install the Package

$ pip install pysettings-validator

Use the Package

The following example shows how to define and use a Settings class:

from pysettings.base import BaseSettings
from pysettings.options import Option
from pysettings.validators import is_https_url

# Class definition
class Settings(BaseSettings):
    url = Option(validators=[is_https_url])
    description = Option()

# Use settings in your application
settings = Settings()
settings.url = "https://example.com"
settings.description = "A shiny Website!"
settings.is_valid()  # returns (True, [])

Read the full changeset and the release milestone.