Saravanan666/pypi-org huggingface dataset:
Package: schematodes
SchematodesA tool for expressing permutation symmetries in sets of tuples.Inspired by the study of input symmetry in Boolean network regulatory functions, and developed withcanaintegration in mind.InstallingSchematodes is available on PyPI:pipinstallschematodesBuildingWe wroteschematodesinrustforpythonwithpyO3bindings usingmaturin. The recommended build steps are as follows:Make surerustis installed. See therust websitefor details.Installmaturin:pip install maturin.For testing and development, tuild using the commandmaturin developin the root directory of this repository. This will build and installschematodesin your currentvirtualenv.For distribution building, you can usematurin build --release --out dist --find-interpreter. However, this should be done automatically by GitHub when pushing to main.
Package: schema-transpose
Schema TransposeThis library and CLI converts JSON Schema Documents into other languages. It can work with JSON Schema or Pydantic files as a source.UsageThis needs to be installed in the same virtual environment as the Models that it is converting. Once installed a CLI tool,schema_transpose, will be available in the environment.For example, to generate a variables file for the RDS ParameterValidation class-robert@Roberts-MacBook-Proterraform-aws-core%schema_transposemodules.rds.validation.parameters:ParameterValidationThe command will output the following to stdout:variable"type"{type=stringdefault=null}variable"pit_identifier"{type=stringdefault=null}variable"tags"{type=map(any)default={}}variable"name"{type=stringvalidation{# Automatically Generated from Rule: minlengthcondition=length(var.name)>=1error_message="Field should not be less than 1 characters"}validation{# Automatically Generated from Rule: maxlengthcondition=length(var.name)<=63error_message="Field should not be larger than 63 characters"}validation{# Automatically Generated from Rule: patterncondition=length(regexall("^(?!.*--)[a-zA-Z][A-Za-z0-9.-]+(?<!-)$",var.name))>0error_message="Field does not match regex pattern ^(?!.*--)[a-zA-Z][A-Za-z0-9.-]+(?<!-)$"}}variable"vpc_name"{type=string}variable"engine"{type=stringvalidation{# Automatically Generated from Rule: minlengthcondition=length(var.engine)>=1error_message="Field should not be less than 1 characters"}}variable"engine_version"{type=stringvalidation{# Automatically Generated from Rule: minlengthcondition=length(var.engine_version)>=1error_message="Field should not be less than 1 characters"}}variable"is_public"{type=booldefault=false}
Package: schema-validator
schema-validatorGenerate from quart-schemaInstallpip install schema-validatorHow to usefrom dataclasses import dataclass
    from datetime import datetime
    from typing import Optional
    from pydantic import BaseModel

    from flask import Flask
    from quart import Quart
    from schema_validator import SchemaValidator
    from schema_validator.flask import validate
    # from schema_validator.quart import validate


    app = Flask(__name__)

    # or 
    app = Quart(__name__)
    
    
    OR
    
    schema = SchemaValidator(app)
    schema.init_app(app)

    @dataclass
    class Todo:
        task: str
        due: Optional[datetime]

    class TodoResponse(BaseModel):
        id: int
        name: str

    @app.post("/")
    @validate(body=Todo, responses=TodoResponse)
    def create_todo():
        # balabala
        return dict(id=1, name="2")
        
    @app.get("/")
    @validate(
        query=Todo,
        responses={200: TodoResponse, 400: TodoResponse}
    )
    def update_todo():
        # balabala
        return TodoResponse(id=1, name="123")

    @app.delete("/")
    @validate(
        body=Todo,
        responses={200: TodoResponse}
    )
    def delete():
        # balabala
        return jsonify(id=1)

    @tags("SOME-TAG", "OTHER-TAG")  # only for swagger
    class View(MethodView):
        @validate(...)
        def get(self):
            return {}How to show the swaggerapp.config["SWAGGER_ROUTE"] = True

http://yourhost/swagger/docs   -> show the all swagger

http://yourhost/swagger/docs/{tag} -> show the swagger which include tagHow to export the swaggeradd command in flask/quart:
    app.cli.add_command(generate_schema_command)

Export all swagger to json file:

 - flask/quart schema -o swagger.json

Export the swagger which include the ACCOUNT tag:

 - flask/quart schema -o swagger.json -t ACCOUNT
Package: schema-validator-halpa
PackageThis package is a wrapper for jsonschema and simplejson to simplyfy JSON schema validation specified byJSON Schema Draft 7(link toIETF).Examplefromvalidatorimportvalidate# Define the validation schemaschema={"type":"object","required":["name","age",],"properties":{"name":{"type":"string"},"age":{"type":"number"},}}# Data to be validateddata={"name":"Daniel","age":30,}# Validate and runvalidation=validate(schema,data)ifvalidation==True:# do something with data, e.g. create a new friendelse:print(validation)# will show a well formated dict with errorsNote: More examples can be shown in the testsContributeThis package is intended to be used by private projects. But go ahead if you like and make comments and pull requests and I might look into it.Install the packagepython-mvenvvenvsourcevenv/bin/activate
pipinstall-rrequirements.txtRun testspython-mpytest-mvalidator-sUpload package# Set your user with python keyringpython3-mkeyringsethttps://upload.pypi.org/legacy/$username# substitue $username with your actual username# Update packaging toolspython3-mpipinstall--user--upgradesetuptoolswheeltwine# Remove dist folderrm-rfdist/*# Create a new distpython3setup.pysdistbdist_wheel# Above command creates# dist/#  schema-validator-halpa-0.0.5-py3-none-any.whl#  schema-validator-halpa-0.0.5.tar.gz# where "0.0.1" is equivalent to value in "version" from setup.py# Upload the packagepython3-mtwineuploaddist/*
Package: schemax
SchemaMaximaldistrict42schemas ⇆JSON SchemaInstallationpip3installschemaxUsage>>>importschemax>>>fromdistrict42importschema>>>ExampleSchema=schema.str.len(1,10)>>>schemax.to_json_schema(ExampleSchema){'type': 'string', 'minLength': 1, 'maxLength': 10}Also, you could use schemax to translate from JSON-Schema to d42 andgenerate tests interfaces(in future releases) via command line:$python3-mschemaxtranslateschema.jsonTranslation from JSON-Schema to d42-schema for schema.json:
schema.dict({
    'number': schema.int.min(1),
    optional('street_name'): schema.str,
    ...: ...
})schema.json:{"type":"object","properties":{"number":{"type":"integer","minimum":1},"street_name":{"type":"string"}},"required":["number"],"additionalProperties":true}Supported d42 -> JSON Schema types and features(✅ - done; 🔧 - planned support; ❌ - unsupportable)None:✅schema.noneBool:✅schema.bool✅schema.bool(value)Int:✅schema.int✅schema.int(value)✅schema.int.min(value)✅schema.max(value)Float:✅schema.float✅schema.float(value)✅schema.float.min(value)✅schema.float.max(value)🔧schema.float.precision(value)Str:✅schema.str✅schema.str(value)✅schema.str.len(length)✅schema.str.len(min_length, max_length)✅schema.str.alphabet(letters)✅schema.str.contains(substr)✅schema.regex(pattern)List:✅schema.list✅schema.list(elements)✅schema.list(type)✅schema.list(type).len(length)✅schema.list(type).len(min_length, max_length)Dict:✅schema.dict✅schema.dict({key: value}) strict✅schema.dict({key: value, ...: ...}) relaxedAny:✅schema.any✅schema.any(*types)❌schema.const❌schema.bytesSupported JSON Schema -> d42 types and features(✅ - done; 🔧 - planned support; ❌ - unsupportable)✅null✅boolean✅integer✅minimum✅maximum✅exclusiveMinimumKeep in mind, that we're just taking exclusiveMinimum + 1 as schema.int.min✅exclusiveMaximumKeep in mind, that we're just taking exclusiveMaximum - 1 as schema.int.max❌multiples✅number✅minimum✅maximum🔧exclusiveMinimum🔧exclusiveMaximum❌multiples✅string✅minLength✅maxLength✅pattern❌format✅array✅items✅length✅prefixItems✅unevaluatedItems❌uniqueness✅object✅properties❌patterProperties❌additionalProperties✅requiredProperties❌propertyName❌size
Package: schemdraw
schemdrawSchemdraw is a python package for producing high-quality electrical circuit schematic diagrams. Typical usage:importschemdrawimportschemdraw.elementsaselmwithschemdraw.Drawing(file='schematic.svg')asd:d+=elm.Resistor().label('100KΩ')d+=elm.Capacitor().down().label('0.1μF',loc='bottom')d+=elm.Line().left()d+=elm.Ground()d+=elm.SourceV().up().label('10V')Included are symbols for basic electrical components (resistors, capacitors, diodes, transistors, etc.), opamps and signal processing elements. Additionally, Schemdraw can produce digital timing diagras, state machine diagrams, and flowcharts.Documentation is available atreadthedocsThe most current version can be found in thesource code git repository.
Package: schemdraw-markdown
SchemdrawExtension forPython-Markdowna simpler way to document circuits in markdownInspiration:This project is inspired by the wonderful project:plantuml-markdown. So,
shoutout to the folks who've toiled on that project to make it great!UsageThis package allows you to configure a schematic drawing, directly in markdown
using a code-fenced sample as follows:::schemdraw:: alt="My super diagram"
    += elm.Resistor().right().label('1Ω')
    += elm.Capacitor().down().label('10μF')
    += elm.Line().left()
    += elm.SourceSin().up().label('10V')
::end-schemdraw:::warning: Security NoteThis package makes use of Python'sexecfunctionality, which is inherently
somewhat insecure, as it allows for arbitrary code execution. Only carfully
curated drawings logic should be used.InstallationInstalling fromPyPIYeah! It's "official," now! You can justpip-installthe package with:$pip3installschemdraw-markdownInstalling from SourceClone RepositoryFrom within local Repository folder, issue:pipinstall.
Package: schemdule-extensions-audioplay
schemdule-extensions-audioplayA audio player extension forSchemdule.PlatformPythonAll extensionsInstallInstall dependencies:# Install dependencies on Linux (only)sudoapt-getinstall-ypython3-devlibasound2-dev# Install ffmpegchocoinstallffmpeg# Windowsapt-getinstall-yffmpeg# Linuxbrewinstallffmpeg# MacOSUse pip:pipinstallschemdule-extensions-audioplayOr use pipx:pipxinjectschemduleschemdule-extensions-audioplay# Upgradepipxupgradeschemdule--include-injectedCheck if the extension installed:schemduleextUsageThis extension provide aAudioPlayerPrompterand add the following extension methods onPrompterBuilderandPayloadBuilder.classPrompterBuilder:defuseAudioPlayer(self:PrompterBuilder,endSpace:Optional[timedelta]=None,final:bool=False)->PrompterBuilder:"""endSpace: Stop audio before next event, default 10 seconds. The empty space leads to the next event outdated."""...classPayloadBuilder:defuseAudio(self,files:Iterable[str])->"PayloadBuilder":...Use the extension in the schema script.# schema.pyext("audioplay")at(...,payloads().useAudio(["file1"]))prompter.useAudioPlayer()
Package: schemdule-extensions-miaotixing
schemdule-extensions-miaotixingAmiaotixingextension forSchemdule.PlatformPythonAll extensionsInstallUse pip:pipinstallschemdule-extensions-miaotixingOr use pipx:pipxinjectschemduleschemdule-extensions-miaotixing# Upgradepipxupgradeschemdule--include-injectedCheck if the extension installed:schemduleextUsageThis extension provide aMiaotixingPrompterand add the following extension methods onPrompterBuilder.classPrompterBuilder:defuseMiaotixing(self,code:str,final:bool=False)->"PrompterBuilder":...Use the extension in the schema script.# schema.pyext("miaotixing")prompter.useMiaotixing()
Package: schemdule-extensions-simplegui
schemdule-extensions-simpleguiA simple GUI extension forSchemdule.PlatformPythonAll extensionsInstallUse pip:pipinstallschemdule-extensions-simpleguiOr use pipx:pipxinjectschemduleschemdule-extensions-simplegui# Upgradepipxupgradeschemdule--include-injectedCheck if the extension installed:schemduleextUsageThis extension provide aMessageBoxPrompterand add the following extension methods onPrompterBuilder.classPrompterBuilder:defuseMessageBox(self,autoClose:bool=False,maxKeep:Optional[timedelta]=None,final:bool=False)->PrompterBuilder:"""maxKeep: The maximum duration to keep opening messagebox if autoClose is True, default 1 minute."""...Use the extension in the schema script.# schema.pyext("simplegui")prompter.useMessageBox()
Package: scheme
Homepage:https://github.com/arterial-io/schemeScheme is a declarative, general-purpose data schema framework for Python. It provides a simple approach to defining data schemas, and with those schemas enables serialization and unserialization to and from a variety of data formats, rich validation with descriptive error handling, hierarchical variable interpolation, and other interesting means of interacting with data.Scheme can be used wherever incoming and outgoing structured data needs to be well-defined and validated: APIs, configuration files, complex user input, workflow and process user cases, and so on.>>>fromschemeimport*>>>fromdatetimeimportdate>>>account=Structure({'name':Text(nonempty=True),'email':Email(nonempty=True),'role':Enumeration('guest user admin',required=True,default='user'),'active':Boolean(required=True,default=True),'interests':Sequence(Text(nonempty=True),unique=True),'logins':Integer(minimum=0,default=0),'birthday':Date(),},name='account')>>>json='{"name": "Johnny Doe", "email": "johnny.doe@something.com","interests":["baseball","basketball"],"birthday":"1980-03-05"}'>>>account.unserialize(json,'json'){'name':'Johnny Doe','email':'johnny.doe@something.com','role':'user','active':True,'interests':['baseball','basketball'],'logins':0,'birthday':datetime.date(1980,3,5)}>>>suzy={'name':'Suzy Queue','email':'suzy.queue@something.com','role':'admin','active':False,'logins':324,'birthday':date(1985,12,2)}>>>print(account.serialize(suzy,'yaml'))active:falsebirthday:1985-12-02email:suzy.queue@something.comlogins:324name:SuzyQueuerole:admin>>>account.unserialize('{}','json')Traceback(mostrecentcalllast):...scheme.exceptions.ValidationError:validationfailed[01]Requiredfielderrorat(structure):accountismissingrequiredfield'name'Field:Structure(name='account',...)[02]Requiredfielderrorat(structure):accountismissingrequiredfield'email'Field:Structure(name='account',...)>>>account.serialize({'name':'Johnny Doe','email':'johnny.doe@something.com','logins':-34},'json')Traceback(mostrecentcalllast):...scheme.exceptions.ValidationError:validationfailed[01]Requiredfielderrorat(structure):accountismissingrequiredfield'active'Field:Structure(name='account',...)[02]Minimumvalueerrorat(structure).logins:loginsmustbegreaterthenorequalto0Field:Integer(name='logins',minimum=0,default=0)Value:-34[03]Invalidvalueerrorat(structure).role:rolemustbeoneof'guest','user','admin'Field:Enumeration(name='role',...)Value:'invalid'FeaturesSimple, declarative schema definitionRich set of field types:binary, boolean, date, datetime, decimal, email, enumeration, float integer, map, object, sequence, structure, text, time, token, tuple, uuidSupport for various serialization formats:csv, json, structured text, xml, yamlRich validation with descriptive error reporting:minimum/maximum length/value, pattern matching, etc.Hierarchical variable interpolationSchema-mediated extraction of values from arbitrary objectsSupport for schema-based objectsSerialization and unserialization of schemas, for dynamic use casesGet it$ pip install -U schemeRequirementsPython 2.6+ or 3.3+LicenseBSD licensed. SeeLICENSEfor more details.
Package: schemed-yaml-config
Schemed YAML ConfigSchemed YAML Config is a library to read and validateYAMLbased configuration files againstJSON Schemaspecifications.BranchesThe project is transitioning from v0.x to v1.x and master branch is used to develop the latter.There's significant changes between v0.x and v1.x. And, while new user are encouraged to look into v1.x, that might be troublesome for those who have developed code around v0.xInstallSchemed-yaml-config can be installed via PIP# pip install schemed-yaml-configUnder the hoodSchemed YAML Config works by converting YAML files into a dictionarie by mean of the well knownPyYAML frameworkand then by applying JSON Schema specifications before of returning it to rest of the script.The beauty of this approach is it combines the human friendly serialization of YAML with the power of JSON Schema.A few tricks has been added to make the library even more human friendly. For instance when the a configuration file is missing and a default is created, order and comments of the keys from the schema are borrowed to the YAML file.SyntaxPython 3.7.4 (default, Aug 21 2019, 16:01:23)
[GCC 9.2.1 20190813] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from schemed_yaml_config import get_config
>>> config = get_config('config.yml', 'schema.yml')
>>> print(config)
{'listen': {'host': 'localhost', 'port': 8080}, 'tmpdir': '/tmp/'}
>>>TOMLDespite its name Schemed YAML Config also supportsTOML. TOML schemas are not supported yet!
Package: schemey
Schemey - Json Schemas for Python.This project allows for generation of json schemas based on python
classes, or python classes based on json schemas. It also allows for
generation of validated dataclasses, where setters cannot violate
the invariants established in a schema.It uses the fantasticJSON Schemalibrary for python. (Though older versions did not.)The general idea is that the framework should not insist on any particular
data structure or paradigm - it is designed to be extensible, and out of the box support
is provided for iterable types, dataclasses, enums, timestamps and primitives.Serialization is provided using marshy.Current test coverage is at 100%Why did you build this?There were gaps in the functionality of existing solutions (Like pydantic)
that made using them untenable for my use cases.Installationpip install schemeyConceptsASchemacontains a link between a JSON Schema and a Python TypeAValidatoris used to validate python objects using a schemaASchemaContextis used to generate python objects for json schemas / vice versaASchemaFactoryis used to plug new translation rules into a SchemaContext (more below)ExamplesHello WorldThis demonstrates generating a validator for a dataclass.Validated DataclassThis demonstrates generating a validated dataclassValidated FieldsThis demonstrates adding custom validation rules to dataclass fieldsCustom Class ValidationsThis demonstrates adding fully custom marshalling and validations for a classCustom JSON Schema ValidationsThis demonstrates creating custom json schema validations for things not natively supported by json schema. For
example,checking a date against the current time, or thata property of an object is less than another property of that object.Beginning with a JSON SchemaThis demonstrates starting with a json schema and generating python dataclasses from it.Configuring the Context itselfSchemey usesInjectyfor configuration.
The default configuration ishereFor example, for a project namedno_more_uuids, I may add a fileinjecty_config_no_more_uuids/__init__.py:from schemey.factory.schema_factory_abc import SchemaFactoryABC
from schemey.factory.uuid_factory import UuidFactory

priority = 120  # Applied after default


def configure(context):
    context.deregister_impl(SchemaFactoryABC, UuidFactory)Installing local development dependenciespython setup.py install easy_install "schemey[dev]"Release ProcedureThe typical process here is:Create a PR with changes. Merge these to main (TheQualityworkflows make sure that your PR
meets the styling, linting, and code coverage standards).New releases created in github are automatically uploaded to pypi
Package: scheming-flask
scheming-flaskUse JSON Schema to validate incoming requestsFree software: MIT licenseDocumentation:https://scheming-flask.readthedocs.io.DocumentationYou will need to install the package dependencies first,
see the Installation section for details.To build and open the documentation simply run:bin/build-docsInstallationIf you need to install pyenv/virtualenvwrapper you can run thebin/setup-osxcommand
Please note that this will modify your bash profileAssuming you have virtualenv wrapper installedmkvirtualenvscheming-flaskworkonscheming-flaskpipinstall-rrequirements_dev.txtpipinstall-e.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2017-11-18)First release on PyPI.
Package: schemy
SchemyData structure to represent schemas in databases.Change history0.1.4Added the format property to the Field object.Support for date and datetime types.SQL command generation is now separated into a specific class, instead of being methods of the Schema class.0.1.3Removed the need for the schema to have a name to represent the repository name. The schema will only define the internal structure (fields, keys, constraints, etc.) from here on out.
Package: schengulator
SchengulatorSchengulator is a tool to calculate how many days an individual has been in Schengen countries out of a specified 180-day period.The Schengen Visa RuleThe schengulator determines the number of days spent and remaining based on the 90/180-day Schengen Visa Rule, where an individual can stay in Schengen countries for 90 days out of an 180 day time period. The 180-day window is defined as:"The 180-day period keeps rolling. Therefore, anytime you wish to enter the Schengen, you just have to count backwards the last 180 days, and see if you have been present in the Schengen for more than 90 days throughout that period"(as statedhere)Therefore, schengulator calculates the days spent in the Schengen area based on the 180 days prior to a user-defined date.For more on the Schengen Visa Rule, see these links:Schengen visa infoThe 90/180-day rule made easyUK Government on visa permits in EuropeThe Schengen rule: here's how it worksThere are many Schengen stay calculators available online or as apps. The purpose of schengulator is to create a workflow that istransparent(i.e. you can see the workings) andnon-repetitive(i.e. you don't have to log each and every one of your trips to the Schengen area every time you need to use the tool).QuickstartTo get started, install schengulator using pip.pipinstallschengulatorCheck that the package works by opening a python console and importing it.python3importschengulatorThere are a number of examples in the scripts provided in theexamplesdirectory of theschengulator Github repositoryto test the installation and see how it works.fromschengulator.schengulatorimportSchengenStay,/checkStay,checkDaysLeft,staysFromCSV# Example 1. Check Schengen stays from specific date# using SchengenStay obj# Initialise Schengen evaluation from 01/05/2022ss=SchengenStay('2022-05-01')# Add all staysss.addStay('2021-07-01','2021-07-15')# Greecess.addStay('2021-09-03','2021-09-08')# Netherlandsss.addStay('2021-09-20','2021-09-25')# Belgiumss.addStay('2021-12-20','2022-01-03')# Belgiumss.addStay('2022-04-18','2022-05-01')# Italy# Check number of days spent in Schengen on 01/05/2022flag=ss.checkDays()ifflag==True:print('All okay!')# Example 2. Check Schengen stays for all dates in# proposed future stay# Create list of all staystrips=[['2021-07-01','2021-07-15'],# Greece['2021-09-03','2021-09-08'],# Netherlands['2021-09-20','2021-09-25'],# Belgium['2021-12-20','2022-01-03'],# Belgium['2022-04-18','2022-05-01']]# Italy# Check if new stay is within Schengen 90-day limitscheckStay(['2022-04-18','2022-05-01'],trips[:-1])# See how many days left in Schengen after proposed tripcheckDaysLeft(trips)# Example 3. Check Schengen stays from CSV file# Import stays from csv fileinfile='examples/example_stays.csv'csv_trips=staysFromCSV(infile)# Check if new trip is within Schengen 90-day limitsnew_trip=['2022-01-05','2022-01-20']checkStay(new_trip,csv_trips)# Check how many days left in Schengen after new tripcsv_trips.append(new_trip)checkDaysLeft(csv_trips,d=new_trip[1])AcknowledgementsThis tool was inspired by these related python repositories:schengenschengencalc