Saravanan666/pypi-org huggingface dataset:
Package: alchemy-graph
:small_red_triangle: alchemy_graph :small_red_triangle:SQLAlchemy mapper to Strawberry types:pencil2: InstallationYou can install mapper using pip:pipinstallalchemy-graphFunctions:get_only_selected_fieldsGiven a SQLAlchemy model class and a Strawberry Info object representing a selection set, returns a SQLAlchemy Select object that loads only the fields and relations specified in the selection set.Parameters:sqlalchemy_class: The SQLAlchemy model class to select fields from.info: The Strawberry Info object representing the selection set.inner_selection_name: The name of an inner selection set to consider. If specified, only fields and relations under this selection set will be included in the Select object.Returns:A SQLAlchemy Select object that loads only the specified fields and relations.orm_to_strawberryFunction maps sqlalchemy model to strawberry class.Parameters:input_data: SqlAlchemy Base Model or list of base models.strawberry_type: Strawberry class wrapped in strawberry.input or strawberry.type.Returns:Strawberry objects or list of them.strawberry_to_dictGiven a Strawberry object and an optional list of allowed keys, returns a dictionary representation of the object.Parameters:obj: A Strawberry object to convert to a dictionary.allowed_keys: An optional list of keys to include in the output dictionary. If not specified, all keys are included.Returns:A dictionary representation of the input object.orm_mapperFunction returns decorator for your Query strawberry.field().Parameters:strawberry_type: Strawberry type that should be return. Required if result_to_strawberry=True.inject_query: Inject into current function SqlAlchemy Query. Default value: False.sqlalchemy_class: SqlAlchemy model class.inner_selection_name: The name of an inner selection set to consider. If specified, only fields and relations under this selection set will be included in the Select object.result_to_strawberry: If True, it returns Strawberry object(s). Default value: True.get_dict_objectGiven an SQLAlchemy object, returns a dictionary representation of the object.Parameters:obj: An SQLAlchemy object to convert to a dictionary.Returns:A dictionary representation of the input object.LICENSEThis project is licensed under the terms of the MIT license.
Package: alchemy-modelgen
sqlalchemy-modelgenCreate sqlalchemy python model files by defining tables and columns in a yaml file or by specifying database urlInstallationpip install alchemy-modelgenUsageInitialize modelgen folder:modelgen init -d /path/to/YOUR_FOLDER
cd /path/to/YOUR_FOLDERCreate sqlalchemy model code from:(Option 1)yamltemplate:For details on how to write the yaml file, please followdocsmodelgen createmodel --source yaml --path templates/example.yaml --alembic # path to your schema yaml file(Option 2)existingdatabase:modelgen createmodel --source database --path mysql+mysqlconnector://root:example@localhost:3306/modelgen --outfile models/YOUR_FILENAME.py --alembicRunning alembic migrations:modelgen migrate revision --autogenerate -m "COMMIT_MESSAGE" -p mysql+mysqlconnector://root:example@localhost:3306/modelgen

modelgen migrate upgrade head -p mysql+mysqlconnector://root:example@localhost:3306/modelgenThe arguments passed aftermodelgen migrateare based on alembic. Any command true foralembiccan be used withmodelgen migrate.The database url can be passed using-por--pathargument, or can be set in the environment by the env varDATABASE_URI. IfDATABASE_URIis set,-por--pathwill be ignoredAlter table support:Change column type, length, add contraint, etc in the yaml file. Then run:modelgen createmodel --source yaml --path templates/example.yaml --alembic
modelgen migrate revision --autogenerate -m "COMMIT_MESSAGE" -p mysql+mysqlconnector://root:example@localhost:3306/modelgen

modelgen migrate upgrade head -p mysql+mysqlconnector://root:example@localhost:3306/modelgenCreditsThe code that reads the structure of an existing database and generates the appropriate SQLAlchemy model code is based onagronholm/sqlacodegen'srepository (Copyright (c) Alex Grönholm), license:MIT License
Package: alchemy-sdk-py
alchemy_sdk_py (Beta)An SDK to use theAlchemy APIalchemy_sdk_py (Pre-Alpha)Getting StartedRequirementsInstallationQuickstartGet an API KeyUseageGet all ERC20, value, and NFT transfers for an addressGet contract metadata for any NFTWhat's here and what's notWhat this currently hasCurrently not implementedGetting StartedRequirementsPython3.7 or higherYou'll know you've done it right if you can runpython3 --versionin your terminal and see something likePython 3.10.6Installationpip3installalchemy_sdk_pyQuickstartGet an API KeyAfterinstalling, you'll need to sign up for an API key and set it as anALCHEMY_API_KEYenvironment variable. You can place them in a.envfile if you likejust please don't push the.envfile to GitHub..envALCHEMY_API_KEY="asdfasfsfasfIf you're unfamiliar with environment variables, you can use the API to set the key directly using the SDK - please don't do this in production code.fromalchemy_sdk_pyimportAlchemyalchemy=Alchemy(api_key="asdfasfsfasf",network="eth_mainnet")If you have your environment variable set, and you want to use eth mainnet, you can just do this:fromalchemy_sdk_pyimportAlchemyalchemy=Alchemy()You can also set the network ID using the chainId, or hex, and even update it later.# For Goerli ETHalchemy=Alchemy(network=5)# For Polygon ("0x89" is hex for 137)alchemy.set_network("0x89")Useagefromalchemy_sdk_pyimportAlchemyalchemy=Alchemy()current_block_number=alchemy.get_current_block_number()print(current_block_number)# prints the current block numberWith web3.pyfromalchemy_sdk_pyimportAlchemyfromweb3importWeb3alchemy=Alchemy()w3=Web3(Web3.HTTPProvider(alchemy.base_url))Get all ERC20, value, and NFT transfers for an addressThe following code will get you every transfer in and out of a single wallet address.fromalchemy_sdk_pyimportAlchemyalchemy=Alchemy()address="YOUR_ADDRESS_HERE"transfers,page_key=alchemy_with_key.get_asset_transfers(from_address=address)print(transfers)# prints every transfer in or out that's ever happened on the addressGet contract metadata for any NFTENS="0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85"contract_metadata=alchemy_with_key.get_contract_metadata(ENS)print(contract_metadata["contractMetadata"]["openSea"]["collectionName"])# prints "ENS: Ethereum Name Service"What's here and what's notWhat this currently hasJust about everything in theAlchemy SDKsection of the docs.Currently not implementedbatchRequestsweb socketsNotify API&filtersieeth_newFilterAsync supportENS Support for addressesDouble check the NFT, Transact, and Token docs for functionTrace APIDebug API
Package: alcherializer
AlcherializerA "Django like" model serializer.Declaring SerializerIt's very simples to declare a serializer. Just like Django, the only
thing you need is to create a class with a Meta class inside and
a model attribute.This instantly maps all fields declared in model.fromdatetimeimportdatetimefromalcherializerimportSerializerimportsqlalchemyfromsqlalchemy.ormimportrelationshipclassManager:name=sqlalchemy.Column(sqlalchemy.String(100))classUser:name=sqlalchemy.Column(sqlalchemy.String(100))age=sqlalchemy.Column(sqlalchemy.Integer)is_active=sqlalchemy.Column(sqlalchemy.Boolean)created_at=sqlalchemy.Column(sqlalchemy.DateTime,default=datetime.utcnow)organization=relationship(Manager,uselist=False)classUserSerializer(Serializer):classMeta:model=UserPS: For further exemplifications we will always useUserandUserSerializer.DataGets a dictionary of a single model.model=User(name="Clark Kent",age=31,is_active=True)serializer=UserSerializer(model)serializer.data# { "name": "Clark Kent", ... }Or, a list of modelsmodel=User(name="Clark Kent",age=31,is_active=True)serializer=UserSerializer([model],many=True)serializer.data# [{ "name": "Clark Kent", ... }]Related SerializersclassManagerSerializer(Serializer):classMeta:model=ManagerclassUserSerializer(Serializer):manager=ManagerSerializer()classMeta:model=Usermodel=User(name="Peter Parker",manager=Manager(name="J. Jonah Jameson"))serializer=UserSerializer(model)serializer.data# {"name": "Peter Parker", "manager": {"name": "J. Jonah Jameson"}}Custom fieldsfromdatetimeimportdatetime,timedeltafromalcherializerimportfieldsclassUserSerializer(Serializer):year_of_birth=fields.MethodField()defget_year_of_birth(self,user:User)->datetime:returndatetime.utcnow()-timedelta(days=user.age*365)classMeta:model=Userfields=["id","name","year_of_birth"]model=User(id=1,name="Batman",age=30)serializer=UserSerializer(model)serializer.data# {"id": 1, "name": "Batman", "year_of_birth": 1991}ValidationTo validate a payload, it's possible to send it through data argument while
instantiating the serializer and call.is_validmethod.serializer=UserSerializer(data={"name":"Clark Kent","age":31,"is_active":True})serializer.is_valid()# TrueFetching validation errorsIf any error happens you can fetch the information through error attribute.serializer=UserSerializer(data={"name":"",# If ommitted or None should present error too"age":31,"is_active":True})serializer.is_valid()# Falseserializer.errors# {"name": ["Can't be blank"]}FieldsThis shows off how fields are mapped from SQLAlchemy models.Model attributeAlcherializer fieldValidationsBooleanBooleanField[x] Required[x] Valid booleanBigInteger, Integer, SmallIntegerIntegerField[x] RequiredString, Text UnicodeStringField[x] Required[x] Max length
Package: alchimia
alchimialets you use most of the SQLAlchemy-core API with Twisted, it does
not allow you to use the ORM.Getting startedfromalchimiaimportwrap_enginefromsqlalchemyimport(create_engine,MetaData,Table,Column,Integer,String)fromsqlalchemy.schemaimportCreateTablefromtwisted.internet.deferimportinlineCallbacksfromtwisted.internet.taskimportreact@inlineCallbacksdefmain(reactor):engine=wrap_engine(reactor,create_engine("sqlite://"))metadata=MetaData()users=Table("users",metadata,Column("id",Integer(),primary_key=True),Column("name",String()),)# Create the tableyieldengine.execute(CreateTable(users))# Insert some usersyieldengine.execute(users.insert().values(name="Jeremy Goodwin"))yieldengine.execute(users.insert().values(name="Natalie Hurley"))yieldengine.execute(users.insert().values(name="Dan Rydell"))yieldengine.execute(users.insert().values(name="Casey McCall"))yieldengine.execute(users.insert().values(name="Dana Whitaker"))result=yieldengine.execute(users.select(users.c.name.startswith("D")))d_users=yieldresult.fetchall()# Print out the usersforuserind_users:print("Username:%s"%user[users.c.name])# Queries that return results should be explicitly closed to# release the connectionresult.close()if__name__=="__main__":react(main,[])DocumentationThe documentation is all onRead the Docs.LimitationsThere are some limitations toalchimia'sability to expose the SQLAlchemy
API.Some methods simply haven’t been implemented yet. If you file a bug, we’ll
implement them! SeeCONTRIBUTING.rstfor more info.Some methods in SQLAlchemy either have no return value, or don’t have a
return value we can control. Since most of thealchimiaAPI is predicated
on returningDeferredinstances which fire with the underlying SQLAlchemy
instances, it is impossible for us to wrap these methods in a useful way.
Luckily, many of these methods have alternate spelling.The docscall these
out in more detail.
Package: alchina
Alchina /al.ki.na/Alchina is a Machine Learning framework.CapabilitiesRegressorsLinear regressorRidge regressorClassifiersLinear classifierRidge classifierClustersK-Means clusteringOptimizersGradient descentStochastic gradient descentMini-batch gradient descentPreprocessorsMin-max normalizationStandardizationPCAMetricsR2 scoreConfusion matrixAccuracy scorePrecision scoreRecall scoreF-Beta scoreF-1 scoreModel selectionSplit dataset
Package: alchql
Please readUPGRADE-v2.0.mdto learn how to upgrade to Graphene2.0.AlchQLASQLAlchemyintegration forGraphene.InstallationFor instaling graphene, just run this command in your shellpipinstall"alchql>=3.0"ExamplesHere is a simple SQLAlchemy model:fromsqlalchemyimportColumn,Integer,Stringfromsqlalchemy.ext.declarativeimportdeclarative_baseBase=declarative_base()classUserModel(Base):__tablename__='user'id=Column(Integer,primary_key=True)name=Column(String)last_name=Column(String)To create a GraphQL schema for it you simply have to write the following:importgraphenefromalchqlimportSQLAlchemyObjectTypeclassUser(SQLAlchemyObjectType):classMeta:model=UserModel# use `only_fields` to only expose specific fields ie "name"# only_fields = ("name",)# use `exclude_fields` to exclude specific fields ie "last_name"# exclude_fields = ("last_name",)classQuery(graphene.ObjectType):users=graphene.List(User)defresolve_users(self,info):query=awaitUser.get_query(info)# SQLAlchemy queryreturnquery.all()schema=graphene.Schema(query=Query)Then you can simply query the schema:query='''query {users {name,lastName}}'''result=schema.execute(query,context_value={'session':db_session})You may also subclass SQLAlchemyObjectType by providingabstract = Truein
your subclasses Meta:fromalchqlimportSQLAlchemyObjectTypeimportsqlalchemyassaimportgrapheneclassActiveSQLAlchemyObjectType(SQLAlchemyObjectType):classMeta:abstract=True@classmethodasyncdefget_node(cls,info,id):return(awaitcls.get_query(info)).filter(sa.and_(cls._meta.model.deleted_at==None,cls._meta.model.id==id)).first()classUser(ActiveSQLAlchemyObjectType):classMeta:model=UserModelclassQuery(graphene.ObjectType):users=graphene.List(User)defresolve_users(self,info):query=awaitUser.get_query(info)# SQLAlchemy queryreturnquery.all()schema=graphene.Schema(query=Query)Full ExamplesTo learn more check out the followingexamples:Flask SQLAlchemy exampleNameko SQLAlchemy exampleFastAPI SQLAlchemy example
Package: alcli
Installing the Alert Logic CLIThepippackage manager for Python is used to install, upgrade and remove Alert Logic CLI.Installing the current version of the Alert Logic CLIAlert Logic CLI only works on Python 3.7 or higher.
Please follow this instructions on how to install Python on your system:https://www.python.org/downloads/Usepip3to install the Alert Logic CLI$ pip3 install alcli --upgrade --userMake sure to use--userto to install the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.Windows installerFor windows users there is self-contained Alert Logic CLI distribution is available, please download latest version from here:executable installation packagemsi installation packageAlternatively, please viewhistoryof the releases.Upgrading to the latest version of the Alert Logic CLIWe regularly introduce support for new Alert Logic services.
We recommend that you check installed packages version and upgrade to the latest version regularly.$ pip3 install --upgrade --force-reinstall alcliConfigure the Alert Logic CLI with Your CredentialsBefore you can run a CLI command, you must configure the Alert Logic's CLI with your credentials.By default,alcliuses ~/.alertlogic/config configuration file in a user's home directory. File can contain multiple profiles. Here's an example of a configuration file that has credentials for an integration and production deployments:[default]
access_key_id=1111111111111111
secret_key=eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
global_endpoint=integration

[production]
access_key_id=2222222222222222
secret_key=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
global_endpoint=productionThe location of the configuration file can be also specified by settingALERTLOGIC_CONFIGenvironment variable to contain file's location.Notes:--queryoption requires JMESPath language expression. Seehttp://jmespath.org/tutorial.htmlfor language tutorial.=======
History1.0.1 (2020-02-06)First release on PyPI.1.0.7 (2020-02-07)First version of main help page and bug fixes.
Package: al-cloudinsight
This is an example project which shows how to access the Cloud Insight API using Python.
OverviewThe Cloud Insight API is a REST API which provides many services related to the Cloud Insight system. The data transmission protocol is JSON objects. The API receives and sends answers as JSON objects and HTTP errors or confirmation as HTTP status code. The CloudInsightAPI class provides an interface and some example methods to access the Cloud Insight API. All the objects accessed by the CloudInsightAPI class will have the JSON response converted to generic Python objects (Bunch) which can have their properties accessed by obj.property syntax instead of dictionary syntax. The print of the objects will return a JSON formatted string to facilitate the visualization of the object data. The requests are made using the Requests library and will raise requests.exceptions.RequestException when some request fail according to the status code error.The program.py provide an example of a command line script implementation of the CloudInsightAPI class
Package: alcohol
.. code::from alcohol.mixins.sqlalchemy import SQLAlchemyUserMixinclass User(Base, SQLAlchemyUserMixin):id = Column(Integer, primary_key=True)bob = User()# stores a hash of bobs password (using passlib)bob.password = 'bobs_very_secret_password'if bob.check_password(some_password):print 'hello, bob!'# creates a password-reset token that will work once to change his password# after he forgot it, signed with the servers secret keytoken = bob.create_password_reset_token(SECRET_KEY)alcohol is a framework for handling user :doc:`authentication` and:doc:`authorization`. Both of these parts can be used independently and supportSQLAlchemy_ and in-memory backends.Authorization is handled using *Role Based Access Controls* (a`NIST <https://en.wikipedia.org/wiki/NIST>`_-standard) as the underlyingmodel::from alcohol.rbac import DictRBACacl = DictRBAC()acl.assign('bob', 'programmer')acl.assign('alice', 'ceo')acl.permit('programmer', 'run_unittests')acl.permit('ceo', 'hire_and_fire')acl.allowed('bob', 'run_unittests')    # Trueacl.allowed('bob', 'hire_and_fire')    # Falseacl.allowed('alice', 'hire_and_fire')  # True.. this should be put back in once flask-alcohol is stable/in better shape.. While suitable for use in stand-alone, non-web applications it is also a core.. ingredient to `Flask-Alcohol <http://pypi.python .org/pypi/flask-alcohol/>`_, a.. `Flask <http://flask.pocoo.org/>`_ library that takes this concept even.. further.Utilities---------alcohol also ships with a few SQLAlchemy_ mixins for handling updated/modifiedtimestamps, email fields, password-hashes and generating activation/resettokens for the latter two. See :doc:`mixins` for details... [1] http://csrc.nist.gov/rbac/sandhu-ferraiolo-kuhn-00.pdf.. _SQLAlchemy: http://www.sqlalchemy.org/
Package: alcom
ALCOMComments aligner for assemblerCode factorPlatformsPacket infoInstallationFromPyPipy-mpipinstallalcom
pip3installalcomUsageCLI Optionsshortlongdescriptionhelp-f--fileSets filename for aligningIf not setted it will align all files in directory recursively-nbc--align_no_blank_commentsLave no blank commentsIf not setted no splitters would be placed after codelineRunningalcom
alcom-fasmfile.asm
alcom-fasmfile.asm-nbcExampleBefore.MODELTINY;set memory model.DOSSEG.DATAMSGDB"Hello,World!",0Dh,0Ah,'$'; message.CODE.STARTUPMOVAH,09h; moves 09h into ahMOVDX,OFFSETMSGINT21h;run int 21hMOVAH,4ChINT21h;exitENDAfter.MODELTINY;    set memory model.DOSSEG;.DATA;MSGDB"Hello,World!",0Dh,0Ah,'$';    message.CODE;.STARTUP;MOVAH,09h;    moves 09h into ahMOVDX,OFFSETMSG;INT21h;    run int 21hMOVAH,4Ch;INT21h;    exitEND;TipsVS CodeTo add auto aligning after save:AddRun on SaveextensionPressctrl+Pand search forPreferences: Open Workspace Settings (JSON)Add code below into the opened file and save{"emeraldwalk.runonsave":{"commands":[{"match":".asm","cmd":"alcom -nbc"}]}}You are done!TODO[❌] Add marging options[❌] Issue that comments separator cam be placed in strings
Package: alcpack
ALCPackA python package to create an edge between any two given nodes in a simple, connected, and undirected graph via a sequence of local complementation operations.RequirementsALCPackis developed based onPython 3.0(or more recent releases), and usesNetworkX-- A python package to analyze complex networksInstallationTo installALCPackusingpip:$ python3 -m pip install --upgrade pip$ python3 -m pip install alcpackThe steps to build the package locally for installation viapipare given inALCPack_References, available in thedocumentationfolder.DescriptionALCPackprovides three functions, as listed below.local_complementation(G, target):Performs a local complementation operation on the input graph G w.r.t. the node 'target' and returns the transformed graphpath_category(G, path):Determines the category of a simple path connecting two chosen nodes in a simple, connected, and undirected graph, and distills a category 1 path out of the chosen path, if the chosen path is of category 2. Returns the category (category 1 or category 2) of the chosenn path, and a distilled category 1 path (chosen path) if the chosen path is of category 2 (category 1)alc_function(G, path):Performs adaptive local complementation operation on the input graph G w.r.t. the chosen simple path 'path'. Returns the modified graph with an edge between the source and the destination nodesUseTo callALCPackfunctions in the Python 3.0 (or higher) environment,>>> import alcpack as alcTo useALCPackfunctions in the Python 3.0 (or higher) environment,>>> H=alc.local_complementation(G,target)>>> n,newpath=alc.path_category(G,path)>>> H=alc.alc_function(G,path)The parameters used in the functions are as below.InputG: Networkx graph, Input parameterpath: List of nodes, Input parameterRepresents a path between a source (first node in 'path') and a destination (last node in 'path')target: Node, Input parameterRepresents a node with respect to which the local complementation operation is performedOutputH: NetworkX graph, Output parameterTransformed graph due to ALCPack functionsn: Integer, Output parameterTakes value 1 or 2, represents the category of the input 'path'newpath: List of nodes, Output parameterCategory 1 pathInformation on the theoretical background ofALCPackis given inALCPack_References, which is available in thedocumentationfolder.
Package: alcss
✨ ALCSS ✨Aligner of a splitter in css filesExampleImagine you have file -my-awesome-style.cssbody{margin:25px;background-color:rgb(240,240,240);font-family:arial,sans-serif;font-size:14px;}Run this programalcssmy-awesome-style.cssResultbody{margin:25px;background-color:rgb(240,240,240);font-family:arial,sans-serif;font-size:14px;}RequrirementsCheck that you have:python 3.xpip(optionally)InstallationThis program can be installed frompypipy-mpipinstallalcss
pip3installalcssArgumentsshortlongdescriptiondefault-l--lmarginSets spaces before:character2-r--rmarginSets spaces after:character2-i--indentSets indentation inside {} block4-s--shoutForces program to print info to stdoutFalse-h--helpShows helpOptions meaningdiv{____border_____:_____1pxsolidblack;↑↑↑indentlmarginrmargin}TipsUse after default formmater of VS code as default formatter removes spaces before:characterTo add auto aligning after save:Add Run on Save extensionPress ctrl + P and search for Preferences: Open Workspace Settings (JSON)Add code below into the opened file and save{"emeraldwalk.runonsave":{"commands":[{"match":".css","cmd":"alcss ${file}"}]}}
Package: alda-python
alda-pythonPython client for Alda (https://alda.io/).UsageDownload and install Alda per theInstall instructionsRun the Alda REPL as a server using port 12345:$ alda repl --server --port 12345In a different terminal, run an interactive Python session (e.g. IPython)Installalda-python!pip install --user alda-pythonImport and initialize the Alda Python client:from alda import Client

client = Client()Create some Alda code, for example:code = """ 
    (tempo! 90) 
    piano:  
        o3 c1/e/g/b | f2/a/>c/e ~ <e2/g/b/>d 
    violin: 
        o2 c1 ~ | f2 ~ g2 
    percussion: 
        o2 [c8 r8 c8 r8 e8 c8 r8 c8] * 2 
"""Play the code:client.play(code)