Saravanan666/pypi-org huggingface dataset:
Package: construct
Construct is a powerfuldeclarativeandsymmetricalparser and builder for binary data.Instead of writingimperative codeto parse a piece of data, you declaratively define adata structurethat describes your data. As this data structure is not code, you can use it in one direction toparsedata into Pythonic objects, and in the other direction, tobuildobjects into binary data.The library provides both simple, atomic constructs (such as integers of various sizes), as well as composite ones which allow you form hierarchical and sequential structures of increasing complexity. Construct featuresbit and byte granularity, easy debugging and testing, aneasy-to-extend subclass system, and lots of primitive constructs to make your work easier:Fields: raw bytes or numerical typesStructs and Sequences: combine simpler constructs into more complex onesBitwise: splitting bytes into bit-grained fieldsAdapters: change how data is representedArrays/Ranges: duplicate constructsMeta-constructs: use the context (history) to compute the size of dataIf/Switch: branch the computational path based on the contextOn-demand (lazy) parsing: read and parse only what you requirePointers: jump from here to there in the data streamTunneling: prefix data with a byte count or compress itExampleAStructis a collection of ordered, named fields:>>> format = Struct(
...     "signature" / Const(b"BMP"),
...     "width" / Int8ub,
...     "height" / Int8ub,
...     "pixels" / Array(this.width * this.height, Byte),
... )
>>> format.build(dict(width=3,height=2,pixels=[7,8,9,11,12,13]))
b'BMP\x03\x02\x07\x08\t\x0b\x0c\r'
>>> format.parse(b'BMP\x03\x02\x07\x08\t\x0b\x0c\r')
Container(signature=b'BMP')(width=3)(height=2)(pixels=[7, 8, 9, 11, 12, 13])ASequenceis a collection of ordered fields, and differs fromArrayandGreedyRangein that those two are homogenous:>>> format = Sequence(PascalString(Byte, "utf8"), GreedyRange(Byte))
>>> format.build([u"lalaland", [255,1,2]])
b'\nlalaland\xff\x01\x02'
>>> format.parse(b"\x004361789432197")
['', [52, 51, 54, 49, 55, 56, 57, 52, 51, 50, 49, 57, 55]]
Package: construct-classes
Parse your binary data into dataclasses. Pack your dataclasses into binary data.construct-classesrely onconstructfor parsing and packing. The
programmer needs to manually write the Construct expressions. There is also no type
verification, so it is the programmer’s responsibility that the dataclass and the
Construct expression match.For fully type annotated experience, installconstruct-typing.This package typechecks withmypyandpyright.UsageAny child ofStructis a Python dataclass. It expects a ConstructStructexpression in theSUBCONattribute. The names of the attributes of the dataclass
must match the names of the fields in the Construct struct.importconstructascfromconstruct_classesimportStruct,subconclassBasicStruct(Struct):x:inty:intdescription:strSUBCON=c.Struct("x"/c.Int32ul,"y"/c.Int32ul,"description"/c.PascalString(c.Int8ul,"utf8"),)data=b"\x01\x00\x00\x00\x02\x00\x00\x00\x05hello"parsed=BasicStruct.parse(data)print(parsed)# BasicStruct(x=1, y=2, description='hello')new_data=BasicStruct(x=100,y=200,description="world")print(new_data.build())# b'\x64\x00\x00\x00\xc8\x00\x00\x00\x05world'construct-classessupport nested structs, but you need to declare them explicitly:classLargerStruct(Struct):# specify the subclass type:basic:BasicStruct=subcon(BasicStruct)# in case of a list, specify the item type:basic_array:List[BasicStruct]=subcon(BasicStruct)# the `subcon()` function supports all arguments of `dataclass.field`:default_array:List[BasicStruct]=subcon(BasicStruct,default_factory=list)# to refer to the subcon, use the `SUBCON` class attribute:SUBCON=c.Struct("basic"/BasicStruct.SUBCON,"basic_array"/c.Array(2,BasicStruct.SUBCON),"default_array"/c.PrefixedArray(c.Int8ul,BasicStruct.SUBCON),)Usedataclasses.field()to specify attributes on fields that are not subcons.There are currently no other features. In particular, the resulting class is a Python
dataclass, but you cannot specify its parameters likefrozenetc.InstallingInstall using pip:$ pip install construct-classesChangelogSeeCHANGELOG.rst.FooterFree software: MIT License
Package: construct-editor
Construct EditorThis package provides a GUI (based on wxPython) for 'construct', which is a powerful declarative and symmetrical parser and builder for binary data. It can either be used standalone or embedded as a widget in another application.Features:show documentation as tooltipdifferent editors for:Integer valuesEnum valuesFlagsEnum valuesDateTime valuesundo/redo in HexEditor and in ConstructEditorextensible for custom constructsInstallationThe preferred way to installation is via PyPI:pip install construct-editorGetting started (Standalone)To start the standalone version, just execute the following in the command line:construct-editorGetting started (as Widgets)This is a simple exampleimportwximportconstructascsfromconstruct_editor.wx_widgetsimportWxConstructHexEditorconstr=cs.Struct("a"/cs.Int16sb,"b"/cs.Int16sb,)b=bytes([0x12,0x34,0x56,0x78])app=wx.App(False)frame=wx.Frame(None,title="Construct Hex Editor",size=(1000,200))editor_panel=WxConstructHexEditor(frame,construct=constr,binary=b)editor_panel.construct_editor.expand_all()frame.Show(True)app.MainLoop()This snipped generates a GUI like this:WidgetsConstructHexEditorThis is the main widget ot this library. It offers a look at the raw binary data and also at the parsed structure.
It offers a way to modify the raw binary data, which is then automaticly converted to the structed view. It also supports to modify the structed data and build the binary data from it.ConstructEditorThis is just the right side of theConstructHexEditor, but can be used also used as standalone widget. It provides:Viewing the structure of a construct (without binary data)Parsing binary data according to the constructHexEditorJust the left side of theConstructHexEditor, but can be used also used as standalone widget. It provides:Viewing Bytes in a Hexadecimal formCallbacks when some value changedChangeable format viaTableFormat
Package: constructible
Build Status:The constructible module provides exact representation ofconstructible numbersin Python.Python 2 and Python 3 are supported.The constructible numbers are the smallest field containing the rational numbers, where the square root of
any non-negative constructible number is constructible as well. The non-negative constructible numbers are
the lengths which can be constructed from the unit length using only a compass and a straightedge.UsageUsually thesqrtfunction is enough to work with constructible numbers:>>> from constructible import sqrt
>>> x = sqrt(2) + sqrt(3)
>>> print(x)
((0 + 1 * sqrt(2)) + (1 + 0 * sqrt(2)) * sqrt((3 + 0 * sqrt(2))))
>>> y = x*x
>>> print(y)
((5 + 0 * sqrt(2)) + (0 + 2 * sqrt(2)) * sqrt((3 + 0 * sqrt(2))))
>>> z = y*y
>>> t = 10*y - z
>>> t == 1
TrueInstallationTo install from PYPI just typepip install constructibleThe library is a single pure python file, so it is also easy to install by hand.TestingThere are some tests usingunittest. Thanks toTravis-CIeach push to github triggers a test:Releasing on PYPIThe following steps are needed:make sure .pypirc is up to date:[distutils]
index-servers =
  pypi
  pypitest

[pypi]
repository=https://pypi.org/legacy/
username=xxx
password=xxx

[pypitest]
repository=https://test.pypi.org/legacy/
username=xxx
password=xxxUpdate the version in setup.pyTag the version in git:git tag 0.1 -m "Adds a tag so that we can put this on PyPI."
git push --tags originTest release with:python setup.py sdist upload -r pypitestProductive release with:python setup.py sdist upload -r pypiChangelog2016-05-23 V0.1 Initial Release2016-09-30 V0.2 Fixing Issue 1 and added Tests2016-10-03 V0.3 Fixing Issue 22016-10-23 V0.4 Added __hash__ and __float__, speed optimizations2020-07-08 V0.5 New hash function and improvements byArsenii A.AknowledgementsThanks toAnders Kaseorgwhoseimplementation of constructible numbers in Haskellprovided inspiration and in particular thealgorithm for taking square rootsin quadratic extension fields.
Package: construction-site
construction-site: a usable library for RDF constructionUses:rdflib >= 5.0.0Rough API design:ConstructionSite().load(file1.json)# Creates graph from direct json mapping.construct(query1)# Creates new graph containing mapping from file1.json graph.construct(query2)# Creates new graph containing mapping from file1.json graph.load(file2.json)# Creates graph from direct json mapping.construct(query3)# Creates new map graph containing mapping from file2.json graph.collect()# aggregate all constructed graphs into one.check(shacl)# validate the constructed graph against shacl.run()
Package: constructive-geometries
Constructive Geometries - Python librarySimple tools to define world locations from a set of topological faces and set algebra. For example, one could define a "rest of the world" which started from all countries, but excluded every country who name started with the letter "a".Documentationandusage example.Builds on top ofconstructive geometries.Basic installation needswraptandcountry_converter; GIS functions needshapely, andfiona.
Package: construct-legacy
Construct is a powerfuldeclarativeparser (and builder) for binary data.Instead of writingimperative codeto parse a piece of data, you declaratively
define adata structurethat describes your data. As this data structure is not
code, you can use it in one direction toparsedata into Pythonic objects,
and in the other direction, convert (“build”) objects into binary data.The library provides both simple, atomic constructs (such as integers of various sizes),
as well as composite ones which allow you form hierarchical structures of increasing complexity.
Construct featuresbit and byte granularity, easy debugging and testing, aneasy-to-extend subclass system, and lots of primitive constructs to make your
work easier:Fields: raw bytes or numerical typesStructs and Sequences: combine simpler constructs into more complex onesAdapters: change how data is representedArrays/Ranges: duplicate constructsMeta-constructs: use the context (history) to compute the size of dataIf/Switch: branch the computational path based on the contextOn-demand (lazy) parsing: read only what you requirePointers: jump from here to there in the data streamNoteThis is alegacyfork of the original construct 2.5.3 repackaged for compatibility purposes.ExampleAPascalStringis a string prefixed by its length:>>> from construct_legacy import *
>>>
>>> PascalString = Struct("PascalString",
...     UBInt8("length"),
...     Bytes("data", lambda ctx: ctx.length),
... )
>>>
>>> PascalString.parse("\x05helloXXX")
Container({'length': 5, 'data': 'hello'})
>>> PascalString.build(Container(length = 6, data = "foobar"))
'\x06foobar'Instead of specifying the length manually, let’s use an adapter:>>> PascalString2 = ExprAdapter(PascalString,
...     encoder = lambda obj, ctx: Container(length = len(obj), data = obj),
...     decoder = lambda obj, ctx: obj.data
... )
>>> PascalString2.parse("\x05hello")
'hello'
>>> PascalString2.build("i'm a long string")
"\x11i'm a long string"See more examples offile formatsandnetwork protocolsin the repository.ResourcesConstruct’s homepage ishttp://construct.readthedocs.org, where you can find all kinds
of docs and resources. The library itself is developed ongithub;
please usegithub issuesto report bugs, and
github pull-requests to send in patches. For general discussion or questions, please use thenew discussion group.RequirementsConstruct should run on any Python 2.5-3.5 or PyPy implementation.Its only requirement issix, which is used to overcome the
differences between Python 2 and 3.
Package: constructor-io
Constructor.io Python ClientA Python client forConstructor.io.Constructor.ioprovides search as a service that optimizes results using artificial intelligence (including natural language processing, re-ranking to optimize for conversions, and user personalization).DocumentationFull API documentation is available onGithub PagesRequirementsRequesting results from your back-end can be useful in order to control result rendering logic on your server, or augment/hydrate results with data from another system. However, a back-end integration has additional requirements compared to a front-end integration. Please review theAdditional Information For Backend Integrationsarticle within the wiki for more detail.1. Installpip install constructor-io2. Retrieve an API key and tokenYou can find this in yourConstructor.io dashboard. Contact sales if you'd like to sign up, or support if you believe your company already has an account.3. Implement the ClientOnce imported, an instance of the client can be created as follows:fromconstructor_io.constructor_ioimportConstructorIOconstructorio=ConstructorIO({"api_key":"YOUR API KEY",})4. Retrieve ResultsAfter instantiating an instance of the client, four modules will be exposed as properties to help retrieve data from Constructor.io:search,browse,autocomplete, andrecommendations.Developmentmakeinstall# install dependenciespipenvrunpylintconstructor_io# run lintpipenvrunpytest.# run tests with coverage reportmakedocs# output documentation to `./docs` directory
Package: construct-roms
Construct ROMsConstruct ROMs is a Python package that builds distinguished reduced-order models (ROMs) that approximate the dynamics of 2D Rayleigh–BÃ©nard convection. The model domain is a horizontally periodic domain with stress-free, isothermal walls at top and bottom. ROMs are built using Galerkin expansion with Fourier basis functions.Model equations:Features:ROMs can be printed to the consoles in LaTeX format or printed to a MATLAB or Python ODE file for further analysisModels can be selected from the HK hierarchy or the user can input them manuallyInclude scale factors for easier SDP scalingCan check certain conservation properties (energy and vorticity balance)Package Requirementsnumpy (Version 1.5 or later)sympy (Version 1.6 or later)InstallationTo install the package, download or clone this repository and usefrom constructROM import construct_romsfrom the directory containing the package.InstructionsTo construct a system of ROMs, use the commandconstruct_roms(*args). Options can be passed as function arguments as detailed below.Options:mode_sel: Method of mode selection. Current options:"hk" : select model from hk hierarchy"input" : input list of modes manually (as p_modes, t_modes arguments)p_modes: List of psi modes, represented as a list of tuples. Only necessary ifmode_type="input"t_modes: List of theta modes, formatted as a list of tuples. Same format asp_modeshier_num: Number in the HK hierarchy (e.g.hier_num = 1denotes the first model)print_to: Specify where to print output data. Options:"console" : prints ODEs to console in LaTeX format"matlab" : creates Matlab ODE file (.m)"python" : creates Python ODE file (.py)"none:" : don't print ROMs as outputout_dir: Name of directory to print outputscaling:   Variable scaling used in model. Options:"unit cube" : psi -> R^(1/2)*psi, t -> R^(-1/2)*t, useful for SDP computations"standard" : standard scaling of Rayleigh-Benard"normalize theta" : theta -> theta/R, used in some prior ROM studiesscale_factors: If True, includes individual scale factors for each variable (True/False)check_conserv: If True, verifies that certain conservation laws are satisfiedExamples:construct_roms(mode_sel="hk", hier_num=1, print_to="console" scale factors=False)Generates the first model in the HK hierarchy (Lorenz model plus one shear mode) without scale factors and prints output to the consoleconstruct_roms(mode_sel="hk", hier_num=2, print_to="matlab", out_dir="HK8_model")Generates Matlab ODE file for the HK8 model with scale factors to folder "HK8_model"construct_roms(model_sel="input", p_modes=[(1,1)], t_modes=[(0,2), (1,1)], print_to="none", check_conserv=True)Checks energy and vorticity balance laws for the Lorenz equations
Package: constructs
ConstructsSoftware-defined persistent stateWhat are constructs?Constructs are classes which define a "piece of system state". Constructs can be composed together to form higher-level building blocks which represent more complex state.Constructs are often used to represent thedesired stateof cloud applications. For example, in the AWS CDK, which is used to define the desired state for AWS infrastructure using CloudFormation, the lowest-level construct represents aresource definitionin a CloudFormation template. These resources are composed to represent higher-level logical units of a cloud application, etc.ContributingThis project has adopted theAmazon Open Source Code of
Conduct.We welcome community contributions and pull requests. See ourcontribution
guidefor more information on how to report issues, set up a
development environment and submit code.LicenseThis project is distributed under theApache License, Version 2.0.
Package: consul-announcer
Service announcer forConsul.Functionality:Register/deregister services with checksSpawn a subprocessPeriodically mark all TTL checks as passed (if any)InstallFor regular usage:pipinstallconsul-announcer# or add it as a requirementUsageconsul-announcer--config="JSON or @path"[-h][--agent=hostname[:port]][--token=acl-token][--interval=seconds][--verbose]--command[arguments]Arguments:-h,--helpShowthishelpmessageandexit.--agenthostname[:port]Consulagentaddress:hostname[:port].Default:localhost(defaultportis8500).YoucanalsouseCONSUL_ANNOUNCER_AGENTenvvariable.--config"JSON or @path"ConsulconfigurationJSON(required).Ifstartswith@-consideredasfilepath.YoucanalsouseCONSUL_ANNOUNCER_CONFIGenvvariable.--tokenacl-tokenConsulACLtoken.YoucanalsouseCONSUL_ANNOUNCER_TOKENenvvariable.--intervalsecondsIntervalforperiodicmarkingallTTLchecksaspassed,inseconds.ShouldbelessthanminTTL.YoucanalsouseCONSUL_ANNOUNCER_INTERVALenvvariable.--verbose,-vVerboseoutput.Youcanspecify-vor-vv.Minimal usage:consul-announcer--config=@path/to/config.json--some-process--with--arguments--configIt should be valid JSON that contains{"service":{...}}or{"services":[...]}:consul-announcer--config='{"service": {"name": "test service", "check": {"ttl": "10s"}}}'--...If starts with@- considered as file path:consul-announcer--config=@path/to/config.json--...ReadConsul docs about services definition.All the services & checks will be registered on process start and deregistered on process termination.You can also useCONSUL_ANNOUNCER_CONFIGenv variable.--intervalIn the example above, the interval is not specified so it’ll be calculated as min TTL / 10 (if there are TTL checks specified in the config). But you can provide your own value(in seconds):consul-announcer--interval=3...If there are no TTL checks and no--interval- an error will raise.You can also useCONSUL_ANNOUNCER_INTERVALenv variable.--addressDefault agent address islocalhost(with default port8500). You can provide your own:consul-announcer--agent=1.2.3.4:5678...You can also useCONSUL_ANNOUNCER_AGENTenv variable.--tokenConsul ACL token. Required only in you’ve enabled ACL in your Consul agent.consul-announcer--token=01234567-89ab-cdef-0123-456789abcdef...You can also useCONSUL_ANNOUNCER_TOKENenv variable.--verboseOutput levels:by default only errors and warnings are printed-vwill show info messages-vvwill show info and debug messagesUsage in Python codefromannouncer.serviceimportServiceservice=Service('localhost:1234','@/path/to/config.json',['sleep','5'],'01234567-89ab-cdef-0123-456789abcdef',0.5)service.run()DevelopmentInstallgitclone<this-repo>cdconsul-announcerpipinstall-rrequirements/test.txt-e.TestTest configuration is defined in thetox.inifile and includespy.testtests andflake8source code checker. You can run all of the tests:pythonsetup.pytestTo run just thepy.testtests, notflake8, and to re-use the currentvirtualenv:py.testReleaseTests must be passingDon’t forget to test all added functionalityUpdateCHANGELOGwith the release infoUpdateREADME(if necessary)Commit all the changesCreate new version tag(e.g.):v1.2.3Push commits and tagsRelease new version on PyPI
Package: consulbacks3
consulbacks3This package is preset on pypi atconsulbacks3This is the package to
create consul backup , zip it and push the same to the s3 for the backup
purpose.The package creates simple yml files which contains key value pairs
seperated by space colon space i.e “ : “ .Installtion instructionInstall the package on the server where consul is installed.sudo pip install consulbackups3Runconsulbacks3-configureto configure and enter the below
details and save the settings .AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYBUCKET_NAMECONSUL_DATA_URL(default is -
“http://localhost:8500/v1/kv/?recurse”)Runconsulbacks3to take backup of all of the key-value pairs .Note: You will need aws access_key and secret which have access to the
corresponding bucket.Things to do :Documentation at readthedocsRestore/write to consul from the backup file
Package: consulconf
Use Consulconf to get or set key:value data from json files or consul.This tool supports the concept of inheritance, where one namespace ofkey:value pairs can inherit one or more keys from another namespace.This is particularly useful if, for instance, you wish to manageenvironment variables for several applications that may share certainvariables in common.  Currently, though, parent namespaces (ie anynamespace with children) cannot inherit from other namespaces.  It maybe worth changing this behavior if someone can come up with a goodreason.You don't necessarily need consul to use this tool.Install:```pip install consulconf```Usage:```basic usageconsulconf -h``````mkdir json_files# basic examplesecho '{"MYVAR": "123", "OTHERVAR": 456}' > ./json_files/namespace.jsonconsulconf -i ./json_files --dry_runconsulconf -i ./json_files --app namespace envconsulconf -i ./json_files --app namespace echo \$MYVAR# namespace filteringecho '{"app1": {"AVAR": 1}, "app2": {"AVAR": 2}}' > ./json_files/apps.jsonconsulconf -i ./json_files --dry_runconsulconf -i ./json_files --dry_run --filterns '^apps/.*[12]$'# inheritanceecho '{"_inherit": ["namespace.MYVAR"], "nines": 999}' > ./json_files/ns2.jsonconsulconf -i ./json_files --dry_run --filterns 'ns2'consulconf -i ./json_files --app ns2 env# push namespaces to consul (you need to have a consul agent installed)consulconf -i ./json_files -p 127.0.0.1:8500/v1/kv/my_namespaces# get namespaces from consulconsulconf -i http://127.0.0.1:8500/v1/kv/my_namespaces --dry_runconsulconf -i http://127.0.0.1:8500/v1/kv/my_namespaces --app ns2 env```Additionally, you can use this tool to raw copy the contents of jsonfiles into consul.  If you run the below commands and then navigate toconsul, you will see the data in your json files copied to consul.```consulconf -i ./json_files --dry_run --rawconsulconf -i ./json_files -p http://127.0.0.1:8500/v1/kv/rawdata --rawconsulconf -i http://127.0.0.1:8500/v1/kv/my_namespaces --dry_run --raw```NOTE:  Some of the examples above assume a consul agent is running onyour computer.  To get consul working, you could run something like:http://www.consul.io/intro/getting-started/agent.html
Package: consul-decouple
An extension forpython-decoupleto read Consul usingpython-consul2.pipinstallconsul-decoupleHow it worksRead config from environment;If it’s connected with Consul, it’ll read the config from there;python-decouple behavior:Repository: ini or .env file;default argument passed to config;How to useRead Consul settings from enviroment. CONSUL_HOST=host,
CONSUL_PORT=port, CONSUL_TOKEN=token, CONSUL_SCHEME=schemefromconsul_decoupleimportconfigmy_key=config('my_bool_key',cast=bool,default=False)Creating a custom Consul connectionfromconsulimportConsulfromconsul_decoupleimportAutoConfigconsul=Consul(host='127.0.0.1',port=8500,token=None,scheme='http')config=AutoConfig(consul)my_key=config('my_bool_key',cast=bool,default=False)Read only one KeyValue from Consul and parse it from JSON. It’ll
reads the configs from the parsed JSONfromconsul_decoupleimportAutoConfigconfig=AutoConfig(json_kv='my_key_with_json_value')my_key=config('my_bool_key',cast=bool,default=False)Contributegitclonehttps://github.com/lucasrcezimbra/consul-decouplecdconsul-decouplepython-mvenv.venvsource.venv/bin/activatepipinstall-rrequirements-dev.txtpre-commitinstalldocker-composeup-dpytest