Saravanan666/pypi-org huggingface dataset:
Package: eventextraction
一、文本事理类型分析中文复合事件抽取，可以用来识别文本的模式，包括条件事件、顺承事件、反转事件。我仅仅是对代码做了简单的修改，增加了函数说明注释和stats函数，可以用于统计文本中各种模式的分布(数量)情况。代码原作者为刘焕勇https://github.com/liuhuanyong事件图谱（事理图谱）的类型项目地址https://github.com/liuhuanyong/ComplexEventExtraction项目介绍很详细，感兴趣的一定要去原项目看一下。事件含义形式化事件应用图谱场景举例条件事件某事件条件下另一事件发生如果A那么B事件预警时机判定<限制放宽,立即增产>反转事件某事件与另一事件形成对立虽然A但是B预防不测反面教材<起步晚,发展快>顺承事件某事件紧接着另一事件发生A接着B事件演化未来意图识别<去旅游,买火车票>分析出文本中的条件、顺承、反转，理论上就可以构建知识网络(本库做不到这可视化)。
1、反转事件图谱2、条件事件图谱二、安装方法2.1 方法一最简单的安装,现在由于国内外网络不稳定，可能需要尝试几次pip3 install eventextraction2.2 加镜像站点有的童鞋已经把pip默认安装镜像站点改为国内，如果国内镜像还未收录我的这个包，那么可能会安装失败。只能从国外https://pypi.org/simple站点搜索eventextraction资源并安装pip3 install eventextraction -i https://pypi.org/simple2.3 国内镜像安装如果国内镜像站点已经收录，那么使用这个会更快pip3 install eventextraction -i https://pypi.tuna.tsinghua.edu.cn/simple/三、使用3.1 主函数from eventextraction import EventsExtraction

extractor = EventsExtraction()
content = '虽然你做了坏事，但我觉得你是好人。一旦时机成熟，就坚决推行'
datas = extractor.extract_main(content)
print(datas)运行结果[{'sent': '虽然你做了坏事，但我觉得你是好人', 'type': 'but', 'tuples': {'pre_wd': '虽然', 'pre_part': '你做了坏事，', 'post_wd': '但', 'post_part ': '我觉得你是好人'}},
{'sent': '一旦时机成熟，就坚决推行', 'type': 'condition', 'tuples': {'pre_wd': '一旦', 'pre_part': '时机成熟，', 'post_wd': '就', 'post_part ': '坚决推行'}}]3.2 统计from eventextraction import EventsExtraction

extractor = EventsExtraction()
content = '虽然你做了坏事，但我觉得你是好人。一旦时机成熟，就坚决推行'
datas = extractor.extract_main(content)
print(extractor.stats(datas))运行结果{'but': 1, 'condition': 1, 'seq': 0, 'more': 0, 'other': 0}如果如果您是经管人文社科专业背景，编程小白，面临海量文本数据采集和处理分析艰巨任务，可以参看《python网络爬虫与文本数据分析》视频课。作为文科生，一样也是从两眼一抹黑开始，这门课程是用五年时间凝缩出来的。自认为讲的很通俗易懂o(￣︶￣)o，python入门网络爬虫数据读取文本分析入门机器学习与文本分析文本分析在经管研究中的应用感兴趣的童鞋不妨 戳一下《python网络爬虫与文本数据分析》进来看看~更多B站:大邓和他的python公众号：大邓和他的python知乎专栏：数据科学家
Package: eventfabric
Python 2 and 3 implementation of Event Fabric API to send events.SetupThe library dependes on theRequestsHTTP library, install it with:pip install requestsUsagesee the examples folder for more usage examples# import the library
>>> import eventfabric as ef

# create a client instance specifying username and password
>>> client = ef.Client("username", "password")

# authenticate, should return True and 200, if not there was an error
>>> client.login()
(True, <Response [200]>)

# create an event instance

# the first parameter is a free form JSON
# value that contains information about the event

# the second is the name of the channel where that event will go to

# the channel is used to subscribe to a stream of events with the same
# channel id
>>> event1 = ef.Event({"name": "Bob", "count": 10}, "my.channel")

# send the event, it should return True and 201, if not there was an error,
# make sure to check for authentication errors on long running agents to
# reauthenticate in case your credentials expire
>>> client.send_event(event1)
(True, <Response [201]>)Testpython tests/eventfabric_tests.pyLicenseMIT
Package: eventgraphs
# Generalised Event GraphsA python library for analysing temporal networks.#### Features:Building the temporal event graph (static representation of a temporal network)Calculating temporal motifs (with arbitrary number of events)Inter-event time distributionsMotif distributionsNetwork decompositions into temporal componentsSaving/Loading functionalityPlease cite the following papers when using:Generalised Event Graphs.Andrew Mellor(2018)The Temporal Event Graph.Andrew Mellor(2017)
[ArXiv Link](https://arxiv.org/abs/1706.02128)
Package: eventhub-analyzer
Event Hub AnalyzerEvent Hub Analyzer is a small command line tool that can be used
to analyze certain aspects of Event Hubs.Installationpip install eventhub-analyzerCheckpoints per partitionFor every event hub, consumer group, the number of
events/sequence numbers between two invocations is retrieved and
the throughput per partition is calculated. This can be used to
determine if the load is correctly distributed among partitions.When there are some partition that get little to no throughput while
others have large throughput, it is a sign that the partition key
is not chosen optimally and that you should try to choose a property
with a higher cardinality as the partition key.Usageeventhub-analyzercheckpoints-nCONTAINER_NAME-cCONNECTION_STRINGYou can also specify the settings via environment variables:exportSTORAGE_ACCOUNT_CONNECTION_STRING='DefaultEndpointsProtocol=https;AccountName=x;AccountKey=y;EndpointSuffix=core.windows.net'exportCONTAINER_NAME='event-hub-offsets'eventhub-analyzercheckpointsExample outputEvent Hub: telemetry, Consumer Group: my-consumer
Event Hub   Consumer Group   Partition   Events per second
telemetry   my-consumer              0             158.034
telemetry   my-consumer              1             203.257
telemetry   my-consumer              2             148.103
telemetry   my-consumer              3               0.000
telemetry   my-consumer              4             201.780
telemetry   my-consumer              5             106.081
telemetry   my-consumer              6              72.307
telemetry   my-consumer              7             160.783
telemetry   my-consumer              8             118.351As you can see, partition 3 is not getting any events and
the number of events is not well distributed overall. There
might be some gains possible by choosing a different partition key
(or by partitioning manually on the client).Clearing checkpointsExample:eventhub-analyzerclear-checkpoints--consumer-groupredis-timeseriesPublishingpoetry build
poetry publish
Package: eventhub-logging
IntroductionWe developped this package for sending logging message to Azure EventHub system.Installationpipinstalleventhub-loggingUsageRequirementsazure-eventhub version: 5.2.0 or higherExamplesimportloggingfromlogging_handler.eventhub_handlerimportEventHubHandlerlogger=logging.getLogger(__name__)logger.addHandler(EventHubHandler(endpoint="your eventhubs endpoint",access_keyname="your azure event hub access keyname",access_key="your access key value",entity_path="your event hub",partition_key="sth to partition"))logger.info("Send my first logging message ")ContributeJavariel
Package: eventhubs
eventhubsCLI tool to send and receive event data from Azure Event HubsInstallationInstall this tool usingpip:pip install eventhubsUsageReceivingFor receiving data to an event hub, run:eh eventdata receiveSendingFor sending a single event to an event hub, run:eh eventdata send --text '{"message": "Hello Spank"}'You can also send multiple events in a batch by using--textmore than once:eh eventdata send --text '{"message": "Hello Spank"}' --text '{"message": "Hello Spank (yes, again)"}'For sending the lines in a text files as event, run:eh eventdata send --lines-from-text-file multiline.txtFor sending the lines fromstdinas event, run:cat multiline.txt | eh eventdata sendConfigurationYou can set up the connection string and event hub name using the command line options:eh eventdata receive --connection-string "Endpoint=.." --name "application-insights"or the environment variables (or a mix of both):export EVENTHUB_CONNECTION_STRING="Endpoint=sb://...="
export EVENTHUB_NAME="application-insights"

eh eventdata receive

eh eventdata receive --name "another-name"Defaults to printing the message payload only, so it is easier to combine output with other tools, likejq:$ eh eventdata receive | jq '.records[].tenantId' 
"1de2b364-21e1-4866-bb46-7804f17c417d"
"1de2b364-21e1-4866-bb46-7804f17c417d"
"1de2b364-21e1-4866-bb46-7804f17c417d"But you can still turn on verbose and get more information about what's going on:$ eh --verbose eventdata receive
Receiving events from mbranca
Received event from partition 0: {"records": [{....For help, run:eventhubs --helpYou can also use:python -m eventhubs --helpDevelopmentTo contribute to this tool, first checkout the code. Then create a new virtual environment:cd eventhubs
python -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: eventing
eventingA pythonic event emitter inspired by Node.js'EventEmitterand Python'slogginglibraries.This project adheres toSemantic Versioning.RationaleThis project sprung to life partly from wanting to learn TDD and publishing a
python package, but also from the need of an event pattern akin to Node.js'
EventEmitter that will with asyncio in a nice pythonic way.I envision it in a similar API as Python's logging module, in that it'll
"just work" regardless of event loops, threads (and possibly even subprocesses);
something I haven't found in the myriad event packages on PyPI. Hopefully, it'll
become something of use to others as well.DocsAutogenerated API docs can be found athttps://eventing.readthedocs.io.Note:Until a version>=1.0.0these are not maintained as a public API
has yet to be established.DevelopmentSeeDEVELOPMENTChangelogSeeCHANGELOGLicenseMIT, seeLICENSE
Package: eventipy
Eventipyeventipy is an in-memory event library for python 3.6 and greater.Getting StartedTo install:pip install eventipyFor full documentation please visit:https://eventipy.readthedocs.io/en/stable/UsagePublishing events:importasynciofromeventipyimportevents,Eventevent=Event(topic="my-topic")asyncio.run(events.publish(event))Subscribing to topics:fromeventipyimportevents,Event@events.subscribe("my-topic")defevent_handler(event:Event):# Do something with eventprint(event.id)now every time an event with topicmy-topicis published,event_handlerwill be called.Define your own events like this:classMyEvent(Event):topic="event-topic"foo:intbar:inteventipy uses pydantic, so there is automatic type checking!TestsUse the package managerpipto install eventipypytest tests/unitContributingPull 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.VersioningWe useSemVerfor versioning. For the versions available, see the tags on this repository.To bump the version we usebumpversionto handle versions. Actions:Bug fixes:$bumpversionpatch# from v1.0.0 -> v1.0.1New features:$bumpversionminor# from v1.0.0 -> v1.1.0Breaking changes:$bumpversionmajor# from v1.0.0 -> v2.0.0These commands will create a commit, if you want to avoid this please add the--no-commitflag.LicenseWe use the MIT license, seeLICENSE.mdfor details
Package: eventiq
Cloud native framework for building event driven applications in PythonNote: This package is under active development and is not recommended for production useVersion: 0.2.0Documentation:https://performancemedia.github.io/eventiq/Repository:https://github.com/performancemedia/eventiqAboutThe package utilizesanyioandpydanticas the only required dependencies.
For messagesCloud Eventsformat is used.
Service can be run as standalone processes, or included into starlette (e.g. FastAPI) applications.InstallationpipinstalleventiqMultiple broker support (in progress)Stub (in memory usingasyncio.Queuefor PoC, local development and testing)NATS (with JetStream)Redis Pub/SubKafkaRabbitmqGoogle Cloud PubSubAnd more comingOptional Dependenciescli-typerbroker of choice:nats,kafka,rabbitmq,redis,pubsubcustom message serializers:msgpack,orjsonprometheus- Metric exposure viaPrometheusMiddlewareopentelemetry- tracing supportMotivationPython has many "worker-queue" libraries and frameworks, such as:CeleryDramatiqHueyarqHowever, those libraries don't provide a pub/sub pattern, useful for creating
event driven and loosely coupled systems. Furthermore, the majority of those libraries
do not supportasyncio. This is why this project was born.Basic usage# main.pyimportasynciofromeventiqimportService,CloudEvent,Middlewarefromeventiq.backends.nats.brokerimportJetStreamBrokerclassSendMessageMiddleware(Middleware):asyncdefafter_broker_connect(self,broker:"Broker")->None:print(f"After service start, running with{broker}")awaitasyncio.sleep(10)foriinrange(100):awaitbroker.publish("test.topic",data={"counter":i})print("Published event(s)")broker=JetStreamBroker(url="nats://localhost:4222")broker.add_middleware(SendMessageMiddleware())service=Service(name="example-service",broker=broker)@service.subscribe("test.topic")asyncdefexample_run(message:CloudEvent):print(f"Received Message{message.id}with data:{message.data}")Running the serviceeventiqrunmain:serviceScalingEach message is load-balanced (depending on broker) between all service instances with the samename.
To scale number of processes you can use containers (docker/k8s),supervisor,
or web server like gunicorn.FeaturesModern,asynciobased python 3.8+ syntaxMinimal dependencies, onlyanyioandpydanticare requiredAutomatic message parsing based on type annotations (like FastAPI)Code hot-reloadHighly scalable: each service can process hundreds of tasks concurrently,
all messages are load balanced between all instances by defaultResilient - at least once delivery for all messages by defaultCustomizable & pluggable message encoders (json, msgpack, custom)Multiple broker support (Nats, Kafka, Rabbitmq, Redis, PubSub, and more coming)Easily extensible via Middlewares and PluginsCloud Events standard as base message structure (no more python specific*argsand**kwargsin messages)AsyncAPI documentation generation from codeTwelve factor app approach - stdout logging, configuration through environment variablesOut-of-the-box integration with Prometheus (metrics) and OpenTelemetry (tracing)Application bootstrap via.yamlfile (see examples/configuration)
Package: event-isc
Inter-service event communicationThis library handles inter (micro)services communication in a decoupled way using the event/observer pattern.The code raises an event when something happens and that event fires notifications to the registered listeners.Implemented notifications are:Celery taskHTTP requestYAML file configurationCan be configured with a yaml file like this, passed as initialization argument or in environment variable EVENTISC_CONFIGname_prefix:myapp.listeners:-kind:httpevent_name:myapp.user_createdurl:http://notification-service.mycompany.com/send-welcome/requests_kwargs:auth:["myuser","password"]request_format:jsondata:user_id:"{event_data['user'].id}"email:"{event_data['user'].email}"-kind:celeryevent_name_regex:myapp[.].*_createdqueue:foo_servicetask_name:foo_handle_createdtask_kwargs:event_name:{event_name}event_data:{event_data}Usageimporteventisc...eventisc.trigger("user_created",{"user":user})# Should fire both listenerseventisc.trigger("foo_created",{"foo":"bar"})# Should fire only celery
Package: event-isc-py2
Inter-service event communicationThis library handles inter (micro)services communication in a decoupled way using the event/observer pattern.The code raises an event when something happens and that event fires notifications to the registered listeners.THIS IS A PYTHON 2.7 COMPATIBLE PACKAGE, FOR PYTHON 3 USEhttps://pypi.org/project/event-isc/Implemented notifications are:Celery taskHTTP requestYAML file configurationCan be configured with a yaml file like this, passed as initialization argument or in environment variable EVENTISC_CONFIGname_prefix:myapp.listeners:-kind:httpevent_name:myapp.user_createdurl:http://notification-service.mycompany.com/send-welcome/requests_kwargs:auth:["myuser","password"]request_format:jsondata:user_id:"{event_data['user'].id}"email:"{event_data['user'].email}"-kind:celeryevent_name_regex:myapp[.].*_createdqueue:foo_servicetask_name:foo_handle_createdtask_kwargs:event_name:{event_name}event_data:{event_data}Usageimporteventisc...eventisc.trigger("user_created",{"user":user})# Should fire both listenerseventisc.trigger("foo_created",{"foo":"bar"})# Should fire only celery
Package: eventIsotropy
Event IsotropyA Robust Measure of Event Isotropy at Colliders (https://arxiv.org/abs/2004.06125)C. Cesarotti and J. ThalerRepository created December 2019 by Cari Cesarotti (ccesarotti@g.harvard.edu)InstallationFrom this repositoryIn your Python environment from the top level of this repository runpython -m pip install .From GitHubIn your Python environment runpython -m pip install "git+https://github.com/caricesarotti/event_isotropy.git#egg=eventIsotropy"Event Isotropy CodeemdVar.pyThis is the module with the functions to calculate the distances between sets for several distance measures as well as the event isotropy.Geometries
For the spherical case, one can calculate themeasure (_cdist_cos(X,Y)) or themeasure (_cdist_sqrt_cos(X,Y)). To calculate, pass these functions arrays X, Y of the 3 momenta of each set.For the cylindrical case, one can calculate the squared Euclidean distance inspace (_cdist_phi_y(X,Y,ymax)) or the unnormalized Euclidean distance in(_cdist_phi_y_sqrt(X,Y)) space. Pass these functions arrays of the position inspace and the maximum value ofyymax.For the ring case, one can calculate the distance in(_cdist_phi(X,Y)) and(_cdist_phicos(X,Y)). Pass the function the arrays ofvalues X, Y.Event Isotropy Calculation
To calculate the event isotropy, use the functionemd_Calc(ev0,ev1,M)where ev0, ev1 are the energy weights of the event and the uniform event, and M is the distance matrix between them as computed by one of the previous functions.
Note, this function will also accept user defined distance matrices of the correct dimension.spherGen.pyGenerates spherical samples and some related quantities. To generate a spherical quasi-uniform event withparticles for, usesphericalGen(i)cylGen.pyGenerates cylindrical samples and ring-like samples, as well as related quatities. To generate a cylinder with uniform tiling in theplane, usecylinderGen(piSeg, etaMax)where piSeg is an integer, the number of slices in.For a ring-like sample, useringGen(piSeg)where piSeg is an integer, the number of slices in.ExamplesThere are three example programs in theexamplesdirectory.
The examples have external dependencies, but can be installed through thetestextra withpython -m pip install --upgrade -e .[test]evIsoSphere.pyfile iCalculates the spherical event isotropy of an uploaded event. User specifiesfilename of event and spherical indexi. The file should be saved as the four momenta of the particles.iis the sphere index, not particle number, and corresponds to the tiling of the quasi uniform comparison sphere. The number of particles in the sphere will be.evIsoCyl.pyCalculates the cylindrical event isotropy of very coarse to very finely gridded cylinders for random extremal transverse dijet configurations. In the limit of largen, we expect to see the event isotropy drop to zero. No user input needed.evIsoRing.pyCalculates the ring isotropy between two rings at random orientations and with potentially different particle number. Generates 1000 random configurations to average event isotropy for given configuration. No user input needed.
Package: eventize
Eventize permits to listen to“before”and“after”methods events and“on_get”,“on_change”,“on_set”,“on_del”attributes events.Features:Can be used as a simple subject/observer patternConditional eventsUse descriptors to lazily and unobstrusively listen to “on_get”, “on_change”,”on_set”, “on_del” events on attributes and “before” and “after” events on methods.Precise callbacks inheritance (see Subject)Statically and dynamically customizable (via inheritance, pattern visitor over a “modifier” protocol, decorators…)Fine grained event dispatcherIt can listen to events at 3 levels (by order of execution):Descriptor Class: for all classes which use the given Attribute or Method descriptor classDescriptor Instance: for all objects of a given classObject instance: for the given object attribute value or methodTable of ContentsInstallationUsageDevelopmentInstallationInstall it from pypi:pip install eventizeor from sources:git clone git@github.com:apieum/eventize.git
cd eventize
python setup.py installUsageSee documentationDevelopmentContributions are greatly appreciated.Please usegithub(issue tracker, pull requests…) or contact me at apieum [at] gmail [dot] comTestingTests are my specs so code (except refactorings) without tests won’t probably be accepted.
If you want to contribute please add tests.Test recommended requirements:pip install -r dev-requirements.txtSometimes –spec-color doesn’t function.
You should uninstall nosecolor and nosespec then reinstall nosecolor and nosespec separatly (nosecolor first).You can fix it like this:pip uninstall nosespec nosecolor
pip install nosecolor && pip install nosespecIn order to have fast feedback with TDD loops, I develop with two virtualenvs (2.7 and 3.x python versions) launched in a splited shell (tmux) which runs tests each time a file changes.
Use the code below with option –with-watch to launch tests this way.Launching tests:git clone git@github.com:apieum/eventize.git
cd eventize
nosetests --with-spec --spec-color ./eventize
# or with watch
# nosetests --with-spec --spec-color --with-watch ./eventizeDocumentationDocumentation is generated by sphinx from restructured text localized in doc/source. It is build by make (see doc/Makefile).Except to explain implementation choices (why),please avoid comments in code. It aims at keeping focus on coding and avoiding outdated comments.
Keep long names (vars, functions, classes…) and explicit tests names (complete sentences) to have understandable code.Building doc:git clone git@github.com:apieum/eventize.git
cd eventize/eventize/doc
make all  # or make *target* (see in Makefile for *target* or type make)Continuous IntegrationCI is made by travis for different python versions (trying to maintain compatibility with v2 python).It checks:test suites (nosetest)rst-lint this READMEdoc buildingcode coverage
Package: eventkit
IntroductionThe primary use cases of eventkit areto send events between loosely coupled components;to compose all kinds of event-driven data pipelines.The interface is kept as Pythonic as possible,
with familiar names from Python and its libraries where possible.
For scheduling asyncio is used and there is seamless integration with it.See the examples and theintroduction notebookto get a true feel for the possibilities.Installationpip3 install eventkitPythonversion 3.6 or higher is required.ExamplesCreate an event and connect two listenersimporteventkitasevdeff(a,b):print(a*b)defg(a,b):print(a/b)event=ev.Event()event+=fevent+=gevent.emit(10,5)Create a simple pipelineimporteventkitasevevent=(ev.Sequence('abcde').map(str.upper).enumerate())print(event.run())# in Jupyter: await event.list()Output:[(0, 'A'), (1, 'B'), (2, 'C'), (3, 'D'), (4, 'E')]Create a pipeline to get a running average and standard deviationimportrandomimporteventkitasevsource=ev.Range(1000).map(lambdai:random.gauss(0,1))event=source.array(500)[ev.ArrayMean,ev.ArrayStd].zip()print(event.last().run())# in Jupyter: await event.last()Output:[(0.00790957852672618, 1.0345673260655333)]Combine async iterators togetherimportasyncioimporteventkitasevasyncdefait(r):foriinr:awaitasyncio.sleep(0.1)yieldiasyncdefmain():asyncfortinev.Zip(ait('XYZ'),ait('123')):print(t)asyncio.get_event_loop().run_until_complete(main())# in Jupyter: await main()Output:('X', '1')
('Y', '2')
('Z', '3')Real-time video analysis pipelineself.video=VideoStream(conf.CAM_ID)scene=self.video|FaceTracker|SceneAnalyzerlastScene=scene.aiter(skip_to_last=True)asyncforframe,personsinlastScene:...Full source codeDistributed computingThedistexlibrary provides apoolmapextension method to put multiple cores or machines to use:fromdisteximportPoolimporteventkitasevimportbz2pool=Pool()# await pool  # un-comment in Jupyterdata=[b'A'*1000000]*1000pipe=ev.Sequence(data).poolmap(pool,bz2.compress).map(len).mean().last()print(pipe.run())# in Jupyter: print(await pipe)pool.shutdown()Inspired by:Qt Signals & SlotsitertoolsaiostreamBaconaioreactiveReactive extensionsunderscore.js.NET EventsDocumentationThe completeAPI documentation.