Saravanan666/pypi-org huggingface dataset:
Package: python-athena
PyAthenaA python client to query on Athena Database. Query results are formatted in pandas dataframe.Installpipinstallgit+https://github.com/yardstick17/PyAthena.gitUsageIn[9]:fromathenaimportAthenaIn[10]:query="""SELECT col1, col2, col3, col3FROM "database"."table1"WHERE col1 = 'PI912A0CV-O12'AND col2 = '2019-03-04'AND schema='best_model_ever'"""In[11]:df=athena_client.execute_with_pandas(query=query)In[12]:df.head()Out[12]:col1col2col3col30PI912A0CV-O122019-03-040.02.6231551PI912A0CV-O122019-03-040.02.0952562PI912A0CV-O122019-03-040.01.9049613PI912A0CV-O122019-03-040.00.8293324PI912A0CV-O122019-03-040.00.058469
Package: pythonatinsta
“””AuthorEng. Nasser AlOstathnasser@dotslashhack.iopythonatinstagramtool, is a simple library/bot developed by The CEO of www.dotslashhack.io for educational perposes as an asset code to an article
written in arabic for www.pythonat.com that talks about writing and uploading a user built python package to pypi.org
so that it can be installed using pip.this library is opensource that yields to the MIT license.for more information, please check www.pythonat.com
or
www.dotslashhack.io to contact the authorthis library is build mainly on top of selenium and webdriver-managerthe webdriver-manager library is usefull because it will automatically find and download the suitable browser webdriver depending on it’s version and OS.NOTE:it is always better to keep you instagram credentials in a separate file and import them here“””Change Log0.0.1 (3/2/2021)First Release
Package: pythonat-instalib
Author : Eng. Nasser AlOstathnasser@dotslashhack.iopythonatinstagramtool, is a simple library/bot developed by The CEO ofwww.dotslashhack.iofor educational perposes as an asset code to an article written in arabic forwww.pythonat.comthat talks about writing and uploading a user built python package to pypi.org so that it can be installed using pip.this library is opensource that yields to the MIT license.for more information, please checkwww.pythonat.comorwww.dotslashhack.ioto contact the authorthis library is build mainly on top of selenium and webdriver-managerthe webdriver-manager library is usefull because it will automatically find and download the suitable browser webdriver depending on it’s version and OS.NOTE:it is always better to keep you instagram credentials in a separate file and import them hereinstallationpip install pythonat-instalibusage# importing username and password of instagram account from a separate auth.py file
from auth import username,password

#creating a bot instace with credentials
bot = Bot("chrome",username,password)

#searching using a keyword
bot.find("#plymouthroadrunner")

# getting images and posts
posts, images = bot.get_posts(10)

# creating a folder of downloaded images
bot.download_pics_from_page(images,"./plymouthroadrunner","Roady")
Package: python-attribute-access-modifiers
python-attribute-access-modifiersTired of typing@propertyjust to make a read-only instance variable? Find yourself wishing for C#'s{get; set;}syntax? Look no further than PAAM, which auto-generates property getters, setter, and deleters for you!QuickstartOnce installed, just use the overloaded|operator between an instance variable and one of the predefined constantsGET,SET, orDEL. Make sure to subclass fromPaamBase.frompaamimportSET,PaamBaseclassTest(PaamBase):def__init__(self,a:int):self.a=a|GET# write to self.a (not self._a) because PAAM creates setters/getters/deleters *after* __init__ finishes>>>obj=Test(15)>>>obj.a>>>15>>>obj.a=5# raises AttributeError: can't set attributeProperty access modifiers can also be chained (order doesn't matter):frompaamimportSET,GET,DEL,PaamBaseclassTest(PaamBase):def__init__(self,a:int):self.a=a|GET|SET>>>obj=Test(15)>>>obj.a>>>15>>>obj.a=5>>>obj.a>>>5>>>delobj.a# raises AttributeError: can't delete attributeCaveats (all planned to be fixed in future release)The type of any variable "annotated" withGET,SET, orDELis_PropertyAccessModifierBase. This meansmypysupport and IDE type hinting are most likely broken.No tests
Package: python-auditor
pyauditorpyauditoris a Python library which simplifies the interaction with AUDITOR from Python.For more information pleasevisit our website.pyauditor Documentation|Auditor DocumentationLicenseLicensed under either ofApache License, Version 2.0, (LICENSE-APACHEorhttp://www.apache.org/licenses/LICENSE-2.0)MIT License (LICENSE-MITorhttp://opensource.org/licenses/MIT)at your option.ContributionUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Package: python-authentiator
python-authentiatorTOTP based on pythonHomepage:https://github.com/zzzzls/python_authentiatorfrompython_authentiatorimportTOTPg_auth=TOTP(origin_secret='123456',label='demo',account='example@gmail.com')# 生成密钥secret=g_auth.generate_secret()# 生成一次性密码print(g_auth.generate_code(secret))# 生成二维码print(g_auth.generate_qrcode(secret))
Package: python-authorization
Simple python authorizationThis module was created to provide a simple authorization method to be used in service to service authorization.How to useImportant note about the credentials backend:At this moment we do not provide a backend to store credentials. We receive a dict containing all the valid credentials following this format:{"app_key":["app_name","secret"]}Create a middleware in your API that receives the Authorization header and passes it to the package to ensue that the token is valid. In the above example we have a simple endpoint that validates the authentication based on a local dictionary as a credentials backend. Ideally you will implement a credential repository and pass the valid credentials to the module.fromhttpimportHTTPStatusfromflaskimportrequest,jsonify,Flaskfrompython_authorizationimportAuthorizationapp=Flask(__name__)@app.route('/')defdummy_endpoint():authorization_header=request.headers.get('Authorization')py_auth=Authorization(authorization_header,valid_credentials_dict={'valid_app_key1':['valid_app_name','valid_secret']})# This method will only validate the format of the tokenis_valid=py_auth.validate_token_format()ifnotis_valid:return(jsonify({'Message':'Invalid authorization token format'}),HTTPStatus.UNAUTHORIZED)# This method will asume that the token is in a valid format and will try to validate itis_authorized=py_auth.validate_token()ifnotis_authorized:return(jsonify({'Message':'Invalid authorization token'}),HTTPStatus.UNAUTHORIZED)return(jsonify({'Message':'You are in!'}),HTTPStatus.OK)app.run('0.0.0.0',port=5000)You can also use this module to authenticate at a service using the Credentials class.frompython_authorizationimportCredentialscredentials_factory=Credentials('valid_app_name','valid_app_key1','valid_secret')token=credentials_factory.build_token()print(f'This is my token:{token}')
Package: pythonautogui
Python Auto GUIGenerate a Tkinter GUI from any Python programCreates a Tkinter GUI to replace any command line interfaceInterprets your existing code, removing the need for programming a GUI by hand.Dynamically generates tidy applications, with quality of life features such as exporting data to CSV or PDF.A choose-your-own adventureA simple maths quizA hello world exampleQuick-startfromautoguiimportprint,input,run# import overrides, and run functionrun()# start GUI10 second examplefromautoguiimportprint,input,run# import overrides, and run functionrun()# start GUImyAnswer=input("What is your name?")# renders a textbox and waits for user inputinput("Click me to continue")# renders a button and waits for user inputprint("Hello, "+myAnswer)# renders textFunctionFeatureinput()Creates a button and waits for the user to press itvar = input()Creates a text box and waits for the user to enter an inputprint()Creates a label with the passed textFooter + export optionsfromautoguiimportinput,run,footer# import overrides, and run + footer functionsrun()# start GUImyAnswer=input("What is your name?")# renders a textbox and waits for user inputfooter()# renders a footer with export optionsThe footer function is an optional function that can be called at the end of your program to render a footer with export options.These export options are:ExportFunctionCSVExport Q/A's as a CSV file.PDFExport as a PDF document (currently TODO).JPGExport as a JPG image (currently TODO).PDF and JPG export are not yet implemented, as usual methods of exporting the tkinter canvas using postscript don't support export of widgets.Explaining the codeIn order to work as a drop-in solution for existing code, we override existing functions in the Python language.Print: The print function is overridden to create a label with the passed text.Input: The input function analyzes the function call to determine if the user is requesting a text box or a button. If the function saves the returned value to a variable, it will create a text box. If the function output is not saved to a variable, it will create a button.Thread communication: The Tkinter GUI runs in a seperate thread to the main application, in order to prevent UI blocking. Communication between the main application and the GUI is done using queues. Print and Input functions place messages in the queue, and the GUI reads them and renders the appropriate UI. The GUI can also place messages on a seperate queue, for instance to return user input from text boxes or buttons to the main application.ThemeingTkinter supports themes to improve the default look and feel of the GUI.rdbende/Azure-ttk-themeis the theme used in screenshots for this package (with "light" (default) and "dark" themes).
If no theme folder is found inthemes/azure.tclrelative to the main.pyfile, the default tkinter theme is used.Setting a new themefromautoguiimportprint,input,run# import overrides, and run functionrun(theme_name="light",theme_source="folder/new_theme.tcl")# start GUILicenseMIT
Package: python-autologs
python-autologsAuto generate logs for functions based on function docstringDecorator to generate log info and log error for function.
The log contain the first line from the function docstring and resolve
names from function docstring by function args, any args that not
resolved from the docstring will be printed after.
In some cases only info or error log is needed, the decorator can be
called with @generate_logs(error=False) to get only log INFO and vice versaExample:
@generate_logs()
def my_test(test, cases):
'''
Run test with cases
'''
returnmy_test(test='my-test-name', cases=['case01', 'case02']
Will generate:
INFO Run test my-test-name with cases case01, case02
ERROR Failed to Run test my-test-name with cases case01, case02
if step is True:
Test Step   1: Run test my-test-name with cases case01, case02
Package: python-automata
Automata========Automata is a customized personal assistant module which can be integrated with your python scripts. You can easily plug your own modules with it and that's not even the best part :)Installation------------```pip install python-automata```Usage-----### Example```pythonfrom automata import automataob = automata.Automata()res = ob.execute('What is the meaning of life?')print res```### Output```bashThe answer to the ultimate question of life, the universe and everything is 42.```It has some pre defined modules like:1. Telling day, date and time2. Finding meaning of words3. Telling meaning of life for the lost soulsTo develop your own module, follow the module development guide below.Module dev guide----------------Below are some general guidelines for developing your own module:* The name of the python script should always start from ```mod_```. Example ```mod_time.py```* It should have a global list named **KEYWORDS** containing some keywords which will trigger this module. Example for the ```mod_time.py```, the list is something like this ```KEYWORDS = ['what', 'time']```* Every module should contain a method named ```run(query='')``` which will receive the input query. Example:```pythonfrom datetime import datetimeKEYWORDS = ['what', 'date']def run(query=''):return datetime.now().strftime("%Y:%m:%d")```* The ```run(query='')``` should return the response generated by it which could be used for further processing.* Any processing of the input query should be done in the ```run(query='')``` method.* These modules should be places in a single folder and you need to give the path to that module while instantiating the **Automata class**. Example;```pythonfrom automata import automataob = automata.Automata('/Users/testuser/modules')res = ob.execute('What is the meaning of life?')print res```Note: Contributions and suggestions are always invited
Package: python-auto-mock
auto_mockis a module for mocking during unit testing.
It automatically replaces all variables and functions external to the unit with default values to help developers exclude external state in their unit tests.Installationpip installpython-auto-mockUsageIn the example we will be making use of myclass.pymyclass.pyX=1Y=2Z=3classMyClass():defaddition_with_globals(self):print(X)print(Y)print(X+Y)returnX+YTo test this class we will write a test script.importauto_mockdeftest_my_class_addition():stubs={'X':36,'Y':35,}withauto_mock.full_mock('myclass','MyClass.addition_with_globals',stubs)asaddition_with_globals:ifaddition_with_globals()!=71:print("Addition is broken")defmain():test_my_class_addition()main()Done correctly this should print out36
35
71full_mocktakes 3 non optional arguments.The module name where the code is located.The specific function or method that is being tested.The dictionary of stubs/mocks that you would like to override the values with.The stubs variable contains the names of the variables that are being mocked.
In this example we haveX,Y, andZas global variables.
We only useXandYin this example, so they are the only variables that are in the stubs dictionary.full_mockreturns the function or method that you are trying to test with the external variables mocked.
If the variable is not within the stubs then it is mocked with a default object.
Inside the with block you can test that the function does what it is supposed to do.
Package: python-autoviv
python-autovivThe Autovivification library for PythonInstallationAdd this line to your application's requirements.txt:python-autovivAnd then execute:$ pip install -r requirements.txtOr install it yourself as:$ pip install python-autovivUsageImport autoviv and call parse on any list, dict, or primitive. You can also call loads on serialized JSON>>>importautoviv>>>importrequests>>>r=requests.get('http://jsonplaceholder.typicode.com/users')>>>users=autoviv.parse(r.json())>>># or...users=autoviv.loads(r.text)>>>foruserinusers:...print(user.name)...LeanneGrahamErvinHowellClementineBauchPatriciaLebsackChelseyDietrichMrs.DennisSchulistKurtisWeissnatNicholasRunolfsdottirVGlennaReichertClementinaDuBuque>>>user=users[0]>>>print(autoviv.pprint(user,indent=4)){"username":"Bret","website":"hildegard.org","name":"Leanne Graham","company":{"bs":"harness real-time e-markets","name":"Romaguera-Crona","catchPhrase":"Multi-layered client-server neural-net"},"id":1,"phone":"1-770-736-8031 x56442","address":{"suite":"Apt. 556","street":"Kulas Light","geo":{"lat":"-37.3159","lng":"81.1496"},"zipcode":"92998-3874","city":"Gwenborough"},"email":"Sincere@april.biz"}>>>user.name='auto-vivification'>>>r=requests.put('http://jsonplaceholder.typicode.com/users/{0}'.format(user.id),json=user)>>>response=autoviv.parse(r.json())>>>print(response.name)auto-vivification>>>new=autoviv.parse({})>>>new.id=5>>>ifnotnew.username:...new.username='New User'...>>>new.address.geo.lat="-42.3433">>>new.address.geo.lng="74.3433">>>new.email='someone@somewhere.biz'>>>print(autoviv.pprint(new)){"username":"New User","email":"someone@somewhere.biz","id":5,"address":{"geo":{"lat":"-42.3433","lng":"74.3433"}}}NonePropIt should be noted that missing referenced properties, including nested, are gracefully falsey.>>>importautoviv>>>data=autoviv.parse({})>>>data.property.is_none>>>bool(data.property.is_none)False>>>isinstance(data.property.is_none,autoviv.NoneProp)True>>>'some data'indata.property.is_noneFalse>>>[xforxindata.property.is_none][]>>>data.property.is_none=None>>>isinstance(data.property.is_none,autoviv.NoneProp)False>>>print(autoviv.pprint(data)){"property":{"is_none":null}}TestingInstall test dependencies with pipenv.$ pip install pipenv
$ pipenv install -d
$ ./test.shContributingBug reports and pull requests are welcome on GitLab athttps://gitlab.com/tysonholub/python-autoviv.git. This project is
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to theContributor Covenantcode of conduct.LicenseThis package is available as open source under the terms of theMIT License.
Package: pythonav
python-avpython-av is a FORK of PyAV.conda-forge package currently not availablepython-av is a Pythonic binding for theFFmpeglibraries. We aim to provide all of the power and control of the underlying library, but manage the gritty details as much as possible.python-av is for direct and precise access to your media via containers, streams, packets, codecs, and frames. It exposes a few transformations of that data, and helps you get your data to/from other packages (e.g. Numpy and Pillow).This power does come with some responsibility as working with media is horrendously complicated and python-av can't abstract it away or make all the best decisions for you. If theffmpegcommand does the job without you bending over backwards, python-av is likely going to be more of a hindrance than a help.But where you can't work without it, python-av is a critical tool.InstallationDue to the complexity of the dependencies, python-av is not always the easiest Python package to install from source. Since release 8.0.0 binary wheels are provided onPyPIfor Linux, Mac and Windows linked against a modern FFmpeg. You can install these wheels by running:pipinstallpython-avIf you want to use your existing FFmpeg, the source version of python-av is onPyPItoo:pipinstallpython-av--no-binaryavAlternative installation methodsAnother way of installing python-av is viaconda-forge:condainstallpython-av-cconda-forgeSee theConda installdocs to get started with (mini)Conda.And if you want to build from the absolute source (for development or testing):gitclonegit@github.com:dot-six/python-avcdpython-avsourcescripts/activate.sh<FFMPEG-VERSION># Either install the testing dependencies:pipinstall--upgrade-rtests/requirements.txt# or have it all, including FFmpeg, built/installed for you:# For developers, this is recommended:./scripts/build-deps# If you have problem doing build-deps, read this wiki:# http://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu# NOTE: disable all non-server libraries, it is not needed.# Build python-av.makeHave fun,read the docs,come chat with us, and good luck!
Package: python-avm
Advanced Variable Manager: avmBy Grosse pastèque#6705WARNING :This modules need some typing modifications !If you try to run it without these modifications, an Error will occur.For more informations goHereUsage :Function's args type checkingFunction's args fast convertingPattern matchingVariable checkingMore typesInstallation :This module is now disponible on PyPi since version 0.9.1
So you can dopython -m pip install python-avmorpip install python-avmThen you will be able to use it as a module.importavm...Functionnalities :Functions :FunctionsDecoratorUsagetype_checkYESCheck function's args typesconvertorYESConvert function's args valuesparametersNOReturn all arguments of the passed functionstr_ofYESReturn a string vizualisation of the given classadd_ctypeYESAdds a custom type tocustom_typeslength_checkYESCheck the length `(int: max-lenght, int: max-lenght)custom_typesNOVariable that contains all the Custom Typestuple_checkNOChecks a tuple, used foravm.UnioncisinstanceNOPythonisinstancebut supports custom typesis_type_tupleNOChecks if the given argument is a tuple of types or custom typesis_lengthNOChecks if the given argument is a lenght `intexp_checkNOChecks the result of an expression, (likeTrueis valid)Custom Types :CTypeHas argumentsUsageGeneratorNOGenerator checkingFunctionNOFunction checking (NB: lambda functions type is also function)MethodNOMethods checkingModuleNOModule checkingBRangeYESBetterrangeand checkingLengthYESContainer length checkingClassYESClass checking (is_init=False)UnionYESValue type in*argsFloatYESBetter float checkingFileYESFile checking (checks if file exists)DictYESBetter dict checkingIntYESBetter int checkingStrYESBetter str checkingImportant Features :FunctionUsagePatternCheck a variable for the given pattern (uses recursions)CTypeUsed as parent for new custom typesExamples :I have created three examples to help you understand a bit more if you want.
InHere.
Package: python-awair
python_awairThis is an async library which accesses portions of theAwairREST API. It exists primarily
to support the Home Assistant integration, but is considered active and supported by its author. PRs welcome!Features:Object-oriented approach to querying and handling dataSupports the "user" portion of the API.Possible to list devices, user information, and to query for a variety of sensor data over various timeframes.Not yet supported:Device API usageOrganization APIDevice management (such as changing the display of a device)Dive into ourdocumentationto get started!DevelopmentWe manage dependencies and builds viapoetryWe usepytestandtoxto testA variety of linters are available and CI enforces themAfter installing and configuring poetry:Runpoetry installto install dev dependenciesRunpoetry shellto drop into a virtualenvRunpoetry run tox(or justtoxif you're in a virtualenv) to testRunpoetry run tox -e lint(or justtox -e lintif you're in a virtualenv) to run linters.
Package: python-awair-local-sensors
python_awairThis is an async library which accesses portions of theAwairREST API. It exists primarily
to support the Home Assistant integration, but is considered active and supported by its author. PRs welcome!Features:Object-oriented approach to querying and handling dataSupports the "user" portion of the API.Possible to list devices, user information, and to query for a variety of sensor data over various timeframes.Not yet supported:Device API usageOrganization APIDevice management (such as changing the display of a device)Dive into ourdocumentationto get started!DevelopmentWe manage dependencies and builds viapoetryWe usepytestandtoxto testA variety of linters are available and CI enforces themAfter installing and configuring poetry:Runpoetry installto install dev dependenciesRunpoetry shellto drop into a virtualenvRunpoetry run tox(or justtoxif you're in a virtualenv) to testRunpoetry run tox -e lint(or justtox -e lintif you're in a virtualenv) to run linters.
Package: python-awis
WrapsAlexa Web Information Service.UsageMakingUrlInforequests:api = AwisApi(ACCESS_ID, SECRET_ACCESS_KEY)
tree = api.url_info("www.domain.com", "Rank", "LinksInCount")
elem = tree.find("//{%s}StatusCode" % api.NS_PREFIXES["alexa"])
assert elem.text == "Success"BatchUrlInforequests:tree = api.url_info(("example1.com", "example2.com", "example3.com"), "Rank", "LinksInCount")MakingSitesLinkingInrequests:api = AwisApi(ACCESS_ID, SECRET_ACCESS_KEY)
tree = api.sites_linking_in('metmuseum.org', count=20, start=0)
for element in tree.findall('//awis:SitesLinkingIn/awis:Site', api.NS_PREFIXES):
    print element.find('awis:Title', api.NS_PREFIXES).text
    print element.find('awis:Url', api.NS_PREFIXES).textBatchSitesLinkingInrequests:tree = api.sites_linking_in(['metmuseum.org', 'wikipedia.org'])MakingCategoryListingsrequests:api = AwisApi(ACCESS_ID, SECRET_ACCESS_KEY)
tree = api.category_listings("Top/Business/Financial_Services")
for item in tree.findall("//{%s}DataUrl" % api.NS_PREFIXES["awis"]):
    print(item.text)ChangelogChanges since version 1.0Added support for batch requests.AddedSitesLinkingInrequest support.Changes since version 1.1AddedCategoryListingsrequest support.