Skip to main content

a typechecked struct/configuration parser

Project description

simple type safe configuration parser

Example Usage

from typechecked import Configuration

@Configuration
class Person:
    name: str
    age: int
    likes_cats: bool

person = Person.parse({
    'name': 'Max',
    'age': 21,
    'likes_cats': True
})

if person.likes_cats:
    print('great!')

TODO

  • examples for nested configurations and default values
  • use black for code formatting
  • automated testing with travis
  • document code
  • support unhandled configuration values, e.g. values that are present in the configuration dictionary but have no field in the configuration type.
  • support for typing generics like List, Union and Optional. will require great effort to keep backward compatibility with python >= 3.6. implementation will probably stall until typing has a stable inspection api. for reference see https://github.com/ilevkivskyi/typing_inspect.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for typechecked, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size typechecked-0.1.2-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size typechecked-0.1.2.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page