Saravanan666/pypi-org huggingface dataset:
Package: defaultenv
defaultenvEnvironment and config file reader for python3.Warrning:slightly magic inside. This module magically read and use environment value both from '.env' file and environment itself.Since version 0.0.6.envfile will be rereaded on the fly on nextenvcall, so now your environment is always up to date.$echo"MY_VAL='test'">.env$python>>>fromdefaultenvimportenv>>>env('PATH')'/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin'>>>env('TEST')>>>env('MY_VAL')'test'>>>importos;os.environ['MY_VAL']'test'envmethod may be used to check the value of variable.
If variable is not definedenvmethod will returnNone.
If both environment variable and corresponding .env record is exist then  .env have a priority.
And yes, you can useos.environinstead ofenv(), all records from .env will be exported immidiately.For additional convinience you can useenv()withdefaultargument, for example:>>>fromdefaultenvimportenv>>>env('TEST','no test')'no test'>>>env('UID')'1000'>>>env('UID',int)1000>>>env('HOME',pathlib.Path)PosixPath("/home/bobuk")>>>env('PATH',lambdax:[pathlib.Path(_)for_inx.split(':')])[PosixPath('/usr/local/sbin'),PosixPath('/usr/local/bin'),PosixPath('/usr/sbin'),PosixPath('/usr/bin'),PosixPath('/sbin'),PosixPath('/bin')]Ifdefaultargument forenv()is not empty, and key what you looking for is not existsenv()will return you value of default.
But ifdefaultis callable (like object, lambda or function) then instead value of key from environment will be passed to this callable.
My favorite is to send justintbecause it's the easiest way to convert your default to integer.Since version 0.0.2 for more convinience two classes (ENV and ENVC) was added. You can use your environment variable name without method calling.$python>>>fromdefaultenvimportENV>>>ENV.PATH'/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin'ENV usage removing unnesesery typing of perenthesis and quotes. In this example i've save 4 keystrokes for you. But it's not very convinient to type uppercased name everytime. Let's imagine what my pinky finger is killing me.$python>>>fromdefaultenvimportENVCasenv>>>env.shell'/usr/local/bin/zsh'>>>env.home'/home/bobuk'As you can seeENVCconvert your variable name to uppercase.
For both ENVC and ENV there's a methoddefaultsto add default values of callables (as forenvabove).>>>fromdefaultenvimportENVCasenv>>>env.defaults(test=1,path=lambdax:x.split(':'),pid=int)>>>env.test1>>>env.path['/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/sbin','/bin']What the difference betweenos.environ.get('PATH', None)andenv.path? It's easy to calculate and the result is 21 (which is half of 42).Since version 0.0.9 you can use even more authomatedENVCDwhich isENVCbut with predefined defaults.
Every path (or colon-separated paths list) will be defaulted toPosixPath, every digital value converted toint.>>>fromdefaultenvimportENVCDasenv>>>env.path[PosixPath('/usr/local/bin'),PosixPath('/usr/local/bin'),PosixPath('/usr/bin'),PosixPath('/bin'),PosixPath('/usr/sbin')]
Package: defaultlist
DocumentationTheDocumentationis hosted onhttp://defaultlist.readthedocs.io/en/1.0.0/Getting startedList extending automatically to the maximum requested length.Added indicies are filled with None by default.>>> from defaultlist import defaultlist
>>> l = defaultlist()
>>> l
[]
>>> l[2] = "C"
>>> l
[None, None, 'C']
>>> l[4]
>>> l
[None, None, 'C', None, None]Slices and negative indicies are supported likewise>>> l[1:4]
[None, 'C', None]
>>> l[-3]
'C'Simple factory functions can be created via lambda.>>> l = defaultlist(lambda: 'empty')
>>> l[2] = "C"
>>> l[4]
'empty'
>>> l
['empty', 'empty', 'C', 'empty', 'empty']InstallationTo install thedefaultlistmodule run:pip install defaultlistIf you do not have write-permissions to the python installation, try:pip install defaultlist --user
Package: default-scraper
# default-scraperPython Web Scraper## FeaturesScrap all search results for a keyword entered as an argument.Can be saved as.csvand.json.Also collect user data who uploaded contents included in search results.## Usage### Install`bash pip installdefault-scraper`or`bash pip installgit+https://github.com/Seongbuming/crawler.git`### Scrap Instagram contents in python script`python from default_scraper.instagram.parser import InstagramParser USERNAME = "" PASSWORD = "" KEYWORD = "" parser = InstagramParser(USERNAME, PASSWORD, KEYWORD, False) parser.run() `### Scrap Instagram contents using bash commandRun following command to scrap contents from Instagram:`bash python main.py--platforminstagram--keyword{KEYWORD}[--output_fileOUTPUT_FILE][--all]`Use–allor-aoption to also scrap unstructured fields.## Data description### InstagramStructured fields
-pk-id-taken_at-media_type-code-comment_count-user-like_count-caption-accessibility_caption-original_width-original_height-imagesSome fields may be missing depending on Instagram’s response data.## Future worksWill support scraping from more platform services.
Package: defaultsettings
Handle settings files in python. Serialize to JSON.Usageimportdefaultsettings# Create new settings templatesettings=defaultsettings.Settings()# Set default valuesSettings.default("key","one")settings.default("key2",range(5))# Save settings to filesettings.save("pathname.json")# Load settingssettings.load("pathname.json")# Current settings, default and loaded configprintsettings.data# Change datasettings.data["key"]="two"# Save config file with new datasettings.save("pathname.json")
Package: defaultsob
A simple package to create data structures with defaults and strict limitations of attributes/properties.Free software: ISC licenseDocumentation:https://defaultsob.readthedocs.org.FeaturesclassUser(Defaults):__slots__=["name","description","an_attribte_with_no_default"]"""
   usef will use the 'name' attribute
   if the description attribute is not
   set at the time of object creation
   """description=usef('name')user=User(name='Billy')"""
.to_dict_clean method returns a
dictionary of attributes with values
"""print(user.to_dict_clean()){"name":"Billy","description":"Billy"}user.description="Something Else"user.an_attribute_with_no_default="Another"print(user.to_dict_clean()){"name":"Billy","description":"Something Else""an_attribute_with_no_default":"Another"}user2=User(name="Billy",description="The Kid")print(user2.to_dict_clean()){"name":"Billy","description":"The Kid"}History0.1.0 (2015-01-11)First release on PyPI.
Package: default_value_for_each_call
Return a function whose default values will be computed for each call,instead of evaluating the default values when function definition is executed.make sure this function is the last(closest to the function) decoratorUsage:@default_value_for_each_call.compute_default_value_for_each_calldef foo(a=([])):a.append(3)print afoo()foo()Output:[3][3]
Package: default-values
Sphinx extension to show default values in documentation.For example:defnamedlist(name:str="NamedList")->Callable:"""
        A factory function to return a custom list subclass with a name.

        :param name: The name of the list.

        :return:
        """For more information seethe documentation.DocsTestsPyPIAnacondaActivityQAOtherInstallationdefault_valuescan be installed from PyPI or Anaconda.To install withpip:$python-mpipinstalldefault_valuesTo install withconda:First add the required channels$condaconfig--addchannelshttps://conda.anaconda.org/conda-forge$condaconfig--addchannelshttps://conda.anaconda.org/domdfcodingThen install$condainstalldefault_values
Package: defcli
defyour CLIs.Use@subcommandon any function to add a subcommand to your cli. The
function's arguments become the arguments to the subcommand. Uses argparse
behind the scenes.importdefcli@defcli.subcommanddefpositional_integer(num:int):print(f"I like to add five:{num+5}")defcli.run()$ python3 main.py positional_integer 7
I like to add five: 12Or use named arguments.importdefcli@defcli.subcommanddefnamed_string(*,name):print(f"Hello,{name}!")defcli.run()$ python3 main.py named_string --name Fred
Hello, Fred!Named booleans are automatically converted to flags.importdefcli@defcli.subcommanddefnamed_bool(has_something=False):ifhas_something:print("Got it!")else:print("We're empty-handed")# Pass arguments to defcli.run instead of parsing sys.argvdefcli.run(["named_bool","--has_something"])$ python3 main.py
Got it!FutureAllow@subcommandto take a parameter to allow the same program to
define multiple CLI's.Fix bugs (there are many...)
Package: defcon
DefconDefcon is a set of UFO based objects optimized for use in font editing
applications. The objects are built to be lightweight, fast and
flexible. The objects are very bare-bones and they are not meant to be
end-all, be-all objects. Rather, they are meant to provide base
functionality so that you can focus on your application’s behavior, not
object observing or maintaining cached data. Defcon implements UFO3 as
described by theUFO font format. If
needed, theufo2-deprecatedbranch has the older, UFO2, version of Defcon.InstallTo download and install the latest stable release of defcon from thePython Package Index, use thepipcommand line tool:pip install --upgrade defconTo install with thefontPenspackage —used forGlyph.correctDirection()andContour.contourInside()— do:pip install --upgrade defcon[pens]To optionally install defcon with support forlxml,
a faster XML reader and writer library, you can do:pip install --upgrade defcon[lxml]You can separate multiple extras using a comma:defcon[pens,lxml].DocumentationDocumentation for Defcon lives atdefcon.robotools.dev.CopyrightsThis package is distributed under the MIT license. See thelicense. Defcon is built inPython. Parts of RoboFab usefontTools, an OpenSource font
toolkit started by Just van Rossum. Parts of Defcon implement the
Property List file format in XML, copyrightApple Computer. Parts of Defcon implement tables and
names from PostScript and the OpenType FDK, copyrightAdobe.
Package: defconf
[![Build Status](https://travis-ci.org/dgarros/defconf.svg?branch=master)](https://travis-ci.org/dgarros/defconf)# DefconfPython Library/tool to easily define and validate the format and content of a configuration fileTo build a robust application, it takes a lot of effort to properly check andvalidate everything that can goes wrong within an input file filled by users:- Wrong option name : login VS username,- Wrong type : string instead of integer,- Mandatory information missing- Value not conform (ip address not valid etc ..)All this complexity is often not completely managed by the application has itrequire a LOT of work:Defconf is here to help, it will:+ Validate the format of the configuration file (list, dict, string)+ Validate all names and track unsupported options+ Validate content type (integer, string, bool, list, dict)+ Validate the value with REGEX or pre-define list+ Populate default value if information is missing## How does it workCreate a definition file to define how your configuration should look likeFor this simple configuration file```yamlhttp_server: [ 192.168.0.1, 192.168.0.2 ]password: pwd!!port: 4444```A corresponding defconf file will looks like this```yamlvalidate:main:http_server: { type: list, validate: ip_addr, mandatory: 1 }password:    { type: string, validate: valid_password, mandatory: 1 }port:        { type: integer, values: [4444, 2580], default: 4444 }regex:ip_addr: ^(\d+)\.(\d+)\.(\d+)\.(\d+)$valid_password: ^[A-Za-z0-9\!]+$```For each option on the configuration file, we can define:- type => [string, integer, bool, dict, list]- mandatory => [0, 1]- values => List of supported values (only for integer, string and list type)- validate => Advance validation with Regex or with another validate block (nested dict)- default => Default value if option is not definedDetail example available here :- [Configuration file - myconfig.yml]( https://github.com/dgarros/defconf/blob/master/myconfig.yml)- [Definition file - myconfig.def.yml]( https://github.com/dgarros/defconf/blob/master/myconfig.def.yml)#### From CLI (within project folder)python defconf.py myconfig.yml myconfig.def.yml#### From python```pythonimport defconfdefinition = yaml.load( open('myconfig.def.yml') )config = yaml.load( open('myconfig.yml') )defconf.validate_config( config, definition, 'myconfig' )```## Installationgit clone https://github.com/dgarros/defconf## Enhancements list- Support JSON file in addition to YAML- Improve exception handling to catch as many issue as possible in one shot- Create example config file from Definition file- Create definition file for definition files :)- Create a module and publish## SupportBug and issues can be open on Github [https://github.com/dgarros/defconf/issues]## How to contribute- Use it and share your config/def files- Report issue- Add unit tests- Improve documentation
Package: defcon-monitoring
DefConUI and API to show an aggregate status of your services. The idea of defcon is that it gathers the status of various components of your infrastructure and exposes them to both humans and machines. Humans (:couple:) will go to the UI to see if something is known to be wrong, and machines (:computer:) will consume the API. This could be used to automatically pause Jenkins job or Chef runs when the production looks unstable.This is currently under active development and not ready for production.APISimply go to/api/defcon/<COMPONENT_ID>/.GET/api/defcon/observability/HTTP200OKAllow:GET,OPTIONSContent-Type:application/jsonVary:Accept{"url":"http://defcon/api/components/observability/","plugins":[{"url":"http://defcon/api/plugin_instance/4/","statuses":[],"name":"alertmanager-page","config":"{'receiver': 'observability-page', 'defcon': 2, 'api': 'https://alertmanager/'}","plugin":"http://defcon/api/plugin/alertmanager/"},{"url":"http://defcon/api/plugin_instance/5/","name":"alertmanager-ticket","description":"","config":"{'receiver': 'observability-ticket', 'defcon': 4, 'api': 'https://alertmanager/'}","plugin":"http://defcon/api/plugin/alertmanager/"}],"statuses":[],"defcon":5,"name":"Observability","description":"","link":"https://confluence/display/OBS","contact":"observability@iksaif.net"}There are also more things available on/api/.PluginsSeedefcon/plugins/README.mdQuickstartvirtualenvvenv-ppython3sourcevenv/bin/activate
cpexamples/local_settings.pydefcon/
pipinstall-rrequirements.txt
./manage.pymigrate
./manage.pymigrate--run-syncdb
./manage.pycreatesuperuser
./manage.pyloadplugins
./manage.pyloadcomponents
./manage.pyrunplugins
./manage.pyrunserver
Package: defe
A Tech feed Aggregator for DevelopersRead Stories which matterBuilt with ❤︎ byBhupesh Varshney✨ FeaturesPWAShare StoriesMinimal UICommand Line InterfaceFeeds from more than 100 sources categorized in📰 News🎙️ Podcasts📧 Newsletters
...And Much More:rainbow: DemoCLI:package: PackageYou can use the defe package to build bots :robot:fromdefeimportdefeimportpprintf=defe.feed()pprint.pprint(f.news(3))pprint.pprint(f.feeders("newsletters"))SeeDcoumetationfor more.🔮 InstallationInstalldefe CLIusingpipfrom PyPIpipinstalldefeDevelopmentClone the repositorygitclonehttps://github.com/Bhupesh-V/defe.gitCreate virtual environmentpython3-mvenvvenvActivate virtual environmentLinux/MacOSsourcevenv/bin/activateWindows.\venv\Scripts\activateInstall Dependenciespipinstall-rrequirements.txtLint the project withblack--check--diff.Run the Development Server (forWebApp)flaskrunTo Use thedefe CLI, runpython-mdefe📝 ChangelogSee theCHANGELOG.mdfile for details.Author👥Bhupesh VarshneyTwitter:@bhupeshimselfDEV:bhupesh📜 LicenseThis project is licensed under the GPL License. See theLICENSEfile for details.👋 ContributingPlease read theCONTRIBUTINGguidelines for the process of submitting pull requests to us.
Package: defectdojo_api
A Python API wrapper forDefectDojo, an AppSec and Security Vulnerability Management tool.This package implements API functionality available within Dojo.Quick StartSeveral quick start options are available:Install with pip (recommended):pip install defectdojo_apiDownload the latest releaseClone the repository:git clone https://github.com/aaronweaver/defectdojo_apiIf you are testing the api locally make sure to set the PYTHONPATH. export PYTHONPATH=/path/totheapi/defectdojo_api:$PYTHONPATHExample# import the packagefromdefectdojo_apiimportdefectdojo# setup DefectDojo connection informationhost='http://localhost:8000/'api_key='your_api_key_from_DefectDojo'user='admin'# instantiate the DefectDojo api wrapperdd=defectdojo.DefectDojoAPI(host,api_key,user,debug=False)# If you need to disable certificate verification, set verify_ssl to False.# dd = defectdojo.DefectDojoAPI(host, api_key, user, verify_ssl=False)# Create a productprod_type=1#1 - Research and Development, product typeproduct=dd.create_product("API Product Test","This is a detailed product description.",prod_type)ifproduct.success:# Get the product idproduct_id=product.id()print"Product successfully created with an id: "+str(product_id)#List Productsproducts=dd.list_products()ifproducts.success:print(products.data_json(pretty=True))# Decoded JSON objectforproductinproducts.data["objects"]:print(product['name'])# Print the name of each productelse:printproducts.messageMore examplesavailableon Github.Supporting information for each method available can be found in thedocumentation.Bugs and Feature RequestsHave a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet,please open a new issue.Copyright and LicenseLicensed under MIT.
Package: defectio
Defectiodefectiois a direct implementation of the entire Revolt API and provides a way to authenticate and start communicating with Revolt servers. Similar interface to discord.pyExample Usageimportdefectioclient=defectio.Client()@client.eventasyncdefon_ready():print("We have logged in.")@client.eventasyncdefon_message(message:defectio.Message):ifmessage.author==client.user:returnifmessage.content.startswith("$hello"):awaitmessage.channel.send("Hello!")client.run("your token here")ContributeJoin our serverhereLicenseLicensed under an MIT licenseBased on discord.py by RapptzhereContributors ✨Thanks goes to these wonderful people (emoji key):Joshua Nixon💻Adam💻jotte💻Paul Makles🐛Cearaj💻jafreli💻Dark42ed📖This project follows theall-contributorsspecification. Contributions of any kind welcome!
Package: defederate
Tools for Mastodon Instance Blocklist ManagementIf you are running a small Mastodon instance then you do not have the benefit
of moderation teams that larger instances have. This means that you may see
toots from instances that you are not interested in.Particularly when you use relays to discover interesting content there is a
high probability that you will quickly discover eg. openly racist instances
that nobody in their right mind needs or wants.
With a personal mastodon instance it will be your job to either block
individual users from those instances, or manually defederate (that is: block)
the server for everyone on your instance.So if you trust some larger instance to do a good job at maintaining their
instance block list then this tool allows you to piggyback on their work and
use their blocklists on your instance.InstallationYou will need Python 3.6+ withpip.
Then runpip install defederate.Parse a public 3rd-party blocklist$defederateshowsocial.example.com
Currentblocklistonsocial.example.com:SILENCE:badhost1.example.comSILENCE:badhost2.example.com(...)SUSPEND:badhost1.example.netSUSPEND:badhost2.example.net(...)The server you are requesting the blocklist from must allow public access.This can also parse blocklists in Markdown format, for example theblocklistused bychaos.social:$defederateshowhttps://github.com/chaossocial/about/raw/master/blocked_instances.mdNotesConcernsSimilar/related projectSimilar/related projectSimilar/related projectrelated Mastodon PR
Package: de-feiertage
feiertageDeutsche Feiertage per JSON-Webservice (API)This Python package is automatically generated by theOpenAPI Generatorproject:API version: 1.0.0Package version: 1.0.1Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visithttps://bund.devRequirements.Python >= 3.6Installation & Usagepip installpipinstalldeutschland[feiertage]poetry installpoetryadddeutschland-EfeiertageSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)UsageImport the package:fromdeutschlandimportfeiertageGetting StartedPlease follow theinstallation procedureand then run the following:importtimefromdeutschlandimportfeiertagefrompprintimportpprintfromdeutschland.feiertage.apiimportdefault_api# Defining the host is optional and defaults to https://feiertage-api.de/api# See configuration.py for a list of all supported configuration parameters.configuration=feiertage.Configuration(host="https://feiertage-api.de/api")# Enter a context with an instance of the API clientwithfeiertage.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=default_api.DefaultApi(api_client)jahr="2021"# str | Welches Jahr?nur_land="BW"# str | Welches Bundesland? (optional)nur_daten=1# int | Nur Daten oder auch Hinweise? (optional)try:# Get Feiertageapi_response=api_instance.get_feiertage(jahr,nur_land=nur_land,nur_daten=nur_daten)pprint(api_response)exceptfeiertage.ApiExceptionase:print("Exception when calling DefaultApi->get_feiertage:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://feiertage-api.de/apiClassMethodHTTP requestDescriptionDefaultApiget_feiertageGET/Get FeiertageDocumentation For ModelsFeiertagDocumentation For AuthorizationAll endpoints do not require authorization.Authorkontakt@bund.devNotes for Large OpenAPI documentsIf the OpenAPI document is large, imports in feiertage.apis and feiertage.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:Solution 1:
Use specific imports for apis and models like:from deutschland.feiertage.api.default_api import DefaultApifrom deutschland.feiertage.model.pet import PetSolution 2:
Before importing the package, adjust the maximum recursion limit as shown below:import sys
sys.setrecursionlimit(1500)
from deutschland import feiertage
from deutschland.feiertage.apis import *
from deutschland.feiertage.models import *
Package: defern
Provides Go-likedeferPowered byYamato NagataGitHubinstallation:$ pip install defernfromdefernimportdefern,deferner,defern_this,heredefdefer_multiple_function(frame):defern(lambda:print("it's middle 7th"),frame=frame)defern(lambda:print("it's middle 8th"),frame=frame)print("Hi")defern(lambda:print("it's middle 1st"))# you can pass function to run after return.defern(lambda:print("it's middle 2nd"))defern(print,"it's middle 3rd")# passed args and kwargs after function will given to function.@defernerdefdefer_this(number:str):print("it's middle",number)# you can create function which runs after return with `@deferner`defer_this("4th")defer_this("5th",frame=here())@defern_this# wrap function to create procedure which automatically runs after returndefdefer_this_now():print("it's middle 6th")defer_multiple_function(here())# here() to get currentFrame and pass it to `defern` or function created with `deferner`# with name `frame` will create `defern` to that frameprint('ended')# Hi# ended# it's middle 1st# it's middle 2nd# it's middle 3rd# it's middle 4th# it's middle 5th# it's middle 6th# it's middle 7th# it's middle 8th
Package: deferpy
deferpyDeferred function calls are pushed onto a stack. When a function returns, its deferred calls are executed in last-in-first-out order.The Go Bloghas a good explanation of the behavior ofdefer. This package attempts to recreate the behavior as closely as possible.Installation$pipinstalldeferpyUsageCheck out theteststo see more examples.>>>fromdeferpyimportdefer>>>@defer()...deffunction(a,b,c):...function.defer(print,a)...function.defer(print,b)...function.defer(print,c)...returna+b+c...>>>print(function(1,2,3))3216>>>@defer()...deffunc():...foriinrange(10):...func.defer(print,i)...>>>func()9876543210