Saravanan666/pypi-org huggingface dataset:
Package: python-defer
python-deferGolang-styledeferwith no decorators!Deferis an awesome control flow construct. Python implementations have historically relied oncumbersome decoratorsor other manual coordination. No more!Usepython-deferto schedule code to be run at the end of a function, whether or not anything fails. Think of it like an automagicfinallyblock that you can use inline anywhere.Check out theblog postto learn how this was built.Install$pipinstallpython-deferUsageThe default way to usepython-deferis true magic. Simply write your code and append anin deferto it.fromdeferimportdeferdeffoo():print(", world!")indeferprint("Hello",end="")# do something that might fail...assert1+1==3$pythonfoo.pyHello, World!Traceback (most recent call last):File "foo.py", line 7, in <module>assert 1 + 1 == 3AssertionErrorSugarfree for me!If you prefer a more explicit approach, you can use thedfunction, which takes alambda.fromdefer.sugarfreeimportdeferasddeffoo():d(print,"1")print("2")d(lambda:print("3"))raiseRuntimeError("oh no!")print("4")$pythonfoo.py231Traceback (most recent call last):File "foo.py", line 7, in <module>RuntimeError: oh no!
Package: python-deform
Python client for [Deform.io](https://deform.io).[Client documentation](http://deformio.github.io/python-deform/).## TestsInstall tox:$ pip install toxFor running tests you need to provide all required ENV variables. For example
next command will fail:$ tox
ValueError: You should provide “DEFORM_HOST” environ for settingsYou can send variables with command:$ DEFORM_HOST=‘“deform.io”’ toxThe more convenient way would be to create a.test_configfile a save data there.
This file is ignored by git and won’t be commited.$ cat .test_config
DEFORM_HOST=‘“deform.io”’
DEFORM_EMAIL=’”email@example.ru”’
DEFORM_PASSWORD=‘“hello”’
…You can run tests with config from file like this:$ eval $(cat .test_config) toxAll config values must be specified with JSON types.Running tests just for one environment:$ eval $(cat .test_config) tox -e py3Running tests from directory:$ eval $(cat .test_config) tox -e py3 – tests.unit.clientRunning the specific test case:$ eval $(cat .test_config) tox -e py3 – tests.unit.client.tests:ClientTest__login### CodestyleChecking for pep:$ tox -e flake8Checking for imports:$ tox -e isortIf you have any problems with imports just run automatic manual fix:$ tox -e isort-fix### DocumentationDocumentation is generated by [http://www.mkdocs.org/](http://www.mkdocs.org/)$ pip install -r requirements/docs.txt
$ invoke build-docsFor development:$ invoke serve-docs## Publishing new releasesIncrement version inpydeform/__init__.py. For example:__version__ = ‘0.0.2’  # from 0.0.1Run tests.Commit changes with message “Version 0.0.2”Publish to pypi:$ python setup.py publishAdd new tag version for commit:$ git tag 0.0.2Push to master with tags:$ git push origin master –tags## Todo:Python 3 support
Package: python-delairstack
This SDK offers a high-level Python interface toDelair.ai APIs.⚠️ DeprecationThis repo is replaced byalteia-python-sdk.python-delairstackis now deprecated, and you should consinder to upgrade to thealteiapackage.Refer to thedocumentationfor installation and usage instructions.Installationpipinstallpython-delairstack*requires Python >= 3.4Basic usagefromdelairstackimportDelairStackSDKsdk=DelairStackSDK(user="YOUR_EMAIL_ADDRESS",password="YOUR_PASSWORD_ON_DELAIR.AI")projects=sdk.projects.search(name='*')forprojectinprojects:print(project.name)# My awesome project📕 DocumentationReference documentationGetting started Jupyter notebook
Package: python-demo
installpython3 -m pip install --user --upgrade setuptools wheel twine
python setup.py sdist
twine check dist/*pypi配置文件 ~/.pypirc[distutils]
index-servers = localhost pypi

[localhost]
repository: http://localhost:8080
username: keefe
password: 123456

[pypi]
repository: https://upload.pypi.org/legacy/
username: keefe
password:上传到pypi# 上传到pypi官服 https://upload.pypi.org/legacy/  bdist_wheel~whl包
python setup.py bdist_wheel upload 
或者
twine upload dist/*

# 上传到私服, sdist~源码包
python setup.py sdist upload -r localhost
Package: python-depends
python-dependsAFastAPIlike dependecy injectorInstall# stable
pip3 install python-depends

# latest
pip3 install git+https://github.com/Dimfred/depends.gitExamplesfromdependsimportDepends,injectasyncdefd1():# do some stuff, which takes longreturn"some stuff"asyncdefd2():# do some other stuff, which also takes longreturn"some other stuff"# inject the dependency into a function@injectasyncdefmain(d1_=Depends(d1),d2_=Depends(d2)):print(d1_)# some stuffprint(d2_)# some other stuffNested dependenciesfromdependsimportDepends,injectasyncdefd1():# do some stuff, which takes longreturn"some stuff"asyncdefd2(d1_=Depends(d1)):# do some other stuff, which also takes long# you can work with d2_ herereturn"some other stuff"# d1 was called only once and is cached during the whole call@injectasyncdefmain(d1_=Depends(d1),d2_=Depends(d2)):print(d1_)# some stuffprint(d2_)# some other stuffYou can also use parameters in your injected function which will be forwarded to your dependencies. The detection is done by name, no type checking is applied here.fromdependsimportDepends,injectasyncdefd1(a):returna# d1 was called only once and is cached during the whole call@injectasyncdefmain(a,d1_=Depends(d1)):returna,d1_assert(awaitmain(1))==(1,1)Another cool thing is that you can use context managed objects inside an injected function. Like for example a database session.fromdependsimportDepends,injectasyncdefget_db():asyncwithSession()asdb:yielddb@injectasyncdefmain(db=Depends(get_db)):# do stuff with your async db connection# after the exit the connection will be teared downTODOsupport sync dependencies (only async rn)replace the caching mechanism with maybe the correct dependency tree
Package: python-deployment
Python-DeploymentExamples of Python Deployment WorkflowsDocumentation with Sphinx and Read the DocsSetting up SphinxIn order to generate a documentation from the docstrings we are going to use
Sphinx.Create adocsdirectory in your projects main directory.mkdirdocscddocsUse the quickstart script provided by Sphinx.sphinx-quickstartAnd use the following settings.Changesource/conf.py. The first thing to do is to uncomment and change
following lines at the top of the file.importosimportsyssys.path.insert(0,os.path.abspath('../../'))A few extra extensions should also be added. Theautosummaryextension
generates function/method/attribute summary lists from the docstrings,napoleonenables Sphinx to parse Numpy and Google style docstrings.
Finally, thenumpydocextension loads several extensions for better
support of Numpy.extensions=['sphinx.ext.autodoc','sphinx.ext.intersphinx','sphinx.ext.coverage','sphinx.ext.imgmath','sphinx.ext.ifconfig','sphinx.ext.viewcode','sphinx.ext.autosummery','sphinx.ext.napoleon','numpydoc']And some more changes:master_doc = 'contents'for a better overview page,
which we will later add.html_style = 'sphinx_rtd_theme'for a nicer theme.For compatibility with Read the Docs:html_theme_options={#    'canonical_url': '',#    'analytics_id': '','logo_only':False,'display_version':True,'prev_next_buttons_location':"top",#    'style_external_links': False,#    'vcs_pageview_mode': '',# Toc options'collapse_navigation':False,'sticky_navigation':True,'navigation_depth':4,'includehidden':True,'titles_only':False,}Comment out# html_static_path = ['_static']In case you use pictures hosted somewhere, addsuppress_warnings=["image.nonlocal_uri",#    'app.add_directive',  # this evtl. suppresses the numpydoc induced warning]And finally add some intersphinx mappings for links:intersphinx_mapping={"Python 3.7":("https://docs.python.org/3.6",None),"Python":("https://docs.python.org/",None),"NumPy":("http://docs.scipy.org/doc/numpy/",None),"SciPy":("http://docs.scipy.org/doc/scipy/reference",None),"matplotlib":("http://matplotlib.org",None),}Now you are ready to create your docs. Have a look at thedocs/source/folder for an example and how to use autosummary in the source files.Publishing on Read the DocsIn thedocs/folder create a filerequirements.txtwith a content likenumpy>=1.14.5numpydocLog in or sign up onRead the DocsClick onImport a Projectand select your repository on GitHub and
activate advanced options.Select Python as the programming language.Adddocs/requirements.txtpath to theRequirements filefield.TickUse system packages.Now, your documentation should be ready and hosted onRead the Docs. With every push to your
repo, the documentation will automatically be built by Read the Docs.In case you want to add a readthedocs badge, have a look at the first
line after the heading of theREADME.mdof this project.
Package: python-deriv-api
python-deriv-apiA python implementation of deriv api library.Go throughapi.deriv.comto know simple easy steps on how to register and get access.
Use this all-in-one python library to set up and make your app running or you can extend it.RequirementPython (3.9.6 or higher is recommended) and pip3Note: There is bug in 'websockets' package with python 3.9.7, hope that will be fixed in 3.9.8 as mentioned inhttps://github.com/aaugustin/websockets/issues/1051. Please exclude python 3.9.7.Installationpython3 -m pip install python_deriv_apiUsageThis is basic deriv-api python library which helps to make websockets connection and
deal the API calls (including subscription).Import the modulefrom deriv_api import DerivAPIAccessapi = DerivAPI(endpoint='ws://...', app_id=1234);
response = await api.ping({'ping': 1})
print(response)Creating a websockets connection and API instantiationYou can either create an instance of websockets and pass it as connection
or
pass the endpoint and app_id to the constructor to create the connection for you.If you pass the connection it's up to you to reconnect in case the connection drops (cause API doesn't know how to create the same connection).Pass the arguments needed to create a connection:api = DerivAPI(endpoint='ws://...', app_id=1234);create and use a previously opened connection:connection = await websockets.connect('ws://...')
   api = DerivAPI(connection=connection)DocumentationAPI referenceThe complete API reference is hostedhereExampleshereDevelopmentgit clone https://github.com/binary-com/python-deriv-api
cd python-deriv-apiSetup environmentmake setupSetup environment and run testmake allRun testpython setup.py pytestorpytestormake testGenerate documentationsGenerate html version of the docs and publish it to gh-pagesmake gh-pagesBuild the packagemake buildRun examplesset token and run exampleexport DERIV_TOKEN=xxxTokenxxx
PYTHONPATH=. python3 examples/simple_bot1.py
Package: python-developer-tools
zengxh_py_toolspython 开发过程中常用到的工具生成发布软件包文件python-mpipinstall--user--upgradesetuptoolswheel
pythonsetup.pysdistbdist_wheel将打包好的项目上传至PyPIpython-mpipinstall--user--upgradetwine# upload to test PyPIpython-mtwineupload--repository-urlhttps://test.pypi.org/legacy/dist/*# upload to real PyPIpython-mtwineuploaddist/*测试是否发布成功# 在线安装测试版本pipinstall-ihttps://test.pypi.org/simple/zengxh_py_tools==0.0.2# 在线安装正式版本pipinstall-ihttps://pypi.org/simple/zengxh_py_tools==0.0.2
pipinstallzengxh_py_tools==0.0.2# 离线安装pipinstalldist/zengxh_py_tools-0.0.1-py3-none-any.whl
pipuninstallzengxh_py_tools
Package: python-dhl
This is a python package for using the DHL webservice.
It allows developers to easily connect to DHL services and make requests.
The package creates SOAP requests using the suds-jurko package (https://pypi.python.org/pypi/suds-jurko/0.6)
to create shipments, to schedule a pickup and possibly to delete a created shipment.
It also provides the ability to save the shipping labels.
Package: python-dhl-germany
python_dhl_germanyNew WSDL versionGot to DHL Geschaeftskundenversand and download the zip:https://entwickler.dhl.de/group/ep/wsapis/geschaeftskundenversand/currentCreate a new wsdl folderrename geschaeftskundenversand-api-x.x.x-wsdl to production.wsdlcopy production.wsdl to test.wsdlopen test.wsdl and patchFROM: <soap:address location="https://cig.dhl.de/services/production/soap"/>TO: <soap:address location="https://cig.dhl.de/services/sandbox/soap"/>set new version in setup.py -> data_files (array)install devcreate venv: python -m venv venvactivate venv:Windows: venv/Scripts/activateLinux / Mac: source venv/bin/activatepip install -r requirements.txt -r requirements_dev.txtpre-commit hook install: pre-commit install --hook-type pre-pushcreate .env file and add DHL_AUTH_USER + DHL_AUTH_PASSWORD variablesbuild and deploypython setup.py sdist bdist_wheels3pypi --bucket pypi.fourzero.oneusagecreate dhl client:dhl_client = DHL(
    "DHL_AUTH_USER", # test: DHL-Entwickler User / live: DHL App Name
    "DHL_AUTH_PASSWORD", # test: DHL-Entwickler PW / live: DHL App Token
    "API_USER", # test: 2222222222_01 / live: Geschäftskunden-Portal system user name
    "API_PASSWORD", # test: pass / live: Geschäftskunden-Portal system user pw
    is_test=True,
)create shipment order:shipper = {
    "name": "Something Something GmbH",
    "name2": "",
    "street": "Teststraße",
    "street_number": "32",
    "zip": "22222",
    "city": "Bremen",
    "country_code": "DE",
    "phone": "040251090",
    "email": "test@test.com",
    "contact_person": "Test User",
}

receiver = {
    "name": "Test Tester",
    "name2": "TestCompany",
    "street": "Teststraße",
    "street_number": "12",
    "zip": "28217",
    "city": "Bremen",
    "country_code": "DE",
    "careOfName": "",
}

order = {
    "customs": {
        "invoice_no": "1234567",
        "description": "Ziegelsteine",
        "place_of_commital": shipper["city"],
    },
    "positions": [
        {
            "name": "Test Product 1",
            "amount": 2,
            "price": 12.5,
            "weight": 0.15,
            "customs": {
                "country_code_origin": "DE",
                "customs_tariff_number": "49119900",
            },
        },
        {
            "name": "Test Product 2",
            "amount": 3,
            "price": 1.5,
            "weight": 100,
            "customs": {
                "country_code_origin": "DE",
                "customs_tariff_number": "49119900",
            },
        },
    ],
}

dhl_client.create_shipment_order(
    "ORDER_ID",
    shipper, # find example in integration test
    receiver, # find example in integration test
    6.0, # weight
    "V01PAK", # dhl product
    "22222222220101", # dhl account number
    order_to_ship=order, # find example in integration test
)
Package: python-di
python-diFully automatic dependency injection for python 3.7, 3.8, 3.9, pypy3 using (not only) argument annotations / type hints.Corresponds to clean architecture patterns and ideal for business applications created in DDD / Hexagonal architecture flavour.
No external dependencies - uses only standard libraries.Key features:automatic type matching based on type hints / type annotations -
no manual configuration is needed, it just works out of the boxconfigurable object aggregation injection -
DI can joinSomeClassobjects and inject into argument annotated asCollection[SomeClass]not harm existing codebase -
no decorators, no extra metadata are needed in existing codebase to make app construction possibleno singletons or global DI process state -
app or any app components can be instantiated independently as many times as neededtransparency of DI process -
static dependency graph and injection plan is built, informative exceptions on error cases
(like cyclic dependency or missing elements)HelpComing soon...An ExampleApplication domain located inmod_simple.py:fromtypingimportListclassRepo:defread(self)->List[str]:raiseNotImplementedErrorclassDomainAction:def__init__(self,repo:Repo):self.repo=repodefpresent(self)->str:joined=", ".join(self.repo.read())returnf"Data found:{joined}"Application concretes located inmod_simple_impl.py:fromtypingimportListfrommod_simpleimportRepoclassMockupRepo(Repo):defread(self)->List[str]:return["di","test"]Automatic application construction:fromdi.declarativeimportDeclarativeApp,DeclarativeModule,scan_factoriesimportmod_simple,mod_simple_impldefmain():# create app definitionapp_def=DeclarativeApp(DeclarativeModule(# automatically add factories from `mod_simple` and `mod_simple_impl`scan_factories(mod_simple,mod_simple_impl),))# build appinstance=app_def.build_instance()# get initialized `DomainAction` objectaction,=instance.values_by_type(mod_simple.DomainAction)# check app worksassertaction.present()=="Data found: di, test"More examplesMore working examples are available intests/di/declarative/.
Please seetests/di/declarative/test_build.pyfor reference.
Package: pythondia
python-diaA library for producing and manipulatingDia diagramsfiles.More on my websiteLimitationsThis version does provide pythondia access only to objects.
Thus, you have to use the dia api to run the meaning on each code change,
meaning you will have to close , open dia and watch errors on console to fix the
script. Invalid scripts will not be accessible from dia app.History1.0.0- Dynamic loader for dia objects which bring python2/3 compatibility as well!0.7.1- For now, only objects UML Class and Database Table are supportedContributingFeel free to add other object and fixes.DevelopmentCompile .egg$./package.shUpload to PyPICreate an API Token from the Web UI. (Edit your~/.pypircwith the generated token.)Install Twine$python3-mpipinstall--user--upgradetwineUpload the bundle$python3-mtwineuploaddist/*Note: The upload to PyPI is currently assured by GitHub Actions.ReleaseIncrease the version number insetup.py.Commit and push.Create a new tag in GitHub to trigger the CI pipeline.
Package: python-dialback
A client library for implementing the draft Dialback authentication mechanism.https://datatracker.ietf.org/doc/draft-prodromou-dialback/DocumentationThe documentation is still under development however I’ve provided docstrings to
help you to easily use this library.InstallationYou can install pypump via pip:pip install python-dialbackLicenseThis library is under the GPL version 3 (or later)
Package: python-diameter
Python Diameter StackThis Python package provides tools to create and parse Diameter Messages and
AVPs, to communicate with diameter peers using the diameter base protocol and
to write diameter applications, as defined in the Diameter Baserfc6733.The diameter stack supports transports over bothTCPandSCTP.The provided Application and Node implementations handle the majority of the
basic protocol-level operations automatically, such as managing peer tables,
sending CER/CEA, DWR/DEA and disconnecting with DPR/DPA.InstallationThe latest version can be installed from PyPI aspython-diameter:~#pipinstallpython-diameterSCTP support provided by an optional depency onpysctp.Functional overviewThe package contains an extensive AVP dictionary and allows constructing
AVPs and Diameter messages either manually, or by parsing network-received
bytes. Message AVPs can be accessed directly as instance attributes.Thediameterpackage provides tools for:Parsing and writing AVPsParsing and writing diameter MesagesCreating diameter nodes and connecting to other peersWriting diameter applicationsSupported diameter application commandsThe diameter stack provides a Python command class for the following
application message types:Diameter Base Protocolrfc3588,rfc6733Abort-SessionAccountingCapabilities-ExchangeDevice-WatchdogDisconnect-PeerConnectionRe-AuthSession-TerminationDiameter Mobile IPv4rfc4004AA-Mobile-NodeHome-Agent-MIPDiameter Network Access Serverrfc4005,rfc7155AAAbort-SessionAccountingRe-AuthSession-TerminationDiameter Credit Controlrf4006,rfc6733,3GPP TS 32.299Credit-Control, with full 3GPP specification supportDiameter Extensible Authentication Protocol (EAP)rfc4072Diameter-EAPThe stack includes also a generic fallback Python class for every other message.
Package: python-dice
Python dicea statistical dice engine for pythonLicenseThis work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Licensehttp://creativecommons.org/licenses/by-nc-sa/4.0/To installpython -m pip install python_diceSource athttps://github.com/markbrockettrobson/python_diceUsagefrom python_dice import PythonDiceInterpreter

interpreter = PythonDiceInterpreter()
program = ["1d6"]
roll = interpreter.roll(program)["stdout"]
print(roll)

> 3from python_dice import PythonDiceInterpreter

interpreter = PythonDiceInterpreter()
program = [
     "VAR a_name = d6 + 10",
     "VAR b_name = d6 - 10"
]
a_name = interpreter.max(program)["a_name"]
b_name = interpreter.min(program)["b_name"]
print(a_name, b_name)

> 16 -9interpreter = python_dice_interpreter.PythonDiceInterpreter()
program = [
    "VAR save_roll = d20",
    "VAR burning_arch_damage = 10d6 + 10",
    "VAR pass_save = ( save_roll >= 10 ) ",
    "VAR damage_half_on_save = burning_arch_damage // (pass_save + 1)",
    "damage_half_on_save"
]
im = interpreter.get_histogram(program)
im.show()SyntaxDice<number of dice to roll>d<number of sides on the dice>
4d10
d6
1d%
30dF
2d[1,1,2,3,5,8]number of dice is missing will be treated as one.number of sides can also be:% for 100.F for fate dice [-1,0,1].custom dice with a comma separated list of side values in [ ] square brackets (trailing comma allowed).range of values d[1,2,3,4,5] == d[1-5] ==d5d[-5,-4,-3,-2] == d[-5--2] == d[-2--5]multiplier for many equal sides d[1,1,1,1,1,1,1,8] == d[1*7, 8]d[1,1,1,2,2,3,3,4] == d[1-3*2,1,4]Keep Drop<number of dice to roll>d<number of sides on the dice>[k for keep d for drop]<number of dice to keep or drop>
2d20k1  roll 2 d20's take the highest 1
16d%k10 roll 16 d% keep the hightest 10
10d[-1,1]d5  roll 10 d[-1,1]'s drop the highest 5
2dFd1  roll 2 dF's drop the highest 1If the number of dice to keep is set above the number of dice to roll it will keep all dice.If the number to drop is equal or greater then the number of dice to roll it will always roll 0.If the number of dice to keep is set to zero then it will always roll 0.If the number of dice to drop is set to zero then it will be ignored.Set a varVAR lower_case_name = 1
VAR name = 4d20Add, subtract, multiply, integer divisionVAR name = 1 + 2d3 - 3 * 4d2 // 5ParenthesisVAR out = 3 * ( 1 + 1d4 )Binary operatorVAR a = 1d4 == 1
VAR b = 1d4 != 1
VAR c = 1d4 <= 2
VAR d = 1d4 < 3
VAR e = 1d4 >= 2
VAR f = 1d4 > 2
VAR g = (1d4 >= 2) AND !(1d20 == 2)
VAR h = (1d4 >= 2) OR !(1d20 == 2)for non binary values, values above 0 are considered true.AbsVAR abs = ABS( 1d6 - 1d6 )Min and MaxMAX(4d7, 2d10)
MIN(50, d%)