Saravanan666/pypi-org huggingface dataset:
Package: drfwn-quick
drfwn_quickHandle full serialization of nested models quickly.Overviewdrfwn-quick(django rest framework writable nested quick) extendsdrf-writable-nestedto allow nested models to be serialized rapidly with full data for relations
by taking advantage of django'squeryset.values()method.Example API response withdrfwn-quick:[
    {
        'id': 1,
        'name': 'Beans',
        'description': 'Some beans.',
        'enabled': False,
        'vendors': [
            {
                'id': 1,
                'name': 'Beans Emporium',
                'about': 'We sell beans.',
                'enabled': False
            }
        ]
    }
]Example without:[
    {
        'id': 1,
        'name': 'Beans',
        'description': 'Some beans.',
        'enabled': False,
        'vendors': [1]
    }
]Note that withoutdrfwn-quick, the relational field"vendors"is simply
a representation of database primary keys (IDs).FeaturesFull DataAs seen in the overview above, responses with relations are looked-up to return
complete data from the API call, not just IDs (primary keys).Note that so long asDRFWN_QUICK_ALWAYSis falsy, a url parameter is used to
control this behaviour. This means that the original serialization can remain
accessible by default, for things such as the DRF UI, if desired.PerformanceData is builtquicklyby only accessingqueryset.values()for the object and
it's relation's querysets. Because this does not instsntiate Model objects for each
value within the queryset(s), it is significantly faster on larger datasets.Timed ExamplesComing... :)WritableThis is native todrf-writable-nestedbut becausedrfwn-quickextends it,
it's worth noting that the nested values are writable, and require only IDs
to do so.However, note that a key difference betweendrf-writable-nestedalone anddrfwn-quickis that the response after ceating or updating a value can be
fully contextual, if quick is enabled for that call/always.Meaning, aPOSTorPUTrequest may have a payload with{..., "relation": [1, 3]}but still yield{..., "relation": [{"id": 1, ...}, {"id": 3, ...}]}.settings.pyThere are a few items that can be set via the local Django app'ssettings.pyfile.SettingDefaultAboutDRFWN_QUICK_ALWAYSFalseIf true, removed the need to pass a URL param to enable quick functionality.DRFWN_QUICK_DATETIME_FORMAT"%Y/%m/%d"The format to use fordatetime.datetimeserialisation.DRFWN_QUICK_HANDLE_DATETIMESTrueIf true, serialisedatetime.datetimeobjects.DRFWN_QUICK_URL_PAGE_PARAM_NAME"page_size"The URL parameter name to use for page size.DRFWN_QUICK_URL_QUICK_PARAM_NAME"quick"The URL parameter name to control quick functionality.TestsTests exist, if you want to contribute, please consider tests. There's always
room for improvement on existing tests, too.Coverage report will be added eventually.
Package: drf_wrapper
drf-wrapper is a restful api wrapper which can bundle several api calls into oneMotivation:When we design restful api, we tends to design clean api, one resource for one endpoints.When we get data from api, we tends to reduce the number of requests, so we would like toget all related resources with minimum api.With drf-wrapper, you can design clean api, and call the wrapper api to get all requireddata with just one requests.How it works:It is very simple, parse the required api url as query string like:http://127.0.0.1/api/wrapper/?urls=/api/item_a/,/api/item_b/The library will carry over all the cookie, header from the orignal request to each api view,that means all permission checking etc works the same as before.Installation:* pip install drf_wrapper* in your settings add 'drf_wrapper' into app* in urls.pyurlpatterns += patterns('',url(r'wrapper/', 'drf_wrapper.views.wrapper_view'))Roadmap:* Add pass through param support. Enable api calls like: /api/wrapper?urls=/api/hot_item,/api/company/{0:company_id}/* Add threshold. The maximum apis can be bundled in one wrapper.
Package: drf-yaml
REST Framework YAMLYAML support for Django REST FrameworkFull documentation for the project is available athttp://qu4tro.github.io/drf-yaml.OverviewYAML support for the Django REST Framework, forked fromhttps://github.com/jpadilla/django-rest-framework-yaml.RequirementsPython (3.8, 3.9, 3.10, 3.11)Django (3.2, 4.*)InstallationInstall usingpip...$pipinstalldrf-yamlExampleREST_FRAMEWORK={'DEFAULT_PARSER_CLASSES':('drf_yaml.parsers.YAMLParser',),'DEFAULT_RENDERER_CLASSES':('drf_yaml.renderers.YAMLRenderer',),}You can also set the renderer and parser used for an individual view, or viewset, using the APIView class based views.fromrest_frameworkimportrouters,serializers,viewsetsfromdrf_yaml.parsersimportYAMLParserfromdrf_yaml.renderersimportYAMLRenderer# Serializers define the API representation.classUserSerializer(serializers.HyperlinkedModelSerializer):classMeta:model=Userfields=('url','username','email','is_staff')# ViewSets define the view behavior.classUserViewSet(viewsets.ModelViewSet):queryset=User.objects.all()serializer_class=UserSerializerparser_classes=(YAMLParser,)renderer_classes=(YAMLRenderer,)Sample output----email:jpadilla@example.comis_staff:trueurl:"http://127.0.0.1:8000/users/1/"username:jpadillaDocumentation & SupportFull documentation for the project is available athttp://qu4tro.github.io/drf-yaml.
Package: drf-yasg-examples
Add example value on your swagger documentation!RequirementsPython 3.6.1 or higherdrf-yasg based code baseInstallWith pippipinstalldrf-yasg-examplesWith Poetrypoetryadddrf-yasg-examplesConfigurationEdit your django config file.SWAGGER_SETTINGS={'DEFAULT_AUTO_SCHEMA_CLASS':'drf_yasg_examples.SwaggerAutoSchema',}Note: If you useSwaggerAutoSchemaclass other codes, replace them togetherUsageChoiceFieldJust write verbose text like this in your models.classProduct(models.Model):CATEGORY=[('F','Food'),('L','Living Item'),]category=models.CharField(verbose_name='Category',max_length=1,choices=CATEGORY,)And ModelSerializer might set this field as ChoiceField, and this package
write down enum k-v list on your documentation automatically.OthersWrite example value in your serializer class like this.classProductSerializer(serializers.ModelSerializer):classMeta:model=Productfields='__all__'example={'name':'Apple','amount':6,'price':'10.00',}Then drf-yasg will add example on your docs automatically.LICENSEMIT
Package: drf-yasg-stubs
Typing stubs for drf-yasg libraryPEP 484 type stubs for Mypy and PyCharm.This package contains type stubs to provide more precise static types and
type inference fordrf-yasg, the OpenAPI/Swagger
generator for Django REST Framework.Installationpipinstalldrf-yasg-stubsThat's all, run Mypy and it should be able to pick up these stubs.Changelog0.1.4 (2021-06-29)Allow passingrequest_body=no_bodytoswagger_auto_schema(#14)Contributed by Étienne Noss @etene0.1.3 (2021-01-15)Add re-exports toinspectors/__init__.py(#13)get_schema_view() now expects list arguments instead of tuple, as in
drf-yasg 1.20 (#11)Type hints for OpenAPISchemaGenerator (#10)0.1.2 (2020-08-19)Fixed get_schema_view() arguments authentication_classes, permission_classes (#6)0.1.1 (2020-08-18)Fixed SchemaView method annotations (#2)Fixed @swagger_serializer_method decorator hintsImproved hints for EndpointEnumerator, OpenAPISchemaGenerator0.1.0 (2020-01-13)Initial releaseDevelopmentRelease process:https://twine.readthedocs.io/en/stable/#using-twinedocker build --tag=drf-yasg-stubs .docker run --rm -it drf-yasg-stubs twine upload 'dist/*'Create tag athttps://github.com/intgr/drf-yasg-stubs/releases/new
Package: drg2txt
drg2txtMapper for DRG/MDC numeric codes to their text description.
UsesMS-DRG v38.1.Installationpip install drg2txtExamplesimportdrg2txt[drg2txt.get_drg_description(i)foriin[1,10,100,'WOLOLO']]>>>['Heart transplant or implant of heart assist system with MCC','Pancreas transplant','Seizures with MCC',None][drg2txt.get_drg_mdc_description(i)foriin[1,10,100,'WOLOLO']]>>>['Has no MDC','Has no MDC','Diseases and disorders of the nervous system',None][drg2txt.get_mdc_code(i)foriin[1,10,100,'WOLOLO']][-1,-1,1,None]Look on original dicts:from drg2txt import drg_descr, drg_mdc, mdc_descr
Package: drhttp
This is the officialpythonclient forDr. Ashtetepeservice.DrHTTP let's you record two types of requests :Inbound : requests that are performed by clients of your server (eg. API calls from a mobile app)Outbound (optional) : requests that are performed by your server (eg. API call to third parties)Note: You need to configure inbound request recording to have outbound request recording working.InstallationInstall package withpip(or any compatible package manager) :pip install drhttpYou will need adsn(Data source name) which can be found inyour project.Usage forDjangoAn integraion example is provided hereInbound request recordingThis recording is done via awsgimiddleware. You can configure it inwsgi.py:application=...# get your application from existing codeimportdrhttpapplication=drhttp.WSGIMiddleware(app=application,dsn="<insert_dsn_here")User identificationIt allows the identification of the user issuing the inbound request. You'll be able to filter requests based on this field in the web interface.drhttpwill identify your user if you set thex-drhttp-userresponse header with the user's id as value. Fortunately, we provide you a django middleware that does it automaticaly.MIDDLEWARE=[...'drhttp.DjangoUserMiddleware',]Device identificationDevice identification works as user identification, only the header name changes (x-drhttp-device). No django middleware is provided though, it's up to you to set this header depending your device identification strategy.Outbound request recordingNote: Outbound request recording is not available yet in the python libraryUsage forFlaskAn integraion example is provided hereInbound request recordingThis recording is done via a wsgi middleware. You may need to change some code in your flask app file.
The goal is to encapsulate the wsgi app in the drhttp middleware. Asdrhttp.WSGIMiddleware()returns a wsgi application (not a full flask application) it can't be run by flask cli, you need a wsgi application server likewerkzeug/gunicorn/uwsgi....app=Flask(__name__)...if__name__=='__main__':importdrhttpfromwerkzeug.servingimportrun_simpleapp=drhttp.WSGIMiddleware(app=app,dsn="<insert_dsn_here>")run_simple('0.0.0.0',80,app)User identificationIt allows the identification of the user issuing the inbound request. You'll be able to filter requests based on this field in the web interface.drhttpwill identify your user if you set thex-drhttp-userresponse header with the user's id as value.Here is an example if you useFlask-HTTPAuth:fromdrhttpimportDRHTTP_HEADER_USER@app.after_requestdefapply_caching(response):response.headers[DRHTTP_HEADER_USER]=auth.username()returnresponseDevice identificationDevice identification works as user identification, only the header name changes (x-drhttp-device). It's up to you to set this header depending your device identification strategy.Outbound request recordingNote: Outbound request recording is not available yet in the python libraryTroubleshootingPleasereport any issueyou encounter concerning documentation or implementation. This is very much appreciated.
Package: dribbble-py
Dribbble-pyA python scraper for dribbble.comDisclaimerAny legal issues regarding the downloading of graphic assets of Dribbble users should be taken up with the responsible forks and content abusers themselves, as we are not affiliated with them.Dribbble-py does not support or promote downloading of graphic assets of a Dribbble user and using their assets without permission.In case of copyright infringement, please directly contact the responsible forks or the individuals responsible for the abuse.This app merely scrapes information about a Dribbble user, publicly available on the website.Installation$ pip install -U dribbble-pyUsage$ drbl_py -h

usage: drbl_py [-h] [-u USERNAME] [-j JSON_FILE] [-v VERBOSE] [--version]

Dribble-py 0.0.1

Program to scrape dribbble user information

optional arguments:
  -h, --help            show this help message and exit
  -u USERNAME, --username USERNAME
                        Enter username to scrape.


  -m, --get-metadata    Get metadata about every user shot.
                        Takes longer to scrape.
                        Default = No metadata about user shots


  -j JSON_FILE, --json-file JSON_FILE
                        Name of output JSON filename.
                        Default = username.json


 --version             show program's version number and exit

    Example usage
    -------------

    Download info about a user.

        $ drbl_py -u JohnDoe

    Download info about a user to a custom JSON file.

        $ drbl_py -u JohnDoe -j John
Package: driconfig
DriConfigA Pydantic-ish way to manage your project's YAML configurations.Documentation:https://dribia.github.io/driconfigSource Code:https://github.com/dribia/driconfigThe usage of YAML files to store configurations and parameters is widely accepted in the Python
community, especially in Data Science environments.DriConfig provides a clean interface between your Python code and these YAML configuration files.It is heavily based onPydantic'sSettings Management,
preserving its core functionalities and advantages.Key featuresSubclassing theDriConfigclass we create aninterface to any YAML configuration file.Our project'sconfigurations arethenattributesof this class.They areautomatically filledwith the values in the YAML configuration file.We can definecomplex configuration structuresusing Pydantic models.We preserve Pydantic'stype casting and validation!ExampleLet's say we have a YAML configuration fileconfig.yamlwith the following data:# config.yamlmodel_parameters:eta:0.2gamma:2lambda:1date_interval:start:2021-01-01end:2021-12-31Then we can configparse withdriconfigas follows:fromdatetimeimportdatefromtypingimportDictfromdriconfigimportDriConfig,DriConfigConfigDictfrompydanticimportBaseModelclassDateInterval(BaseModel):"""Model for the `date_interval` configuration."""start:dateend:dateclassAppConfig(DriConfig):"""Interface for the config/config.yaml file.""""""Configure the YAML file location."""model_config=DriConfigConfigDict(config_folder=".",config_file_name="config.yaml",)model_parameters:Dict[str,float]date_interval:DateIntervalconfig=AppConfig()print(config.model_dump_json(indent=4))"""{"model_parameters": {"eta": 0.2,"gamma": 2.0,"lambda": 1.0},"date_interval": {"start": "2021-01-01","end": "2021-12-31"}}"""
Package: drifactorial
Python client for the Factorial API.Documentation:https://dribia.github.io/drifactorialSource Code:https://github.com/dribia/drifactorialFactorialis a software dedicated to manage everything related to HR.Drifactorialprovides a tiny Python interface to the official API.Key featuresAuthorize programatic accessto your application.Obtain and refreshaccess tokens.Implementsgeneric GET and POSTmethods.Parses responses toPydantic models.Easily implementadditional methods.ExampleThe simplest example.fromdrifactorialimportFactorialfromdatetimeimportdatetimefactorial=Factorial(access_token="abc")# get list of employeesemployees=factorial.get_employees()# get list of company holidaysholidays=factorial.get_holidays()# get list of leavesleaves=factorial.get_leaves()# get list of days off of an employeedaysoff=factorial.get_daysoff(employee_id=123)# get list of all shifts in October 2021shifts=factorial.get_shifts(year=2021,month=10)# get single employeesingle_employee=factorial.get_single_employee(employee_id=123)# get my accountaccount=factorial.get_account()# clock in shiftclock_in=datetime(2021,10,1,9,0)new_shift=factorial.clock_in(now=clock_in,employee_id=123)# clock out shiftclock_out=datetime(2021,10,1,13,0)updated_shift=factorial.clock_out(now=clock_in,employee_id=123)
Package: drift-api
Drift API=========This package wraps the Drift API. It only wraps the 'track' and'identify' endpoints offered by the HTTP API.https://www.drift.com/Installation------------Install with pip::$ pip install drift-apiUsage-----from drift_api import Driftcompany_data = {'companyId': company_id,'attributes': {'revenue': 'bajillions'},}user_data = {'userId': user_id,'attributes': {'hair_color': 'red'},}drift = Drift(DRIFT_ORG_ID)drift.identify(company_data)drift.identify(user_data)The package also exposes a `drift.track` method and `multi` methods for both`track` and `identify`.PyPI----https://pypi.python.org/pypi/drift-apiSource------https://github.com/15five/drift-apiLicense-------This library is released under the terms of the **MIT license**.Full details in ``LICENSE.txt`` file.
Package: drift-bytes
Python DriftBytesPython bindings forDriftBytes.RequirementsPython >= 3.8CMake >= 3.16 (for building)C++17 compiler (for building)conan >= 1.56, < 2.0 (for building)Installationpipinstalldrift-bytesUsage Examplefromdrift_bytesimportVariant,InputBuffer,OutputBufferout_buf=OutputBuffer(3)out_buf[0]=Noneout_buf[1]=Variant(2)out_buf[2]=[1.0,2.0,3.0]in_buf=InputBuffer(out_buf.bytes())assertin_buf[0].valueisNoneassertin_buf[1].value==2assertin_buf[2].value==[1.0,2.0,3.0]
Package: drift-cli
Drift CLIDrift CLI is a command line client forPANDA|Driftplatform.FeaturesExport data from Drift Blob StorageRequirementsPython >= 3.8pipInstallingTo install the Drift CLI, simply use pip:pip install drift-cliUsagedrift-cli --help
drift-cli alias add drift-device --address 127.0.0.1 --password SOME_PASSWORD
drift-cli export raw drift-device ./tmp --start 2021-01-01 --end 2021-01-02LinksDocumentation
Package: drifter
drifter is a simplified control for virtualboxes that doesn’t require the vm to be packaged in a specific and ill documented format.  Which allows use to create your environment with Virtualbox and then drift will take care of bringing them up and shutting them down.Why drifter?If you are currently using Vagrant or straight-up virtualbox and you are happy, then there is nothing for you to see here.  However, if you are annoyed with how difficult it is to convert a virtualbox vm into a vbox usable by Vagrant, then Drifter might just be for you.In general, I like the idea of Vagrant, but I have specific problems with the following:Security concerns with what is being downloaded from an untrusted sourceThe limited vm’s available from that source, Specifically the *BSDs and WindowsVagrant’s intentional inability to auto create a vbox from a virtualbox imagedrifter’s answerDrifter currently supports virtualbox vms. You build it, drifter will control it.Drifter currently has 5 commands: list, add, remove, up and down. Easy to remember, easy to script.Drifter’s configuration, Drifterfile, is in YAML not some language specific module. On top of that, you don’t even need to edit it directly.  Use add and remove to create and make changes, but it’s still yaml so diff’ing is unsurprising.Drifter lets you document your environment and store that documentation with your source.Drifter fires up your vms in order and shuts them down in reverse order.http://drifter.readthedocs.org/DevelopmentIn a virtual environment..$ hg clonessh://hg@bitbucket.org/dundeemt/drifter$ pip install –editable .$ drifter –helpThen you can edit the source and rundrifter cmdChangesv0.0.3bug fixes for removing a non-existent VM from Drifterfiletestsv0.0.2updated documentation linksv0.0.1Initial Release
Package: drifting
DriftingThe most flexible Drift Detection Server.Learn about the concepts inDocsMain features::+1: surprisingly easy to use:+1: production-ready server:+1: created with real use-cases in mind:+1: not just a math library:+1: Python-first, API-firstQuickstartdriftingis built with Developer Experience in mind.You communicate with Drift Detection Server viaDriftingClientor API,
both for fitting the Drift Detector and detecting the drift. In your training
pipeline, use thefitmethod:importdriftingdrifting.fit(train_column,project="example")Then, next to your prediction call:importdriftingresponse=drifting.detect(inference_data,project="example")response.is_driftNote that this makes the usage of the serveras easy as possible.It's not required to manage any artifacts,No need to implement any feedback loops,No need to collect test data,No need to leave your python environment, fetch any logs,You only make request to the server twice.Local installation and runningTo install dependencies, use poetry:poetry installAnd run server locally:python drifting/app.pyProduction usageTo use Drift Detection Server in your organization,
build and deploy the Docker image, or use the pre-built version fromTODO.Docker on a custom serverTo deploy the on cloud instance using docker, you can easily pull the image
and run it:TODOKubernetes and HelmFor more demanding use-cases, it's facilitated to deploy Drift Detection Server
on kubernetes. DDS is packaged with bitnami. You can include the chart byTODOReal-world scenariosEven though Drift Detection Server makes the task incredibly easy,
it still follows the MLOps culture, assuring reproducibility,
observability and scalability postulates are fulfilled.Please read theDocsto learn about real-world usage.
Package: drift-jit-proxy
Python JIT Proxy SDKQuickStart GuideRunpoetry installin the/pythondirectoryAdd.envfile in/sdk/exampleswith yourRPC_URLandPRIVATE_KEYas a byte arrayCustomizeJitParamsin eithershotgun.pyorsniper.pyRunpoetry run python -m examples.sniperorpoetry run python -m examples.shotgunwhile in thesdkdirectoryShotgun vs SniperTheJitterShotgunwill immediately spray transactions when it detects an eligible auction.
It'll try up to 10 times to fulfill the order, retrying if the order doesn't yet cross or the oracle is stale.TheJitterSniperwill wait until it detects an order that has a high chance of crossing theJitParamsand retry up to 3 times on errors.  It won't send transactions immediately like theJitterShotgundoes, but will try to determine that the order will cross the bid/ask during the auction before sending a transaction.How to set up aJitProxyClientandJitterThis example uses theJitterShotgun, but the same logic follows for theJitterSniper.However, theJitterSniperalso requires aSlotSubscriberin its constructor.jit_proxy_client = JitProxyClient(
        drift_client,
        # JIT program ID
        Pubkey.from_string("J1TnP8zvVxbtF5KFp5xRmWuvG9McnhzmBd9XGfCyuxFP"),
    )

    jitter_shotgun = JitterShotgun(drift_client, auction_subscriber, jit_proxy_client, True) # The boolean is logging verbosity, True = verbose.

    jit_params = JitParams(
        bid=-1_000_000,
        ask=1_010_000,
        min_position=0,
        max_position=2,
        price_type=PriceType.Oracle(),
        sub_account_id=None,
    )

    # Add your parameters to the Jitter before subscribing
    jitter_shotgun.update_perp_params(0, jit_params)

    await jitter_shotgun.subscribe()