Saravanan666/pypi-org huggingface dataset:
Package: marshmallow-sqlalchemy
Homepage:https://marshmallow-sqlalchemy.readthedocs.io/SQLAlchemyintegration with themarshmallow(de)serialization library.Declare your modelsimportsqlalchemyassafromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlalchemy.ormimportscoped_session,sessionmaker,relationship,backrefengine=sa.create_engine("sqlite:///:memory:")session=scoped_session(sessionmaker(bind=engine))Base=declarative_base()classAuthor(Base):__tablename__="authors"id=sa.Column(sa.Integer,primary_key=True)name=sa.Column(sa.String,nullable=False)def__repr__(self):return"<Author(name={self.name!r})>".format(self=self)classBook(Base):__tablename__="books"id=sa.Column(sa.Integer,primary_key=True)title=sa.Column(sa.String)author_id=sa.Column(sa.Integer,sa.ForeignKey("authors.id"))author=relationship("Author",backref=backref("books"))Base.metadata.create_all(engine)Generate marshmallow schemasfrommarshmallow_sqlalchemyimportSQLAlchemySchema,auto_fieldclassAuthorSchema(SQLAlchemySchema):classMeta:model=Authorload_instance=True# Optional: deserialize to model instancesid=auto_field()name=auto_field()books=auto_field()classBookSchema(SQLAlchemySchema):classMeta:model=Bookload_instance=Trueid=auto_field()title=auto_field()author_id=auto_field()You can automatically generate fields for a model’s columns usingSQLAlchemyAutoSchema.
The following schema classes are equivalent to the above.frommarshmallow_sqlalchemyimportSQLAlchemyAutoSchemaclassAuthorSchema(SQLAlchemyAutoSchema):classMeta:model=Authorinclude_relationships=Trueload_instance=TrueclassBookSchema(SQLAlchemyAutoSchema):classMeta:model=Bookinclude_fk=Trueload_instance=TrueMake sure to declareModelsbefore instantiatingSchemas. Otherwisesqlalchemy.orm.configure_mappers()will run too soon and fail.(De)serialize your dataauthor=Author(name="Chuck Paluhniuk")author_schema=AuthorSchema()book=Book(title="Fight Club",author=author)session.add(author)session.add(book)session.commit()dump_data=author_schema.dump(author)print(dump_data)# {'id': 1, 'name': 'Chuck Paluhniuk', 'books': [1]}load_data=author_schema.load(dump_data,session=session)print(load_data)# <Author(name='Chuck Paluhniuk')>Get it nowpip install -U marshmallow-sqlalchemyRequires Python >= 3.8, marshmallow >= 3.0.0, and SQLAlchemy >= 1.4.40.DocumentationDocumentation is available athttps://marshmallow-sqlalchemy.readthedocs.io/.Project LinksDocs:https://marshmallow-sqlalchemy.readthedocs.io/Changelog:https://marshmallow-sqlalchemy.readthedocs.io/en/latest/changelog.htmlContributing Guidelines:https://marshmallow-sqlalchemy.readthedocs.io/en/latest/contributing.htmlPyPI:https://pypi.python.org/pypi/marshmallow-sqlalchemyIssues:https://github.com/marshmallow-code/marshmallow-sqlalchemy/issuesLicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: marshmallow-sqlalchemy-pk
Homepage:https://marshmallow-sqlalchemy.readthedocs.io/SQLAlchemyintegration with themarshmallow(de)serialization library.Declare your modelsimportsqlalchemyassafromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlalchemy.ormimportscoped_session,sessionmaker,relationship,backrefengine=sa.create_engine('sqlite:///:memory:')session=scoped_session(sessionmaker(bind=engine))Base=declarative_base()classAuthor(Base):__tablename__='authors'id=sa.Column(sa.Integer,primary_key=True)name=sa.Column(sa.String)def__repr__(self):return'<Author(name={self.name!r})>'.format(self=self)classBook(Base):__tablename__='books'id=sa.Column(sa.Integer,primary_key=True)title=sa.Column(sa.String)author_id=sa.Column(sa.Integer,sa.ForeignKey('authors.id'))author=relationship("Author",backref=backref('books'))Base.metadata.create_all(engine)Generate marshmallow schemasfrommarshmallow_sqlalchemyimportModelSchemaclassAuthorSchema(ModelSchema):classMeta:model=AuthorclassBookSchema(ModelSchema):classMeta:model=Book# optionally attach a Session# to use for deserializationsqla_session=sessionauthor_schema=AuthorSchema()(De)serialize your dataauthor=Author(name='Chuck Paluhniuk')book=Book(title='Fight Club',author=author)session.add(author)session.add(book)session.commit()author_schema.dump(author).data# {'books': [123], 'id': 321, 'name': 'Chuck Paluhniuk'}author_schema.load(dump_data,session=session).data# <Author(name='Chuck Paluhniuk')>Get it nowpip install -U marshmallow-sqlalchemyDocumentationDocumentation is available athttps://marshmallow-sqlalchemy.readthedocs.io/.Project LinksDocs:https://marshmallow-sqlalchemy.readthedocs.io/Changelog:https://marshmallow-sqlalchemy.readthedocs.io/en/latest/changelog.htmlPyPI:https://pypi.python.org/pypi/marshmallow-sqlalchemyIssues:https://github.com/marshmallow-code/marshmallow-sqlalchemy/issuesLicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: marshmallow-sqlalchemy-referential
Installationpip install marshmallow-sqlalchemy-referentialSample Usageimportsqlalchemyassafromsqlalchemy.ext.declarativeimportdeclarative_basefrommarshmallow_sqlalchemy_referentialimportReferentialfrommarshmallow_sqlalchemyimportModelSchemafrommarshmallowimportfieldsBase=declarative_base()user_group_assoc=sa.Table('user_group_assoc',Base.metadata,sa.Column('user_id',sa.Integer,sa.ForeignKey('user.id')),sa.Column('group_id',sa.Integer,sa.ForeignKey('group.id')))classUser(Base):__tablename__='user'id=sa.Column(sa.Integer(),primary_key=True)groups=sa.orm.relationship('Group',secondary=user_group_assoc)classGroup(Base):__tablename__='group'id=sa.Column(sa.Integer(),primary_key=True)users=sa.orm.relationship('User',secondary=user_group_assoc)classGroupSchema(ModelSchema):classMeta():dump_only=['id']id=fields.Integer()classUserSchema(ModelSchema):classMeta():dump_only=['id']id=fields.Integer()groups=Referential(GroupSchema,model=Group,many=True)
Package: marshmallow-toplevel
marshmallow-toplevelLoad and validate top-level lists with all the power ofmarshmallow.Installationpipinstallmarshmallow-toplevelUsagefrommarshmallowimportfieldsfrommarshmallow_toplevelimportTopLevelSchemaclassBatchOfSomething(TopLevelSchema):_toplevel=fields.Nested(SomethingSchema,required=True,many=True,validate=any_validation_logic_applied_to_list)RationaleImagine that you have an API endpoint (or any other program that
accepts user input), which is intended to accept multiple blog articles
and save them to a database. Semantically, your data is a list of dictionaries:[{"id":1,"title":"Hello World!"},{"id":2,"title":"Yet another awesome article."},...]You describe article object schema and put constraints on your data:frommarshmallowimportSchema,fields,validateclassArticleSchema(Schema):id=fields.Int(required=True)title=fields.Str(required=True,validate=validate.Length(min=2,max=256))But you also want to put some constraints onto outer list itself, for example,
you want it to have length between 1 and 10. How do you describe it in
terms ofmarshmallow?Obvious solution: nest your dataclassBatchOfArticles(Schema):articles=fields.Nested(ArticleSchema,required=True,many=True,validate=validate.Length(1,10))But now a client have to send data this way, with this extra dictionary around:{"articles":[{"id":1,"title":"Hello World!"},{"id":2,"title":"Yet another awesome article."},...]}It makes your API not so beautiful and user-friendly.Good solution: use marshmallow-toplevelWithmarshmallow-toplevelyou can describe you data this way:frommarshmallow_toplevelimportTopLevelSchemaclassBatchOfArticles(TopLevelSchema):_toplevel=fields.Nested(ArticleSchema,required=True,many=True,validate=validate.Length(1,10))Notice that schema inherits fromTopLevelSchemaand uses this
special_toplevelkey. It means that the field under this key
describes top level object. You can define any constrains that
you can define inmarshmallowand it will just work:schema=BatchOfArticles()# validation should failerrors=schema.validate([])asserterrors# length < 1errors=schema.validate([{"id":i,"title":"title"}foriinrange(100)])asserterrors# length > 10# validation should succeederrors=schema.validate([{"id":i,"title":"title"}foriinrange(5)])assertnoterrorsYou can also useloadfor this schema as usual:data=schema.load([{"id":"10","title":"wow!"}])print(data)# [{"id": 10, "title": "wow!"}]Now a client can send data as a list without redundancy.
Package: marshmallow-union
Union fields for marshmallow.Free software: MIT licenseWarningThis library works by trying a list of fields one by one, and (de)serializing with the first one not to raise an error.
The type of the values is not taken into account, so if one of the fields in the union accepts values of an unexpected type,
they will be used for serialization. This can lead to a surprising behavior, because :u=Union(fields=[fields.Integer(),fields.String()])# the Integer field accepts string representations of integerstype(u.deserialize('0'))# -> intIf you want to have precise control of which field will be used for which value, you can usemarshmallow-polyfieldinstead of this library.Documentationhttps://python-marshmallow-union.readthedocs.io/0.1.15 (2020-05-30)ChangesFix#32: Never ignore the value passed to_serialize. Notably, this fixes the serialization of lists of unions, such asList(Union([Int(),String()]))0.1.12 (2019-10-24)Backward-incompatible ChangesOn serialization,marshmallow_union.ExceptionGroupis raised if all candidate fields fail.#240.1.11 (2019-06-19)ChangesOverride the underscore-prefixed methods instead of the plain ones#22Changelog0.1.10 (2019-06-08)ChangesUse Towncrier for changelog.#180.1.0 (2019-06-07)First release on PyPI.
Package: marshmallow-utils
Extras and utilities for MarshmallowFurther documentation is available onhttps://marshmallow-utils.readthedocs.io/ChangesVersion 0.8.2 (released 2023-12-11)html: remove “class” from allowed html attributesVersion 0.8.1 (released 2023-11-29)html: allow table tagsedtf: split date and datetime fieldsVersion 0.8.0 (released 2023-10-25)edtf: allow datetime valueVersion 0.7.1 (released 2023-10-25)fields: Add custom URL field with custom validator allowing_in url domainsVersion 0.6.1 (released 2023-10-19)chore: import parse from babel-edtfVersion 0.6.0 (released 2023-10-11)permission filters: add caching to improve performanceVersion 0.5.8 (released 2022-11-18)Add translationsAdd translations workflowVersion 0.5.7 (released 2022-07-29)Add validation message for unrecognised identifier schemaVersion 0.5.6 (released 2022-05-13)Move from setup.py to setup.cfg for purely declarative package definitions.Fix bug with empty locale on babel gettext_from_dict.Version 0.5.5 (released 2022-03-01)Updated German translations.Version 0.5.4 (released 2022-01-28)i18n: integrate translation flowfields: gettext_from_dict fallback lng to en.dep: bumped sphinx 4.2.0Version 0.5.3 (released 2021-08-03)Fix bug in IdentifierSchema when identifier was not required.Version 0.5.2 (released 2021-08-02)Add group of errors for proper handling of lists.Version 0.5.0 (released 2021-07-08)Refactored to make it easier to use sanitization functions outside of
Marshmallow fields.Version 0.4.0 (released 2021-04-16)Change IdentifierScheme API to allow schemas unknown by IDUtils.Version 0.3.10 (released 2021-04-12)Fix TZDateTime field serialization of None values.Version 0.3.9 (released 2021-04-12)Adds TZDateTime field.Version 0.3.7 (released 2021-03-05)Fix issue in SanitizedHTML to allow passing empty lists to remove all tags.Version 0.3.6 (released 2021-03-04)Serializes None ISODates by removing them.Version 0.3.5 (released 2021-01-25)Adds BabelGettextDictField for dumping translation strings from dicts.Version 0.3.4 (released 2021-01-24)Makes Link field a bit easier to use by allowing a string to be passed
in addition to an URITemplate.Version 0.3.3 (released 2021-01-20)Adds support for automatic scheme detection on identifiers.Adds support for identifier sets.Version 0.3.2 (released 2020-11-10)Adds support for GeoJSON geometry object validation.Version 0.3.1 (released 2020-11-08)Adds support for localization of date, time, datetime, EDTF with string
parsing support.Version 0.3.0 (released 2020-11-06)Adds support for proper localization of EDTF dates.Refactored EDTFDateString field.Version 0.1.5 (released 2020-09-24)Fix to expand querystring params correctlyVersion 0.1.4 (released 2020-09-17)Adds LinksSchema similar to LinksFieldVersion 0.1.3 (released 2020-09-16)Moved additional utilities into the library.Version 0.1.2 (released 2020-09-16)Ported GenFunction and GenMethodVersion 0.1.1 (released 2020-09-11)Minor fix to allow a lower ftfy package version than the latest.Version 0.1.0 (released 2020-09-11)Initial public release.
Package: marshmallow-validators
Homepage:https://marshmallow-validators.readthedocs.io/Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow.frommarshmallowimportSchema,fieldsfrommarshmallow_validators.wtformsimportfrom_wtformsfromwtforms.validatorsimportEmail,Length# Leverage WTForms il8nlocales=['de_DE','de']classUserSchema(Schema):email=fields.Str(validate=from_wtforms([Email()],locales=locales))password=fields.Str(validate=from_wtforms([Length(min=8,max=300)],locales=locales))UserSchema().validate({'email':'invalid','password':'abc'})# {'email': ['Ungültige Email-Adresse.'],# 'password': ['Feld muss zwischen 8 und 300 Zeichen beinhalten.']}Get It Now$ pip install -U marshmallow-validatorsDocumentationFull documentation is available athttps://marshmallow-validators.readthedocs.io/.Project LinksDocs:https://marshmallow-validators.readthedocs.io/Changelog:https://marshmallow-validators.readthedocs.io/en/latest/changelog.htmlPyPI:https://pypi.python.org/pypi/marshmallow-validatorsIssues:https://github.com/marshmallow-code/marshmallow-validators/issuesLicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: marsis
marsisOpen-source processor for the Mars Advanced Radar for Subsurface and Ionosphere Sounding (MARSIS)This software implements several processing routines that, when performed in sequence, transform a MARSIS Experimental Data Record (EDR) into an interpretable data product (a "radargram"). The following processing steps are currently implemented:Parsing of EDR label filesParsing of EDR science and auxiliary data filesDecompression of science dataSeveral modes of ionosphere compensationNo ionosphere compensationIonosphere compensation via:"Campbell method" (https://doi.org/10.1002/2015JE004917)"McMichael method" (https://doi.org/10.1109/RADAR.2017.7944326)
<>        - "Italian method" (https://doi.org/10.1109/RADAR.2008.4720760)
<>    - Dual band range compression with ionosphere compensation that is a hybrid of the Smithsonian and Italian methodsRange compressionThe processor can be used as a command line tool or within a Python script to generate MARSIS radargrams and/or output metdata from the EDR files in a text format.The Campbell method requires a global DEM of Mars, I recommend using this one:https://mchristo.net/data/megr_32ppd.tif(253 MB)Currently there are two command line tools included in the package:marsis_download.py - Script to download a list of MARSIS EDRsmarsis_processor.py - Script to process a single MARSIS EDRUsage instructions can be printed to the terminal withmarsis_download.py --helpandmarsis_processor.py --helpUseful linksMARSIS Planetary Data System (PDS) Page -https://pds-geosciences.wustl.edu/missions/mars_express/marsis.htmUseful informationMARSIS sampling frequency - 2.8 MHzEffective sampling frequency in data files after I/Q conversion - 1.4 MHzChirp center frequencies - 1.8, 3, 4, and 5 MHzChirp bandwidth - 1 MHzChirp duration - 250 μsChirp center frequency in EDR files - 0.7 MHz
Package: mars-mcd-helper
mars-MCD-helperUtilities for retrieving and processing data from the Mars Climate Database.Currently nothing more than an interface towww-mars.lmd.jussie.fr.  Note that
this tool is not in any way affiliated with that excellent project.  It is
simply a requests-based scraper.  Overuse or repetitive fetching could result in
ratelimiting or banning fromjussieu.fr.Usagefrommars_mcd_helperimportfetch_data,read_ascii_dataoutf,imgf=fetch_data(outdir=".",get_img=True,ls=87.4)sections=read_ascii_data(outf)print("Image to compare at",imgf)Requirementsmars-MCD-helper requires Python 3.7 or above.To install Python 3.7, I recommend usingpyenv.# install pyenvgitclonehttps://github.com/pyenv/pyenv~/.pyenv# setup pyenv (you should also put these three lines in .bashrc or similar)exportPATH="${HOME}/.pyenv/bin:${PATH}"exportPYENV_ROOT="${HOME}/.pyenv"eval"$(pyenvinit-)"# install Python 3.7pyenvinstall3.7.12# make it available globallypyenvglobalsystem3.7.12InstallationWithpip:python-mpipinstallmars-mcd-helper# orpython3.7-mpipinstallmars-mcd-helperWithpipx:python3.7-mpipinstall--userpipx

pipxinstall--pythonpython3.7mars-mcd-helper
Package: marso
Marso is a Move language parser that supports error recovery and round-trip parsing
. Marso is also able to list multiple syntax errors in your move source file.Marso has been battle-tested byjedi.Marso consists of a small API to parse Move language and analyse the syntax tree.A simple example:>>>importmarso>>>module=marso.parse('hello + 1',version="3.6")>>>expr=module.children[0]>>>exprPythonNode(arith_expr,[<Name:hello@1,0>,<Operator:+>,<Number:1>])>>>print(expr.get_code())hello+1>>>name=expr.children[0]>>>name<Name:hello@1,0>>>>name.end_pos(1,5)>>>expr.end_pos(1,9)To list multiple issues:>>>grammar=marso.load_grammar()>>>module=grammar.parse('foo +\nbar\ncontinue')>>>error1,error2=grammar.iter_errors(module)>>>error1.message'SyntaxError: invalid syntax'>>>error2.message"SyntaxError: 'continue' not properly in loop"ResourcesTestingPyPIDocsUsessemantic versioningInstallationpip install marsoAcknowledgementsDavid Halter (@davidhalter) for the originalParsoproject.Guido van Rossum (@gvanrossum) for creating the parser generator pgen2
(originally used in lib2to3).Changelog0.0.1 (2020-05-29)Test publish as a pip package, not work yet.
Package: marsrover
marsroverLet's go grow potatoes on Mars!User Guidehttps://becky2sawyer.github.io/mars-roverhttps://pypi.org/project/marsroverquick startpip install marsrovermarsrover-pingmarsrover-ping krmarsrover-ping enimportmarsrovermarsrover.what_about_there()todomarsrover-ping kr "남측 관측소와 연락이 되지 않습니다. 무슨 일인지 알고 계신가요?"
Package: mars-rovers-catalog
Mars Rovers Catalog toolboxInstallpipinstallmars-rovers-catalogPlease refer tonotebooks/folder for an example of how the module works.Local TestingSetup:gitclonehttps://gitlab.univ-nantes.fr/mars-rovers/catalogmars-rovers-catalogcdmars-rovers-catalog

pipinstall-e.
pipinstall-rtests/requirements.txtLinter:flake8catalog/tests/setup.py
pylint--rcfile=setup.cfgcatalog/tests/*.pysetup.pyUnit tests (withpytest):pytest--covcatalogtests/
Package: mars-text-embedding-sdk-python
Examplefrommars_text_embedding_sdk_pythonimportEmbeddingSDK,KeyValue,Object## Create the caller object to end pointsdk=EmbeddingSDK("http://127.0.0.1:4000/graphql")## Create objects consisting of KeyValuesobjects=[Object(key_values=[KeyValue(key="hello",value="world"),KeyValue(key="hello",value="world"),KeyValue(key="you",value="are"),],),Object(key_values=[KeyValue(key="you",value="are"),KeyValue(key="cool",value="beans"),KeyValue(key="cool",value="beans"),])]# Make the call and extract data# If something goes wrong here, check the .error property instead. .data will be None.emb_comp=sdk(objects,dims=300).data# Now, use to_arrays aggregation function to, for instance, aggregate embeddings to their meanarrs=emb_comp.to_arrays(lambdax:x.mean(axis=0))
Package: marstime
This package implements the Mars24 algorithm based on the Allison and McEwan(2000) paper. Details can be found athttp://www.giss.nasa.gov/tools/mars24/. The package is available under the Modified BSD license. Publications using the algorithm should reference the Allison and McEwan (2000) and Allison (1997) papers where appropriate. All mistakes in this code are mine.Christopher Lee, 2011
Package: marstuff
MarstuffAPI Wrapper for NASA's Mars Rover Photos API📝 DescriptionThis is aWork-In-ProgressPython API Wrapper for NASA's Mars Rover Photos API
which provides bothSynchronousandAsynchronoussupport.🔥 Getting Started⬇️ InstallationVia pippip install marstuff✨ Getting a NASA Developer KeyGotohttps://api.nasa.gov/Navigate toGenerate API Keyat the top navbar.Fill in your details, and tapSignupCopy Your API Key⚡ QuickstartSynchronously getting, Viewing and Saving theLatest Photoof NASA'sCuriosityRoverfrommarstuffimportClient# Import the Client classclient=Client("Your API Token")# Make a new Client# Get the latest Photophoto=client.get_latest_photo(client.curiosity)# ORphoto=client.curiosity.get_latest_photo()# Display the Photophoto.show()# Save the Photophoto.save("Latest photo of Curiosity.png")Asynchronously getting all the photos taken by theRear Hazard Avoidance Cameraof NASA'sCuriosityRover on sol3259frommarstuffimportAsyncClient# Import the AsyncClient classfrommarstuff.objects.cameraimportCAMERAS# Import the list of all CAMERASimportasyncio# Import asyncioclient=AsyncClient("Your API Token")# Make a new Client# Make a function for running asyncioasyncdefget_photos():# Get the photo by Curiosity on sol 3259 with the RHAZ cameraphotos=awaitclient.curiosity.get_all_photos_by_sol(3259,CAMERAS.RHAZ)# ORphotos=awaitclient.curiosity.rhaz.get_all_photos_by_sol(3259)print(photos)asyncio.run(get_photos())🧠 General Need-to-Know Stuff!!This API currently provides access to 4 NASA Rovers (Perseverance,Curiosity,Opportunity, andSpirit)
Each rover, takes photos of the surface of mars via different camerasThe cameras of thePerseveranceRover areAbbreviationCameraEDL_RUCAMRover Up-Look CameraEDL_RDCAMRover Down-Look CameraEDL_DDCAMDescent Stage Down-Look CameraEDL_PUCAM1Parachute Up-Look Camera AEDL_PUCAM2Parachute Up-Look Camera BNAVCAM_LEFTNavigation Camera - LeftNAVCAM_RIGHTNavigation Camera - RightMCZ_RIGHTMast Camera Zoom - RightMCZ_LEFTMast Camera Zoom - LeftFRONT_HAZCAM_LEFT_AFront Hazard Avoidance Camera - LeftFRONT_HAZCAM_RIGHT_AFront Hazard Avoidance Camera - RightREAR_HAZCAM_LEFTRear Hazard Avoidance Camera - LeftREAR_HAZCAM_RIGHTRear Hazard Avoidance Camera - RightSKYCAMMEDA SkycamSHERLOC_WATSONSHERLOC WATSON CameraCameras of other Rovers areAbbreviationCameraCuriosityOpportunitySpiritFHAZFront Hazard Avoidance Camera✔✔✔RHAZRear Hazard Avoidance Camera✔✔✔MASTMast Camera✔CHEMCAMChemistry and Camera Complex✔MAHLIMars Hand Lens Imager✔MARDIMars Descent Imager✔NAVCAMNavigation Camera✔✔✔PANCAMPanoramic Camera✔✔MINITESMiniature Thermal Emission Spectrometer (Mini-TES)✔✔You can query viasolorearth_datesolmeansMartian rotation or daywhich can be (0 toCurrent Sol of Rover)earth_dateis in the format ofYYYY-MM-DD