Giter Site home page Giter Site logo

jsonresume-validator's Introduction

Build Status PyPI version GitHub license

Code Climate Test Coverage Issue Count

JSON Resume Validator

Python tool to validate JSON resumes to ensure that they are according to the defined schema

For more information on JSON resumes, please see the official JSON Resume initiative

Installing

$ pip install jsonresume-validator

Example apps

Example codes

  1. Using Resume class
import json

from jsonresume import Resume
from jsonresume.exceptions import InvalidResumeError

MY_RESUME_JSON_FILEPATH = ""

with open(MY_RESUME_JSON_FILEPATH, 'r') as json_file:
	data = json.load(json_file)
	r = Resume(data)
	if r.is_valid():
		print("Yay! We're good")
	else:
		print("Houston, we have a problem")

	# if we prefer catching exceptions...
	try:
		r.validate()
	except InvalidResumeError:
		# deal with invalid resume
		pass
  1. Using Schemas (colander)
import json
import logging

import colander

from jsonresume.schema.resume import Resume as ResumeSchema

RESUME_JSON_FILEPATH = "put your resume.json file path here"

try:
	with open(RESUME_JSON_FILEPATH, 'r') as fil:
		resume_json = json.load(fil)
except (IOError, ValueError):
	logging.exception("json file could not be loaded. Perhaps file path [{}] is incorrect".format(RESUME_JSON_FILEPATH))
else:
	try:
		resume = ResumeSchema().deserialize(resume_json)
	except colander.Invalid:
		logging.exception("resume has invalid JSON format")
	else:
		logging.info("Resume structure: {}".format(resume))

jsonresume-validator's People

Contributors

jpbower avatar kelvintaywl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.