This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
Releases: palazzem/pysettings
Releases · palazzem/pysettings
v0.4.0
0.3.0
0.2.0
- 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
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 asettings.is_valid()
method. - Fields are represented with an
Option
field that takesvalidators
as parameter.
It's possible to set adefault
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.