Saravanan666/pypi-org huggingface dataset:
Package: elasticbeanstalk-to-env
ElasticBeanstalk to EnvThis tool simply does one thing, connects to an Elastic Beanstalk environment, pulls out any custom envrionment variables that are configured and will display them on stdout, or if given a file for output, will write a file containing the values. This is useful when a project requires a different server not running inside Elastic Beanstalk (one that should not recieve web requests, for example) but still requires the same environment configuration. Trying to keep these envrionments in sync manually does not scale, so this tool can be used as a cronjob to write out a new .env file if the configurations do not match.Installationpip install elasticbeanstalk-to-envUsageRun the eb-to-env command, the--applicationand--environmentoptions are required.--outputrequires a filename in the current working directory, if none is specified, the envrionment variables from EB will be printed to stdout.eb-to-env --application <appname> --environment <envname> --output .env
Package: elastic-companion
elastic-companion=================A command-line tool and API for various Elasticsearch operations... image:: https://travis-ci.org/getconversio/elastic-companion.svg?branch=master:target: https://travis-ci.org/getconversio/elastic-companionInstall-------pip install elastic-companion**Note**: The 1.X versions of elastic-companion support Elasticsearch 1.X andthe 5.X versions support Elasticsearch 5.X. This is similar to the versioningof the official libraryCommands--------To see the list of commands, use the ``-h`` or ``--help`` flag.Each command has a corresponding Python module that can be imported and used asan API rather than from the command-line.### `setup`The `setup` command will load all indexes, mappings, templates and scripts from the data directory, and send them to ES.#### `/scripts`The scripts folder should have `.json` files which act as script descriptors. Each file should have the content:```json{"id": "SCRIPT_ID","lang": "SCRIPT_LANG","body": "SCRIPT_BODY","path": "SCRIPT_BODY_FILE_PATH"}```While `id` and `lang` are required and should match the requirements of ES. These will determine how each script is stored. The values `body` and `path`, however, are mutually exclusive and only one is required. You can specify the script's body directly inline under `body`, or point to a file using `path`.Developing----------If you are using Docker and Docker Compose, then you don't need to fiddle withpython and pip manually. Otherwise, see below.Download Python 3, then::$ pyvenv-3.X venv$ source venv/bin/activate$ pip3 install -r requirements.txt$ ./cli.py -hOn Ubuntu, there's a bit of an issue with ``pip3`` and the above might not work.Then::$ pyvenv-3.X venv --without-pip$ source venv/bin/activate$ cd venv$ wget https://bootstrap.pypa.io/get-pip.py$ python3 get-pip.py$ cd ..$ pip3 install -r requirements.txt$ ./cli.py -hTesting-------Use ``nose``::$ nosetestsor::$ docker-compose run --rm companion nosetestsDeploying---------You need access to the pypi repository first, then it's just a matter of::$ python setup.py sdist bdist_wheel$ twine upload dist/*
Package: elasticcsv
Elastic CSV LoaderThis command line utility loads csv file into an elasticsearch index, using a provided yaml config file.load-csvconsiderations:CSV files MUST include a header with field namesHeader field names will be used as elastic index fieldsA@timestampanddatefields will be added to all indexed docsAdatelogic date could be forced through command parameter.Depending onelastic_index.data_format.parent_data_objectvalue, all original csv header fields
will be arranged under adataparent object.Indexed data will use the same field names thatdownload-indexconsiderations:If csv file is an existing file the download process willappenddata including headersYou have to rename or delete previous csv file if you want to start fresh.InstallDependenciesPython3.8 or higherpippackage managerpipinstall--upgradeelasticcsvRunElastic Connection ConfigConnection configuration is based in a YAML text file (connection.yaml) that must be present in
command directory.Sampleconnection.yamlelastic_connection:proxies:http:"http://user:pass@proxy.url:8080"https:"http://user:pass@proxy.url:8080"user:myuserpassword:mypasswordnode:my.elastic.nodeport:9200elastic_index:data_format:parent_data_object:trueRun command❯ python elasticcsv/csv2es.py load-csv --help
Usage: csv2es.py load-csv [OPTIONS]

  Loads csv to elastic index

Options:
  --csv PATH               CSV File  [required]
  --csv_offset INT         CSV File offset
  --sep TEXT               CSV field sepator  [required]
  --index TEXT             Elastic Index  [required]
  --csv-date-format TEXT   date format for *_date columns as for ex:
                           '%Y-%m-%d'
  --logic_date [%Y-%m-%d]  Date reference for interfaces
  -d, --delete-if-exists   Flag for deleting index before running load
  --help                   Show this message and exit.Python date formats references:String Format Time❯ python elasticcsv/csv2es.py download-index --help
Usage: csv2es.py download-index [OPTIONS]

  Download index to csv file

Options:
  --csv PATH              CSV File  [required]
  --sep TEXT              CSV field sepator  [required]
  --index TEXT            Elastic Index  [required]
  -d, --delete-if-exists  Flag for deleting csv file before download
  --help                  Show this message and exit.Example:csv2es load-csv --csv ./pathtomyfile/file.csv --index myindex --sep ";"

csv2es download-index --csv ./pathtomyfile/file.csv --index myindex --sep ";" -d
Package: elastic-enterprise-search
Official Python client for Elastic Enterprise Search, App Search, and Workplace SearchInstallationThe package can be installed fromPyPI:$python-mpipinstallelastic-enterprise-searchThe version follows the Elastic Stack version so7.11is compatible
with Enterprise Search released in Elastic Stack 7.11.DocumentationSee the documentationfor how to get started,
compatibility info, configuring, and an API reference.ContributingIf you'd like to make a contribution toenterprise-search-pythonwe
providecontributing documentationto ensure your first contribution goes smoothly.Licenseenterprise-search-pythonis available under the Apache-2.0 license.
For more details seeLICENSE.
Package: elasticfun
# elasticfunA small set of tools to make it easier and fun to use pyelasticsearch.
Our main goals here are:Provide an easy and consistent way to build queriesHook up a connection manager to the django settings systemSome of our long term goalsAn API to declare indexes and fieldsA set of commands to manage (update, rebuild, clean) indexes## The Query objectThis API aims to give you a pleasant way to build even complex queries
for elasticsearch. The following snippet demonstrates how it works:`python >>> from elasticfun import Query >>> query =(Query('fitness')&(Query(category='Accessories')|Query(category='SportWear')))>>> str(query)'("fitness"AND(category:"Accessories"ORcategory:"SportWear"))'`### Search words on query objectsThe main constructor of theQueryobject receives only one expression
at once, which means that if you need to combine different words/fields
to build your query, you will have to use different instances of this
object. Which means that this:`python >>> from elasticfun import Query >>>str(Query('icecream'))'"ice cream"' `Is completely different from this:`python >>> from elasticfun import Query >>>str(Query('ice')&Query('cream'))'("ice"AND"cream")'`And completely different from this:`python >>> from elasticfun import Query >>>str(Query('ice')|Query('cream'))'("ice"OR"cream")'`### Building a query from user inputThe above API is meant to be used by programmers to build queries
dynamically through code. But as we know, a very common case for a query
builder object is to receive user input e.g. from a search box.`python >>> from elasticfun import Query >>>str(Query.from_user_input('icecream'))'("ice"AND"cream")'`But, also you can change the default operator for the same operation to
get a result like this:`python >>> from elasticfun import Query >>>str(Query.from_user_input('icecream',default_op='OR'))'("ice"OR"cream")'`## Test coverageThe very first line of this library was a unit-test, it was completely
written under the TDD concepts and we’re planning to keep it that way.
If you’re willing to send a patch to our humble project, please ensure
that the coverage won’t decrease at all.Also, I strongly suggest you to start your proposed feature or bug fix
by writing the tests. It will certainly decrease the complexity of the
actual code and thus improve it’s quality.
Package: elastic_funnel
## Elastic Funnel[![Build Status](https://travis-ci.org/yuecen/elastic_funnel.svg?branch=master)](https://travis-ci.org/yuecen/elastic_funnel)This is an analysis tool for funnel visualization with log from Elasticsearch. Even though we have [Kibana] can display log very well,it can't fit our goal that to analyze series log with context.### PrerequisitesIn order to run elastic_funnel, some works have to prepare.* You have to run your Elasticsearch first* Set the essential config file with your Elasticsearch environment### Install[Pandas] is one of core requirements and it could take a few minutes to complete.```pip install elastic_funnel```#### Add Essential Config FileAdd the argument file ```~/.elastic_funnel``` to your home path, with```[elastic]host = 127.0.0.1port = 9200index = user-behavior-*query = action:state_change AND sessionid:*[fields]timestamp = @timestampstage = stateidentity = sessionid```#### Run for a Funnel```elastic_funnel --stages landingpage login searchpage --start 2016-03-25T00:00:00```You could get a visualization with ASCII characters looks like follows, the percentage means trend from one stage to the next one.```Funnel: landingpage --> login --> searchpage###############################################################################██████████████████████████████████████████████████  27          100.0%  landingpage██████████████                                       8          29.6%   login█                                                    1          12.5%   searchpage```#### Arguments```usage: elastic_funnel [-h] [--host HOST] [--port PORT] [--index INDEX]--stages STAGES [STAGES ...] [--start START] [--end END][--add_query ADD_QUERY]optional arguments:-h, --help            show this help message and exit--host HOST           Host of Elasticsearch--port PORT           Port of Elasticsearch--index INDEX         Index name of Elasticsearch, e.g., user-behavior-log-*--stages STAGES [STAGES ...]Set a path of stages , e.g., index explore userexplore--start START         Start time of log, e.g., 2016-03-24T00:00:00--end END             End time of log, e.g., 2016-03-28T00:00:00--add_query ADD_QUERYAdditional query using syntax of Lucene, https://lucene.apache.org/core/2_9_4/queryparsersyntax.html. Youcan narrow you search target by syntax, e.g.,country:US```### Quick Start with Docker```docker pull yuecen/elastic_funnel``````docker run -it --rm -v ~/.elastic_funnel:/root/.elastic_funnel:ro yuecen/elastic_funnel elastic_funnel --stages landingpage login searchpage```### Quick Start with Gunicorn and cRUL ( *DEVELOPING...* )[Kibana]:https://www.elastic.co/products/kibana[Pandas]:http://pandas.pydata.org/
Package: elastic-git
Adventures in an declarative object-y thing backed by Git and using
Elasticsearch as a query backend.NoteHere be massive dragons.UsagefromelasticgitimportEGfromelasticgit.modelsimportModel,IntegerField,TextFieldworkspace=EG.workspace('/Users/sdehaan/Desktop/test-repo/')workspace.setup('Simon de Haan','simon@praekeltfoundation.org')"""
# The model looks like this

class Person(Model):
    age = IntegerField('The Age')
    name = TextField('The Name')
"""fromelasticgit.tests.baseimportTestPersonasPersonperson1=Person({'age':10,'name':'Foo'})workspace.save(person1,'Saving Person 1')person2=Person({'age':20,'name':'Bar'})workspace.save(person2,'Saving Person 2')person3=Person({'age':30,'name':'Baz'})workspace.save(person3,'Saving Person 3')Data is now persisted in a git repository and is queryable via elasticsearch:>>>fromelasticgitimportEG>>>fromelasticgit.tests.baseimportTestPersonasPerson>>>workspace=EG.workspace('/Users/sdehaan/Desktop/test-repo/')>>>forpersoninworkspace.S(Person).filter(age__gte=20):...printperson.name,person.age...Bar20Baz30Check theexamples/directory for some more code samples.$python-mexamples.basic_usagee6cb25f00870472fa5223d76dc361667Baz302bd470372243411c9abd8fdcb969dcf5Bar20Schema ManagementWe’ve followed the example of ApacheAvrowhen it comes to schema evolution.
Avro compatible schemas can be generated from the command line.Model definitions can be rebuilt fromAvroJSON schema files.A sample model file:classTestFallbackPerson(Model):age=IntegerField('The Age')name=TextField('The name',fallbacks=[SingleFieldFallback('nick'),SingleFieldFallback('obsolete'),])nick=TextField('The nickname',required=False)obsolete=TextField('Some obsolete field',required=False)Generating theAvrospec file$python-melasticgit.toolsdump-schema\>elasticgit.tests.base.TestFallbackPerson>avro.json$python-melasticgit.toolsload-schemaavro.json>models.pyThe generated model file:# NOTE:##   This is an automatically generated Elasticgit Model definition#   from an Avro schema. Do not manually edit this file unless you#   absolutely know what you are doing.## timestamp: 2014-10-14T18:51:23.916194# namespace: elasticgit.tests.base# type: record# name: TestFallbackPerson#fromelasticgitimportmodelsclassTestFallbackPerson(models.Model):name=models.TextField(u"""The name""",fallbacks=[models.SingleFieldFallback('nick'),models.SingleFieldFallback('obsolete'),])age=models.IntegerField(u"""The Age""")obsolete=models.TextField(u"""Some obsolete field""")_version=models.ModelVersionField(u"""Model Version Identifier""")nick=models.TextField(u"""The nickname""")uuid=models.TextField(u"""Unique Identifier""")We’re usingConfModel’s fallbacks feature and encode this inAvro’s
Schema asaliases. This allows you to fall back to older names for
fields:>>>TestFallbackPerson({'obsolete':'oldest name','age':10}).name'oldest name'>>>TestFallbackPerson({'nick':'older name','age':10}).name'older name'>>>TestFallbackPerson({'name':'current name','age':10}).name'current name'
Package: elasticgraph
Force Graph using D3js.How to usefromelasticgraphimportElasticgraph# Initialized3=Elasticgraph()# Load karate exampleadjmat,_=d3.import_example('karate')# Initialized3.graph(adjmat)# Plotd3.show()InstallationTo install elasticgraph, do:pip install elasticgraphTo install elasticgraph from Gitlab source, do:git clone https://gitlab.com/rwsdatalab/public/codebase/tools/elasticgraph.git
cd elasticgraph
pip install .Run tests (including coverage) with:pip install -r requirements-dev.txt
python setup.py testDocumentationInclude a link to your project’s full documentation here.LicenseCopyright (c) 2022, Rijkswaterstaat
Package: elastichash
ElasticHashIntroductionElasticHash implements efficient similarity search by using a two-stage method for efficiently searching binary hash
codes using Elasticsearch.
In the first stage, a coarse search based on short hash codes is performed using multi-index hashing and ES terms lookup
of neighboring hash codes. In the second stage, the list of results is re-ranked by computing the Hamming distance on
long hash codes.The only requirement ist that binary codes to be indexed need to be 256 bits long as currently only 256 bit codes are
supported.For a whole image similarity search system, including model training and model serving,
seehttps://github.com/umr-ds/ElasticHash.Installpip install elastichashUsageCreate an Elastisearch client to use it with ElasticHashes = Elasticsearch(elasticsearch_endpoint)
eh = ElasticHash(es)New items can be added by callingadd(code)wherecodecan be a list, string or numpy array together with
additional fieldseh.add(code, additional_fields={"image_path": "/path/to/an/image"})After adding a suffiently large amount of codes (e.g. 10,000),decorrelate()needs to be called to rearrange the
binary hashcode permutationsTo search documents by their hash code usesearch(code)
Package: elastic-helper
elastic_helperTwo simple functionsOne used to convert an elastic search collection into a dataframe. See the code for the various parameters.One used to convert a dataframe into an elastic search collectionInstallationpipinstallelastic-helperthe pypi page (https://pypi.org/project/elastic-helper/):Example Elastic To PandasParameterses-- The elastic connection objectindex-- The elastic indexquery-- (optional) The elastic query in lucene format Example: "module: *"start-- (optional) The time range start if anyend-- (optional) The time range start if anytimestampfield-- (optional) The timestamp field used by the start and stop parametersdatecolumns-- (optional) A collection of columns that must be converted to datesscrollsize-- (optional) The size of the scroll to usesize-- (optional) The maximum number of records to retrieve_source-- (optional) The fields to retrievefromelastic_helperimportes_helperdataframe=es_helper.elastic_to_dataframe(es,index="docker_stats*",_source=['read','cpu_percent','name'],datecolumns=["read"],timestampfield="read",start=datetime.now()-timedelta(hours=1),end=datetime.now())Example Pandas To ElasticUse an_indexcolumn in the dataframe to specify the target indexUse an_idcolumn in the dataframe to specify the idfromelastic_helperimportes_helperes_helper.dataframe_to_elastic(es,my_df)
Package: elasticityproject
elasticityprojectA collection of classes and routines to help the treatment and presentation of single and polycrystal elastic propertiesInstallation$pipinstallelasticityprojectUsageSee theelasticityprojectdocs:ContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licenseelasticityprojectwas created by EELElasticityGroup. It is licensed under the terms of the GNU General Public License v3.0 license.Creditselasticityprojectwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.
Package: elasticitypy
ElasticityPyA small python library running a rust back-end for computation of linear elastic problems in 3D. The package relies on
quadratic tetrahedral finite elements.InstallationUse the package managerpipto install elasticitypy.pipinstallelasticitypyUsageThe Mesh object requires a list of point tuples, pts = [(x0,y0,z0), (x1,y1,z1), ...] and a list tetrahedra node tuples,
tets = [(0,1,2,3), (2,5,6,10), ...], to initialize.Define groups using boolean functions. Always use all three coordinates x,y,z for all function definitions. Groups are
used to define Dirichlet boundary conditions and may also be used to set volume forces on part of the domain. If no
group is chosen when setting a volume force, a default group is used.fromelasticitypyimportMesh,Dommesh=Mesh(pts,tets)left=mesh.def_group(lambdax,y,z:x==0.)right=mesh.def_group(lambdax,y,z:x==2.)dom=Dom(mesh)dom.embed_bc(lambdax,y,z:[0.,0.,0.],left)dom.embed_bc(lambdax,y,z:[0.,0.,0.],right)dom.set_f(lambdax,y,z:[0.,0.,-2.])cmat=[[1.,0.,0.,0.,0.,0.,0.,0.,0.],[0.,1.,0.,0.,0.,0.,0.,0.,0.],[0.,0.,1.,0.,0.,0.,0.,0.,0.],[0.,0.,0.,1.,0.,0.,0.,0.,0.],[0.,0.,0.,0.,1.,0.,0.,0.,0.],[0.,0.,0.,0.,0.,1.,0.,0.,0.],[0.,0.,0.,0.,0.,0.,1.,0.,0.],[0.,0.,0.,0.,0.,0.,0.,1.,0.],[0.,0.,0.,0.,0.,0.,0.,0.,1.]]dom.set_cmat(cmat)dom.solve()error=dom.error(lambdax,y,z:[0.,0.,x*x-2.*x])PlottingElasticityPy offers two functions in order to extract graphical data in the form of lineslines=dom.plot_dom()disp=dom.plot_disp()The functions return a dictionary of line-coordinates. The first function returns lines with two points, the second
returns lines with three points (parabolas).ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseElasticityPy is licensed underGNU LGPLv3.This software relies on thePyO3library under
theApache-2.0license for ffi
and on therayoncrate under theMITandApache-2.0licenses for parallelism.
Package: elastic-lib
You need to overwrite to setup your connectionsElasticModel You can overwrite this constant in your settings:
-- ELASTIC_DEBUG
-- ELASTIC_INDEX_PREFIX
-- ENVOther files not directly related to elasticsearch:Utils stuff for Django (paginator)Unit testsBuild command:
python setup.py sdist
python setup.py bdist_wheelRun ./build.sh
build the package that will be available in the dist/ directoryif wheel return an error like not installed just run pip install wheel, you may need to install some dependenciesResources about building lib:https://code.tutsplus.com/tutorials/how-to-write-package-and-distribute-a-library-in-python--cms-28693http://www.diveintopython3.net/packaging.htmlProject repo:
gitlab.comSetup in projects guide:
-Create a module name elastic.py and override the get_connection to use target elastic service.
-Create a unit test to ensure that connection is working.
-Elastic periodic model in elastic.py module must inherit like this (ElasticPeriodic, ElasticCustom)
-Build the package and install
--pip install 'package_file generated by ./build.sh command'** About tests and changesIf there's fixes changes to do in elastic_lib make the changes directly in your project i.e edit the file elastic from venv/lib/python3.5/site-packages/elastic_lib/elastic.py
then run the unit test: pytest venv/lib/python3.5/site-packages/elastic_lib/test_elastic.pyIf all unit test are green check the unit test of your project if here also all is green, copy the content of your changes in the elastic_lib project and build a new version.
Then update the version in the different project then run the unit test in each project to be sure that it broke nothing.You can't run the unit test here or on you local.