Saravanan666/pypi-org huggingface dataset:
Package: jesse-ftx-futures
FTX FUTURES plugin for JesseThis is the initial release of the FTX Futures driver for Jesse.
At the moment:it is only meant for importing candles and running backtestsit supports only Perpetual futures (*-PERP)InstallationInstall by running:pipinstalljesse-ftx-futuresRegister your driverNow you need to tell Jesse where to find this driver. We do that by adding it as a driver for importing candles inplugins.pyfile that exists in the root of Jesse projects. Here is an example where I register a driver for the FTX FUTURES exchange:fromjesse.modes.import_candles_mode.drivers.binanceimportBinancefromjesse.modes.import_candles_mode.drivers.binance_futuresimportBinanceFuturesfromjesse.modes.import_candles_mode.drivers.binance_inverse_futuresimportBinanceInverseFuturesfromjesse.modes.import_candles_mode.drivers.bitfineximportBitfinexfromjesse.modes.import_candles_mode.drivers.coinbaseimportCoinbasefromjesse.modes.import_candles_mode.drivers.testnet_binance_futuresimportTestnetBinanceFuturesfromjesse_ftx_futuresimportFTXFuturesimport_candles_drivers={'Binance':Binance,'Binance Futures':BinanceFutures,'Binance Inverse Futures':BinanceInverseFutures,'Testnet Binance Futures':TestnetBinanceFutures,'Bitfinex':Bitfinex,'Coinbase':Coinbase,'FTX Futures':FTXFutures}Now I should be able to run import candles from FTX (in this example for Perpetual):jesseimport-candles'FTX Futures''BTC-USDT''2012-06-04'In this example for an expiring future (it won't work on baktesting for now):jesseimport-candles'FTX Futures''BTC-0924''2012-06-04'Add new config values for running backtestsUsually the reason for importing candles in the first place is to run backtests on them. So we need to tell Jesse where to find the config values for our newly added exchange in order for it run backtests on it.We can do that by openingconfig.pyand coping and pasting values from an existing exchange such asBinance Futuresand changing the values according to our needs for out exchange:# https://www.ftx.com'FTX Futures':{'fee':0.0006,# backtest mode only: accepted are 'spot' and 'futures''type':'futures',# futures mode only'settlement_currency':'USDT',# accepted values are: 'cross' and 'isolated''futures_leverage_mode':'isolated',# 1x, 2x, 10x, 50x, etc. Enter as integers'futures_leverage':3,# used for spot exchange only'assets':[{'asset':'USDT','balance':10_000},],},
Package: jest
Jest is a software project estimator.You use it to predict how much time and how many people it will taketo create a piece of software.Notable features:* Gives you a decent estimate from a small amount of input* Gives you a better estimate with more detailed input* Runs from the command line* Easy to use (if you're comfortable with the command line)* Free SoftwareJest is designed to be a free, simple, *nix-style alternative tocomplicated proprietary estimators.
Package: jestor
Jestor SDK for Python - Version BetaJestor client library for python.DocumentationDocumentation with all available functions can be foundhereInstallationInstall from PyPi usingpip, a package manager for Python.pip install jestorIf pip install fails on Windows, check the path length of the directory. If it is greater 260 characters then enableLong Pathsor choose other shorter location.Don't have pip installed? Try installing it, by running this from the command
line:$ curl https://bootstrap.pypa.io/get-pip.py | pythonGetting StartedGetting started with the Jestor API couldn't be easier. Create aJestorinstance and you're ready to go.fromjestor.JestorimportJestorjestor_client=Jestor('<api token>','<account>')result=jestor_client.table('sample_tab').get(limit=3)# result will be a python array with values
Package: jetar-zip
jezip-tarA package for save zip/tar file in memory buffer(not write in file)Usage:from jezt import ZipFile MyZip = ZipFile()  
# The Type of the ZipFile:  
# MyZip = ZipFile(ZipFile.BZIP) BZIP, LZMA, DELATED, STORED(default DEFLATED)  
MyZip.add('fn1', 'bytes or str') MyZip.get('fn1')  
# 'bytes or str' MyZip.addf('myfile.txt')  
MyZip.get('myfile.txt') # The content of the file  
# Save the zip file  
import io  
bf = io.BytesIO() # Also can be io.FileIO(filename, 'wb')  
MyZip.flush(bf)  
# if there's no IO given, return a BytesIO object  
bf.getvalue()  # The content of the file The TarFile is the same
Package: jetblack-asgi-sspi
jetblack-asgi-sspiASGImiddleware
forSSPIauthentication
on Windows.This is not specific to a particular ASGI framework or server.InstallationInstall from the pie store.pip install jetblack-asgi-sspiUsageThe following program uses theHypercornASGI server, and thebareASGIASGI framework.importasyncioimportloggingfrombareasgiimportApplication,HttpRequest,HttpResponsefrombareutilsimporttext_writerfromhypercornimportConfigfromhypercorn.asyncioimportservefromjetblack_asgi_sspi.spnego_middlewareimportSPNEGOMiddleware,SSPIDetails# A callback to display the results of the SSPI middleware.asyncdefhttp_request_callback(request:HttpRequest)->HttpResponse:# Get the details from scope['extensions']['sspi']. Note if# authentication failed this might be absent or empty.extensions=request.scope.get('extensions',{})sspi_details=extensions.get('sspi',{})client_principal=sspi_details.get('client_principal','unknown')message=f"Authenticated as '{client_principal}'"returnHttpResponse(200,[(b'content-type',b'text/plain')],text_writer(message))asyncdefmain_async():# Make the ASGI application.app=Application()app.http_router.add({'GET'},'/',http_request_callback)# Wrap the application with the middleware.wrapped_app=SPNEGOMiddleware(app,protocol=b'NTLM',# NTLM or Negotiateforbid_unauthenticated=True)# Start the ASGI server.config=Config()config.bind=['localhost:9023']awaitserve(wrapped_app,config)if__name__=='__main__':logging.basicConfig(level=logging.DEBUG)asyncio.run(main_async())ArgumentsTheSPNEGOMiddlewarewraps the ASGI application. The first and only
positional argument is the ASGI application. Optional arguments include:protocol(bytes): Eitherb"Negotiate"orb"NTLM"(for systems not part of a domain).service(str): The SPN service. Defaults to"HTTP".hostname(str, optional): The hostname. Defaults togethostname.session_duration(timedelta, optional): The duration of a session. Defaults to 1 hour.forbid_unauthenticated(bool): If true, and authentication fails, send 403 (Forbidden). Otherwise handle the request unauthenticated.ResultsIf the authentication is successful the SSPI details are added to the"extensions"property of the ASGI scope under the property"sspi".
The following properties are set:"client_principal"(str): The username of the client."negotiated_protocol"(str): The negotiated protocol."protocol"(str): The requested protocol."spn"(str): The SPN of the server.
Package: jetblack-asgi-typing
jetblack-asgi-typingJust the types for ASGI.Taken fromasgirefandhypercorn.InstallationFrompypi.org:pipinstalljetblack-asgi-typingUsagefromasgi_typingimport(Scope,ASGIReceiveCallable,ASGISendCallable)asyncdefapp(scope:Scope,receive:ASGIReceiveCallable,send:ASGISendCallable)->None:# Implement your ASGI application here.pass
Package: jetblack-fixparser
jetblack-fixparserA parser for FIX messages.InstallationThe package can be installed withpip.pipinstalljetblack-fixparserProtocol FilesWhile FIX is a standard, the structure of the fields and messages is configurable.
This configuration is typically loaded from a file. The source repository
contains a number of such files in the/etcfolder inYAMLformat. There is
also aQuickFixloader.The YAML format makes use of defaults. All message fields default to typefield,
so onlygroupandcomponentfields need to be explicitly specified. Also all
message fields are consider optional, non-optional fields must be marked asrequired: true.UsageDecodingTo decode a FIX bytes buffer -fromjetblack_fixparserimportload_yaml_protocol,FixMessagebuffer=b'8=FIX.4.4|9=94|35=3|49=A|56=AB|128=B1|34=214|50=U1|52=20100304-09:42:23.130|45=176|371=15|372=X|373=1|58=txt|10=058|',protocol=load_yaml_protocol('FIX44.yaml',is_millisecond_time=True,is_float_decimal=True)fix_message=FixMessage.decode(protocol,buffer,sep=b'|',strict=True,validate=True,convert_sep_for_checksum=True)print(fix_message.message)Note that strict validation is enabled. This ensures all required fields are
specified. Also the separator is changed fromNULLto|to so they can be
displayed. However the checksum was calculated with the original field separator
so theconvert_sep_for_checksumis set totrue.EncodingTo encode a dictionary describing a FIX message -fromdatetimeimportdatetime,timezonefromjetblack_fixparserimportload_yaml_protocol,FixMessageprotocol=load_yaml_protocol('FIX44.yaml',is_millisecond_time=True,is_float_decimal=True,is_type_enum=None)sending_time=datetime(2020,1,1,12,30,0,tzinfo=timezone.utc)fix_message=FixMessage(protocol,{'MsgType':'LOGON','MsgSeqNum':42,'SenderCompID':"SENDER",'TargetCompID':"TARGET",'SendingTime':sending_time,'EncryptMethod':"NONE",'HeartBtInt':30})buffer=fix_message.encode(regenerate_integrity=True)print(buffer)Note that theBeginString,BodyLengthandChecksumfields were automatically
generated.FactoriesTo encode and decode a message using a factory -fromdatetimeimportdatetime,timezonefromjetblack_fixparserimportload_yaml_protocol,FixMessage,FixMessageFactoryprotocol=load_yaml_protocol('FIX44.yaml',is_millisecond_time=True,is_float_decimal=True,is_type_enum=None)factory=FixMessageFactory(protocol,"SENDER","TARGET")sending_time=datetime(2020,1,1,12,30,0,tzinfo=timezone.utc)fix_messages=factory.create('LOGON',42,sending_time,{'EncryptMethod':"NONE",'HeartBtInt':30})buffer=fix_message.encode(regenerate_integrity=True)roundtrip=FixMessage.decode(protocol,buffer)assertfix_message.message==roundtrip.messageBecause the sender and target remain the same, we can simplify message generation
with the factory.
Package: jetblack-iso8601
jetblack-iso8601Support for ISO8601
(read thedocs).UsageTimestampsTimestamps can be parsed withiso8601_to_datetimeand
converted to a string withdatetime_to_iso8601.fromjetblack_iso8601import(iso8601_to_datetime,datetime_to_iso8601)text='2014-02-01T09:28:56.321-10:00'timestamp=iso8601_to_datetime(text)roundtrip=datetime_to_iso8601(timestamp)asserttext==roundtripDurationsTimestamps can be parsed withiso8601_to_timedeltaand
converted to a string withdatetime_to_iso8601.fromjetblack_iso8601import(iso8601_to_timedelta,timedelta_to_iso8601)text='P3Y2M1DT12H11M10S'value=iso8601_to_timedelta(text)roundtrip=timedelta_to_iso8601(value)assertroundtrip==text
Package: jetblack-markdown
jetblack-markdownMarkdown extensions for automatic document generation
(read thedocs).Autodoc ExtensionA markdown extension is provided for automatically documenting python code.Modules are referred to as follows:# A Top Level Module@[jetblack_markdown]# A Package@[jetblack_markdown.autodoc]# A function@[jetblack_markdown.autodoc:makeExtension]# A class@[jetblack_markdown.autodoc.metadata:PropertyDescriptor]CustomizingAll the rendering is done with jinja2 templates. Start by copying the current
templates from jetblack_markdown/templates and specify thetemplate_folderin
themkdocs.yml.LaTex2MathML ExtensionThere is a second extension which transforms LeTax style math formula
to MathML HTML. Inline formula are surrounded by$, which blocks are
fenced with$$. See the documentation for more details and examples.mkdocs integrationThis site was generated usingmkdocsand the following config:site_name:jetblack-markdowndocs_dir:documentationsite_dir:docsmarkdown_extensions:-admonition-codehilite-jetblack_markdown.autodoc:class_from_init:trueignore_dunder:trueignore_private:trueignore_all:falseprefer_docstring:truetemplate_folder:nullextra_css:-css/custom.cssConfigurationThere are some configuration parameters for the autodoc extension.class_from_init (bool, optional): If True use the docstring from
the __init__ function for classes. Defaults to
True.ignore_dunder (bool, optional): If True ignore
__XXX__ functions. Defaults to True.ignore_private (bool, optional): If True ignore methods
(those prefixed _XXX). Defaults to True.ignore_all (bool): If True ignore the __all__ member.prefer_docstring (bool): If true prefer the docstring.template_folder(Optional[str], optional): Specify a custom template folder.
The template "main.jinja2" will be rendered passing anobjparameter
which is ajetblack.markdown.metadata.Descriptor
Package: jetblack-metrics
jetblack-metricsGeneric metric classes and context based monitoring.InstallationInstall from the pie store.pipinstalljetblack-metricsUsageFirst you need to implement a metric which interacts with an actual
instrumentation implementation. The following provides an HTTP request
metric using Prometheus to gather the metrics and theTimedMetricto
provide a latency metric.fromjetblack_metricsimportmonitor,TimedMetricfromprometheus_clientimportCounter,Gauge,HistogramclassHttpRequestMetric(TimedMetric):"""A metric which holds HTTP information."""def__init__(self,name:str,method:str,path:str)->None:super().__init__()self.name=nameself.scope=methodself.info=pathself.status=500REQUEST_COUNT=Counter("http_request_count","Number of requests received",["name","method","path","status"])REQUEST_LATENCY=Histogram("http_request_latency","Elapsed time per request",["name","method","path"])REQUEST_IN_PROGRESS=Gauge("http_requests_in_progress","Requests in progress",["name","method","path"])defon_enter(self):super().on_enter()self.REQUEST_IN_PROGRESS.labels(self.name,self.scope['method'],self.scope['path']).inc()defon_exit(self)->None:super().on_exit()self.REQUEST_COUNT.labels(self.name,self.scope['method'],self.scope['path'],self.status).inc()self.REQUEST_LATENCY.labels(self.name,self.scope['method'],self.scope['path']).observe(self.elapsed)self.REQUEST_IN_PROGRESS.labels(self.name,self.scope['method'],self.scope['path']).dec()Once we have the metric we can use themonitorfunction to manage the process
of gathering the statistics.defsome_http_middleware(request,next_handler):"""Some kind of HTTP middleware function"""withmonitor(HttpRequestMetric('MyApp',request.method,request.path))asmetric:# Call the request handlerresponse=next_handler(request)metric.status=response.status
Package: jetblack-rabbitmqmon
jetblack-rabbitmqmonThis is an asyncio RabbitMQ monitor API.It wraps the RabbitMQ management plugin REST api. This allows retrieving
metrics and peeking into the queues.StatusThis is work in progress, but is functional.InstallationThis can be installed with pip.Multiple clients a supported and onemustbe selected. Choose one of:aiohttpbareclientpipinstalljetblack-rabbitmqmon[bareclient]Or alternatively:pipinstalljetblack-rabbitmqmon[aiohttp]UsageThe following gets an overview using the bareclient.importasynciofromjetblack_rabbitmqmon.monitorimportMonitorfromjetblack_rabbitmqmon.clients.bareclient_requesterimportBareRequesterasyncdefmain_async():mon=Monitor(BareRequester('http://mq.example.com:15672','admin','admins password'))overview=awaitmon.overview()print(overview)if__name__=='__main__':asyncio.run(main_async())The follow explores a vhost.importasynciofromjetblack_rabbitmqmon.monitorimportMonitorfromjetblack_rabbitmqmon.clients.aiohttp_requesterimportAioHttpRequesterasyncdefmain_async():mon=Monitor(AioHttpRequester('http://mq.example.com:15672','admin','admins password'))vhosts=awaitmon.vhosts()forvhostinvhosts.values():# vhost is a dictexchanges=awaitvhost.exchanges()forexchangeinexchanges.values():# exchanges is a dictprint(exchange)# Objects can be refreshed to gather new metrics.awaitexchange.refresh()print(exchange)bindings=awaitexchange.bindings()forbindinginbindings:print(binding)if__name__=='__main__':asyncio.run(main_async())The following gets some messages from an exchange:importasynciofromjetblack_rabbitmqmon.monitorimportMonitorfromjetblack_rabbitmqmon.clients.bareclient_requesterimportBareRequesterasyncdefmain_async():mon=Monitor(BareRequester('http://mq.example.com:15672','admin','admins password'))vhosts=awaitmon.vhosts()vhost=vhosts['/some-vhost']queues=awaitvhost.queues()queue=queues['some.queue']messages=awaitqueue.get_messages()print(messages)if__name__=='__main__':asyncio.run(main_async())
Package: jetblack-tomlutils
jetblack-tomlutilsSome utilities for working with toml files.UsageInstall with pip:$pipinstalljetblack-tomlutilstoml2jsonTo convert toml to JSON:usage:tom2json[<input>[<output]]input/output:eitherapathor'-'forstdin/stdout

examples:$toml2json<pyproject.toml>pyproject.json$toml2jsonpyproject.toml>pyproject.json$toml2jsonpyproject.toml->pyproject.json$toml2jsonpyproject.tomlpyproject.json$catpyproject.toml|toml2json$catpyproject.toml|toml2json-json2tomlTo convert JSON to toml:usage:json2toml[<input>[<output]]input/output:eitherapathor'-'forstdin/stdout

examples:$json2toml<pyproject.json$json2tomlpyproject.json$catpyproject.toml|json2toml$catpyproject.toml|json2toml-jsongetTo query JSONYou can query JSON using aJSON Pointerusage:jsonget<json-pointer>[<input>[<output>]]json-pointer:avalidJSONPointerpathinput/output:eitherapathor'-'forstdin/stdout

examples:$toml2jsonpyproject.toml|jsonget/tool/poetry/versionjsonsetTo update JSONYou can update JSON using aJSON Pointerand a valueusage:jsonset<json-pointer><json-value>[<input>[<output>]]json-pointer:avalidJSONPointerpathjson-value:avaluethatcanbeparsedasJSON.input/output:eitherapathor'-'forstdin/stdout


examples:$toml2jsonpyproject.toml|jsonset/tool/poetry/version'"1.2.3"'AcknowledgementsThis project is a trivial wrapper around the following projects:qtoml- a toml parserjsonpointer- a JSON pointer package
Package: jetblack-tweeter
jetblack-tweeterA Python 3.8 asyncio twitter client.This Twitter client is designed to support arbitrary HTTP clients. There is
currently support forbareClientandaiohttp.StatusThis is work in progress, but functional.There is currently limited support for streaming, statuses and accounts. Only the 1.1 api is currently implemented.InstallationInstall withpip, specifying the HTTP backend you wish to use.For bareClient:pipinstalljetblack-tweeter[bareclient]For aiohttp:pipinstalljetblack-tweeter[aiohttp]UsageHere is an example:importasyncioimportosfromjetblack_tweeterimportTweeterfromjetblack_tweeter.clients.bareclientimportBareTweeterSession# Get the secrets from environment variables.APP_KEY=os.environ["APP_KEY"]APP_KEY_SECRET=os.environ["APP_KEY_SECRET"]ACCESS_TOKEN=os.environ["ACCESS_TOKEN"]ACCESS_TOKEN_SECRET=os.environ["ACCESS_TOKEN_SECRET"]asyncdefmain():tweeter=Tweeter(BareTweeterSession(),APP_KEY,APP_KEY_SECRET,# Optional for user authentication.access_token=ACCESS_TOKEN,access_token_secret=ACCESS_TOKEN_SECRET)user_timeline=awaittweeter.statuses.user_timeline()print(user_timeline)account_settings=awaittweeter.account.settings()print(account_settings)account_verify_credentials=awaittweeter.account.verify_credentials()print(account_verify_credentials)# Watch the random sampling of tweets chosen by twitterasyncfortweetintweeter.stream.sample():print(tweet)# Stream tweets which have the tag "#python" from New York# and San Francisco.asyncfortweetintweeter.stream.filter(track=['#python'],locations=[((-122.75,36.8),(-121.75,37.8)),((-74,40),(-73,41))]):print(tweet)result=awaittweeter.statuses.update('Hello from jetblack-tweeter')print(result)if__name__=='__main__':asyncio.run(main())
Package: jetconf
Jetconf is an implementation of theRESTCONFprotocol written in
Python 3.DocumentationGit repositoryMain features:HTTP/2 over TLS, certificate-based authentication of clientsJSON data encodingPer-user candidate datastores with transactionsSupport forNACMInstallationPython 3.5 or newer is required:~$ apt-get install python3
~$ apt-get install python3-pipJetconf can be installed by PyPI:$ python3 -m pip install jetconfRun Jetconf~$ jetconf -c <path_to_config_file.yaml>
Package: jetdb
DisclaimerThis package has strict syntax. If you do not like strict syntax, do not use.
This package makes file handling simpler.Current Version: [Version 0.3.2]Most functions are still in development, so please report bugs if there are any.
Report bugs by sending an email to adityasrijeet12355@gmail.comExample Codefromjetdbimportfunctionsdb=functions()db.setup()Functions Supplied• Setup - Updates, Restarts, Removes dependencies in the background• Add - Adds a line• Index - Finds the line number for you• Index Replace - Indexes the line and replaces it• New File - Creates a new file for you• Clear - Clears a whole file for youHow to use functionsExample code:fromjetdbimportfunctionsdb=jetdb_txt()csv_db=jetdb_csv()db.setup()filename="--> INSERT FILENAME HERE <--"db.clear(f"{filename}")db.add(f"{filename}","This module is cool!",msg=False)db.add(f"{filename}","This module is cool!",msg=True)db.index_replace(f"{filename}","This module is cool!","This module is the best",msg=False)db.index(f"{filename}","This module is the best")db.printRead(f"{filename}")csv.readBase(f"{filename}")You get it, use the variable you used to control the functions, then you add the function name after it.Example code:fromjetdbimportfunctionsdb=functions()db.setup()db.printRead(f"{filename}")That previous block of code will read a file and print it.ChangelogVersion 0.3.2+ Added new functions - Name: JetDB-CSV+ New Custom Error [JetDB-CSV]+ 3 New Functions [JetDB-CSV]+ New Custom Error Inspection Statistics [JetDB-CSV]-\ Original Functions renamed - Name: JetDB-TXTVersion 0.3.1-\ Removed one dependency-\ Custom Error bug fix-\ Colorama dependency changed again-\ Colorama injection revampVersion 0.3.0-\ Changed the dependencies-\ Minor error bug fixes-\ Colorama dependency change-\ Colorama now gets installed in your projectVersion 0.2.99-\ Changed the dependencies-\ Minor error bug fixes+ Colorama+ Custom ErrorsVersion 0.2.4-\ Changed the dependencies-\ Minor error bug fixes+ Added description+ Added ChangelogVersion 0.2.0+ Added a dependency+ Added index feature- Removed search line feature-\ Remastered new file feature-\ Remastered Index Replace featureVersion 0.1.5+ Added a dependency+ Added search line feature-\ Remastered new file feature-\ Remastered Index Replace featureVersion 0.1.1-\ Minor bug fixes-\ Revamped speed-\ Patched up clear file functionVersion 0.1.0How everything started:+ Wait function+ Add line function+ Replace line function beta