Saravanan666/pypi-org huggingface dataset:
Package: schemaorg
schemaorg PythonThis module will serve functions for researchers and users to apply schema.org
definitions to their datasets, software, and other worldly things. For
development functions with Python along with the web interface that
serves the published specifications, please seehttps://www.github.com/schemaorg/schemaorg.
For versions 0.1.0 and later, the structure of the data files changed, so we provide
schema.org 12.0 and later. For older versions of schemaorg, use versions prior
to 12.0.What is this not?This library is not intended to provide advanced functions around querying the ontology,
but rather accessing the definitions and tagging content with them.What is this for?Please reference thedevelopmentdocumentation
to read about the intended use cases that we are working on.OrganizationGenerally, we are extracting metadata from datasets and software, and then shoving
that metadata into a specification from schema.org. The final thing that we produce
is likely to be some form of json (e.g., json-ld) that can be embedded in a web
page or similar, intended to power search.  Since the specific needs of a particular
webby place may vary, along with a data type we are extracting, the module provides
"templates" in thetemplatesdirectory. Specifically:The subfolders represent different use cases. For example,templates/googlehas a simple html template, and a requirements file (called a recipe) to produce a Dataset and SoftwareSourceCode.Each subfolder, in an optional__init__.pyfile, also contains helper functions toward this goal. For example, the same google subfolder has such a file with amake_personfunction that users can quickly use to generate a person object.For each corresponding subfolder, there is generally an example in theexamplesfolder that also helps to see how it works.
Package: schemaorg-lite
schemaorg-liteThis module is a stripped down version of
schemaorg:https://www.github.com/schemaorg/schemaorg.
It will gather search engine metadata, from schema.org, and produce json-ld that can be embedded in a web
page or similar, intended to power search.We provide schema.org 23.0 and later.What is this not?This library is not intended to provide advanced functions around querying the ontology,
but rather accessing the definitions and tagging content with them.Acknowledgments
Package: schemapack
schemapackMake your JSON Schemas sociable and create linked data model.InstallationThis package is available at PyPI:https://pypi.org/project/schemapackYou can install it from there using:pip install schemapackDevelopmentFor setting up the development environment, we rely on thedevcontainer featureof vscode.To use it, you have to have Docker as well as vscode with its "Remote - Containers"
extension (ms-vscode-remote.remote-containers) extension installed.
Then, you just have to open this repo in vscode and run the commandRemote-Containers: Reopen in Containerfrom the vscode "Command Palette".This will give you a full-fledged, pre-configured development environment including:infrastructural dependencies of the service (databases, etc.)all relevant vscode extensions pre-installedpre-configured linting and auto-formatinga pre-configured debuggerautomatic license-header insertionMoreover, inside the devcontainer, there is follwing convenience command available
(please type it in the integrated terminal of vscode):dev_install- install the lib with all development dependencies and pre-commit hooks
(please run that if you are starting the devcontainer for the first time
or if added any python dependencies to the./setup.cfg)LicenseThis repository is free to use and modify according to theApache 2.0 License.
Package: schemapy
Schemapyallows you to generate objects for centralized database access. You
define the schema for your API, the code that needs to be executed, then the
validation part is dealt with for you. Everything is then encapsulated in a single
object.Schemapyrelies onPyDALfor schema definition but is not tied to it.Seedocumentationfor more informations.Installationpip install schemapyUsageUsingPyDAL:fromschemapyimportAPI,DAL,Fieldfromdatetimeimportdatetime,timedeltadb=DAL('sqlite:memory')db.define_table('users',Field('name',type='string',required=True),Field('created_on',type='date'))db.define_table('posts',Field('subject',type='string',required=True),Field('author',type='reference users',required=True),Field('created_on',type='date'),Field('content',type='text',required=True))api=API(db)@api.as_action(type='read',request=[Field('begin',type='date',required=True),Field('end',type='date',required=True)],response=db.posts)defselect_posts_by_date(db,req,action):query=(db.posts.created_on>=req.begin)|(db.posts.created_on<=req.end)returndb(query).select()now=datetime.now()result=api.select_posts_by_date(begin=now-timedelta(days=1),end=now)print(list(result))
Package: schemars
SchemarsIntroductionSchemars is a Python package, written in Rust and leveraging PyO3, designed for efficient and flexible serialization of Python class instances. It provides a simple yet powerful schema-based approach to serialize complex Python objects.InstallationTo install Schemars, run the following command:pip install schemarsRequirementsPython 3.xRust (optional for development)UsageTo use Schemars, define your Python class and corresponding schema class, then serialize instances as shown below:classProduct:def__init__(self,name,price,created):self.name=nameself.price=priceself.created=createdproduct=Product("test",10,"1577836800")importschemarsclassProductSchema(schemars.Schema):name=schemars.Str(strict=True)price=schemars.Decimal()created=schemars.Date(format='%Y/%m/%d')print(ProductSchema().serialize(product))Documentation Coming Soon!We are currently working on comprehensive documentation for Schemars, which will cover detailed usage, advanced features, and integration guides. Stay tuned for updates, and feel free to reach out to us with any specific questions or suggestions in the meantime.Upcoming in Version 1.0In the upcoming Version 1.0 of Schemars, we will be introducing additional functionalities including both validation and deserialization. This enhancement aims to provide a more comprehensive and robust experience in handling and processing Python class instances.Inspired by Marshmallow and Django REST FrameworkSchemars was developed in response to performance challenges encountered with existing serialization tools like Marshmallow and Django REST Framework. Our goal was to create a solution that not only addresses these performance issues but also remains user-friendly and familiar.Easy MigrationIf you're already using Marshmallow or Django REST Framework, you'll find Schemars's syntax and usage comfortably similar. This design choice is intentional to ensure that migration to Schemars is smooth and can be accomplished in just minutes. We have prioritized maintaining a familiar interface while significantly enhancing performance, so you can switch to Schemars with minimal adjustments to your existing codebase.Benchmarking SchemarsQuick Benchmark SetupTo compare Schemars with Django REST Framework (DRF), Marshmallow and Pydantic, follow these steps:InstallationInstall benchmarking requirements:python3-mpipinstall-rbench/requirements.txtRunning the BenchmarkExecute the benchmark script:python3bench/run.pyThis will run serialization tasks using Schemars, Marshmallow, DRF and Pydantic, allowing you to directly compare their performance.LicenseSchemars is released under the [MIT License]
Package: schemaser
schemaserConverts a Python class or method to a JSON schema.Installpip install schemaserExampleimportschemaserclassMyClass():def__init__(self,string:str=None,integer:int=None,float:float=None):pass# Custom magic method for custom schemas# def __schema__(self):#     return {}defMyMethod(value:str,**kw:cls):passdeffunc1(string:str,integer:int,float:float,tuple:list[str,int],array:list[str|int],object:MyClass,func:MyMethod):pass# Convert func1 method to JSON Schema.dat=schemaser.to_schema(func1)print(dat)
Package: schemasheets
Schemasheets - make datamodels using spreadsheetsCreate adata dictionary/ schema for your data using simple spreadsheets -no coding required.AboutSchemasheets is a framework for managing your schema using
spreadsheets (Google Sheets,Excel). It works by compiling down toLinkML, which can itself be compiled to a variety
of formalisms, or used for different purposes like data validationinstallationbasicsDocumentationSee theSchema Sheets ManualQuick StartpipinstallschemasheetsYou should then be able to run the following commands:sheets2linkml - Convert schemasheets to a LinkML schemalinkml2sheets - Convert a LinkML schema to schemasheetssheets2project - Generate an entire set of schema files (JSON-Schema, SHACL, SQL, ...) from SchemasheetsAs an example, take a look at the different tabs in the google sheet with ID1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQThe personinfo tab contains the bulk of the metadata elements:recordfieldkeymultiplicityrangedescschema.org>classslotidentifiercardinalityrangedescriptionexact_mappings: {curie_prefix: sdo}>idyes1stringany identifieridentifierdescriptionno0..1stringa textual descriptiondescriptionPersonn/an/an/aa person,living or deadPersonPersonidyes1stringidentifier for a personidentifierPerson, Organizationnameno1stringfull namenamePersonageno0..1decimalage in yearsPersongenderno0..1decimalage in yearsPersonhas medical historyno0..*MedicalEventmedical historyEventgrouping class for eventsMedicalEventn/an/an/aa medical encounterForProfitNonProfitThis demonstrator schema contains bothrecord types(e.g Person, MedicalEvent) as well asfields(e.g. id, age, gender)You can convert this like this:sheets2linkml--gsheet-id1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQpersoninfotypesprefixes-opersoninfo.yamlThis will generate a LinkML YAML filepersoninfo.yamlfrom 3 of the tabs in the google sheetYou can also work directly with TSVs:wget https://raw.githubusercontent.com/linkml/schemasheets/main/tests/input/personinfo.tsv 
sheets2linkml personinfo.tsv  -o personinfo.yamlWe recommend usingCOGSto synchronize your google sheets with local files using a git-like mechanismFinding out moreSchema Sheets ManualSpecificationInternal Datamodellinkml/schemasheetscode repolinkml/linkmlmain LinkML repo
Package: schema-st4-parser
Schema ST4 Python ParserParseSchema ST4XML Files into simple,flat python objects.Installationvia pip:pip install schema-st4-parserUsageSimply pass the xml file  into the parse methode. A list of St4Entry objects will be returned.from schema_st4_parser import parse, St4Entry

entries = parse("MyFile.xml")
print(entries[0])
Package: schemastore
schemastorepyContains all JSON Schemas fromschemastore.orgcatalog so you can make use of them without needing internet access.How to usefromschemastoreimportStorestore=Store(days=30)my_schema_json=store.get('http://...')# <-- no network access happensThedaysparameter is optional and defaults to 30, which means that after
this it will start checking if the locally cached schema is up to date and
refresh it it needed.store.catalogwould contain
the content of the catalog itself.StatsOver 500 JSON Schemas in the catalog~2.5Mib package size~30Mib installed size
Package: schematax
schematax is a simple Python package to do all things related toschemata.A schema is word made using an extra symbol, ‘*’, called the wild card symbol.
For example the schema over the binary aplhapbet ‘1*0’, represents the set of
strings. {‘100’,’110’}’.Schema have properties. For example, for a schema s, the order of s is the
number of symbols in s which are not the wild card symbols (called fixed symbols).
The defining length of s is the distance between the first and last fixed symbol.Given a set of words of the same length S, the schematic completion of S
returns all schema which make subsets of the words in S.
Whats more given the partial ordering over schemata, the schematic completion of S
forms aComplete Lattice.LinksGitHub:https://github.com/iSTB/python-schemataPyPI:http://pypi.python.org/pypi/schemataxIssue Tracker:https://github.com/iSTB/python-schemata/issuesDownload:http://pypi.python.org/pypi/schematax#downloadsInstallationThis package runs under Python 2.7, usepipto install:$pipinstallschemataxThis will also install thegraphvizpackage from PyPI as
required dependencies.Important: Drawing the the schematic lattice usesGraphviz software. Make sure it
is installed anddotexecutable is on your systems’ path.QuickstartThe file example.py gives a good overview of how to use the package.Basic schema operations:>>>importschematax>>>s=schematax.schema('10*1')#makes a schema>>>s10*1>>>s.get_order()3>>>s.get_defining_length()3>>>s2=schematax.schema('1**1')#makes another schema>>>s<=s2True>>>s<s2True>>>s==s2False>>>schematax.meet(s,s2)10*1>>>schematax.join(s,s2)1**1>>>s3=schematax.schema('00*1')>>>schematax.supremum([s,s2,s3])***1>>>schematax.infimum([s,s2,s3])e#e stands for the empty schemaSchematic completion and drawing the schematic lattice:>>>importschematax>>>xs=['111','011','001']>>>ss=schematax.complete(xs)#performing schematic completion>>>ss[111,011,001,*11,**1,0*1,e]#e stands for the empty schema>>>schematax.draw(ss,'my_lattice')#draws the schematic lattice of ss and saves it as my_lattice.pdfThe image produced here:Further readinghttps://en.wikipedia.org/wiki/Schema_%28genetic_algorithms%29https://en.wikipedia.org/wiki/Lattice_%28order%29See alsoThe implementation is based on these Python packages:graphviz– Simple Python interface for GraphvizLicenseSchemata is distributed under theMIT license.
Package: schematics-factory
Schematics Factory==================Inspired by [Voluptuous](https://github.com/alecthomas/voluptuous).It's sometimes inconvenient to definenamed [Schematics](https://github.com/schematics/schematics)Models, especially when those models are deeply nested.Example:```class InnerModel(Model):inner_bool = BooleanType()class MiddleModel(Model):middle_int = IntType()middle_nested = ModelType(InnerModel)class OuterModel(Model):outer_str = StringType()outer_nested = ModelType(MiddleModel)model_instance = OuterModel(input_)model_instance.validate()```So, this library provides a convenient syntax for definingdeeply nested Models.```from schematics_factory import modelOuterModel = model({'outer_str': StringType(),'outer_nested': ModelType(model({'middle_int': IntType(),'middle_nested': ModelType(model({'inner_bool': BooleanType()}))}))})model_instance = OuterModel(input_)model_instance.validate()```The model() function can also be imported as _model_factory_.Alternative Syntax------------------Schema factory arguments can also be supplied as keywordarguments rather than a dictionary.```Person = model(name=StringType(), age=IntType())person = Person(dict(name='Test', age=27))person.validate()```For nested Models, a concise __nested()__ convenience functionis provided to replace ModelType(model(...)) with nested(...).The nested() function can also be imported as _nested_model_.```from schematics_factory import model, nestedPerson = model(name=StringType(), pet=nested(name=StringType()))person = Person(dict(name='Test', pet=dict(name='Rover')))person.validate()```Nested models can also be provided as plain dictionary literals.```Person = model(name=StringType(), pet=dict(name=StringType()))person = Person(dict(name='Test', pet=dict(name='Rover')))person.validate()```Or equivalently...```Person = model({'name': StringType(),'pet': {'name': StringType()}})person = Person({'name': 'Test','pet': {'name': 'Rover'}})person.validate()```
Package: schematics-proto3
schematics-proto3Built uponSchematics-Python Data
Structures for Humans™,schematics-proto3brings the awesome features
ofSchematicsto Protobuf 3 world.CautionLibrary is currently inWORK IN PROGRESSstate.What is implemented and tested:Loading Protobuf 3 messages to Model instances.for most of the Protobuf 3 types, includingwrappers,repeatedoneoffieldsEnum typeValidation and structured error messages.To be done:Serializing Model instances to Protobuf 3 messages.Make the library more user-friendly.Schematics "roles".Installationpip install schematics-proto3MotivationAs good and widely supported as it is, Protobuf 3 still has some quirks
which can make working with it painful and repetitive. Especially, building
complex gRPC services might reveal a number of deficiencies in available tooling.schematics-proto3aims to address this problem, in particular:[#359]
default values and testing if a field is set in v3There is a workaround for this,schematics-proto3incorporates wrapper types to hide nested messages underneath.no proper data handling libraryComparing to Serializers in Django Rest Framework or Marshmallow, there seems to be no full
fledged serialization / validation / deserialization library for Protobuf 3.
Thanks toSchematics,schematics-proto3is able to provide:declarative modelscustom validation functionsstructured error messages (currently only as Python dict)ExampleLet's takeSchematics exampleand modify it to work with Protobuf.We have a following Protobuf message (andperson_pb2Python module).syntax="proto3";import"google/protobuf/wrappers.proto";packageexample;messagePerson{google.protobuf.StringValuename=1;google.protobuf.StringValuewebsite=2;}And reflect above message inModelclass.fromschematics_proto3importModelfromschematics_proto3importtypesaspbtypesimportperson_pb2aspb2classPersonModel(Model,protobuf_message=pb2.Person):name=pbtypes.StringWrapperType()website=pbtypes.StringWrapperType()Let's load some data.msg=pb2.Person()msg.name.value='Jon Doe'msg.website.value='https://example.com'model=PersonModel.load_protobuf(msg)model.validate()assertmodel.name=='Jon Doe'assertmodel.website=='https://example.com'assertmodel.to_native()=={'name':'Jon Doe','website':'https://example.com'}Not setting a field will give you anUnset.fromschematics_proto3.unsetimportUnsetmsg=pb2.Person()msg.name.value='Jon Doe'model=PersonModel.load_protobuf(msg)model.validate()assertmodel.name=='Jon Doe'assertmodel.websiteisUnset
Package: schematics-py310-plus
AboutThis is a Fork from the hard work of the maintainers athttps://github.com/schematics/schematics.Here’s a summary of the changes:add support for python 3.10+drop support for python version 3.6, 3.7, and 3.8run black and isort on the code basepackage with flit, updating to pyproject.tomladd development environment setup with nix and package as a nix flake.and that’s it!I don’t plan on any changes to this library aside from maintaining
support for modern python versions as long as this library is still
a dependency for projects that I’m involved with which is unlikely to
be forever. I would recommend planning on porting your validation code
to another validation / serialization library that is actively maintained.
But until then I’ll do my best to keep this current with new python
versions. Thank you to the original maintainers for all of their work!Project documentation:https://schematics.readthedocs.io/en/latest/Schematics is a Python library to combine types into structures, validate them,
and transform the shapes of your data based on simple descriptions.The internals are similar to ORM type systems, but there is no database layer
in Schematics.  Instead, we believe that building a database
layer is made significantly easier when Schematics handles everything but
writing the query.Further, it can be used for a range of tasks where having a database involved
may not make sense.Some common use cases:Design and document specificdata structuresConvert structuresto and from different formats such as JSON or MsgPackValidateAPI inputsRemove fields based on access rightsof some data’s recipientDefine message formats for communications protocols, like an RPCCustompersistence layersExampleThis is a simple Model.>>>fromschematics.modelsimportModel>>>fromschematics.typesimportStringType,URLType>>>classPerson(Model):...name=StringType(required=True)...website=URLType()...>>>person=Person({'name':u'Joe Strummer',...'website':'http://soundcloud.com/joestrummer'})>>>person.nameu'Joe Strummer'Serializing the data to JSON.>>>importjson>>>json.dumps(person.to_primitive()){"name":"Joe Strummer","website":"http://soundcloud.com/joestrummer"}Let’s try validating without a name value, since it’s required.>>>person=Person()>>>person.website='http://www.amontobin.com/'>>>person.validate()Traceback(mostrecentcalllast):File"<stdin>",line1,in<module>File"schematics/models.py",line231,invalidateraiseDataError(e.messages)schematics.exceptions.DataError:{'name':['This field is required.']}Add the field and validation passes.>>>person=Person()>>>person.name='Amon Tobin'>>>person.website='http://www.amontobin.com/'>>>person.validate()>>>
Package: schematics-to-swagger
UsecaseI have a REST API built using aiohttp and schematics.I want to provide Swagger spec for it and I use aiohttp-swagger.I'm too lazy to describe models for swagger docs so I want to build this information automaticallyUsageimport schematics_to_swagger

from your_package import models

definitions = schematics_to_swagger.read_models_from_module(models)
Package: schematics-xml
Pythonschematicsmodels for converting to and from XML.Installpipinstallschematics-xmlExample UsageSimply inherit XMLModel.fromschematics_xmlimportXMLModelclassPerson(XMLModel):name=StringType()john=Person(dict(name='John'))xml=john.to_xml()XML now contains;<?xml version='1.0' encoding='UTF-8'?><person><name>John</name></person>And back the other way;john=Person.from_xml(xml)AuthorAlex Hayes <alex@alution.com>
Package: schematic-test
SchematicUsageVirtual Environment SetupPython 3 has built-in support for virtual environments (usingvenvmodule). Perform the following steps:After cloning the git repository, navigate into theschematicdirectory and run the command as below:python[3]-mvenv.venvNote: It is assumed that you are running all the below commands from the main/root (schematic) directory.This creates a Python3 virtual environment (within therootfolder/package), with its own site directories (isolated from the system site directories).To activate the virtual environment, run:source.venv/bin/activateNote: You should now see the name of the virtual environment to the left of the prompt.Install App/PackageTo install the package/bundle/application:pip[3]install-e.To verify that the package has been installed (as apippackage), check here:pip[3]listNow, your environment is ready to test the modules within the application.Once you have finished testing the application within the virtual environment and want to deactivate it, simply run:deactivateTo run any of the example file(s), go to your root directory and execute/run python script in the following way:Let's say you want to run themetadata_usageexample - then do this:python[3]examples/metadata_usage.pyConfigure Synapse CredentialsDownload a copy of thecredentials.jsonfile (or the file needed for authentication using service account, calledquickstart-1560359685924-198a7114b6b5.json) stored on Synapse, using the synapse client command line utility. The credentials file is necessary for authentication to use Google services/APIs. To do so:Note: Make sure you havedownloadaccess/permissions to the above files before running the below commands.Forcredentials.jsonfile:synapsegetsyn21088684Forquickstart-1560359685924-198a7114b6b5.jsonfile:synapsegetsyn22316486Find the synapse configuration file (.synapseConfig) downloaded to the current source directory. Access it like this:vi[m].synapseConfigOpen the config file, and under the authentication section, replace< username >and< apikey >with your Synapse username and API key.Note: You can get your Synapse API key by:logging into Synapse > Settings > Synapse API Key > Show API Key.ContributionClone a copy of the repository by executing the command as below:gitclone--single-branch--branchdevelophttps://github.com/Sage-Bionetworks/schematic.gitFork the repository.Clone the forked repository.Create a branch with a descriptive name that includes the name of the feature under development.Push your changes to that branch.PR into a branch that is developing the same feature on theschematicmain repository.For further reference, please consultCONTRIBUTION.md.