Wikipedia provides a real-time SSE feed for updates for all wikimedia projects.
Documentation about event streams from Wikipedia: https://wikitech.wikimedia.org/wiki/Event_Platform/EventStreams
Event stream source is available at https://stream.wikimedia.org/v2/stream/recentchange
The easiest way to visualize it:
curl https://stream.wikimedia.org/v2/stream/recentchange
To run these examples you need to run a Redis server.
docker-compose up
Dependencies installed with pipenv.
pipenv install
The file redis_publisher.py shows how to publish messages to the channel. The script reads messages from SSE and publishes them to the channel "wiki".
Run the script:
pipenv run ./redis_publisher.py
It immediately starts publishing events to the channel. You can visualize them with a simple Redis client
redis-cli subscribe wiki
Type Ctrl+C to quit.
There is a script redis_subscriber.py which consumes the events from the pub-sub channel and saves them to a time-series events.
Resulting data structure has following properties:
expiration_timeout_sec
defines how long events are
stored in Redisaggregation_interval_sec
defines the event
aggregation interval (in seconds).Run the script:
pipenv run ./redis_subscriber.py
As a result of the script work, a number of keys will be created in Redis:
$ redis-cli
127.0.0.1:6379> keys *
...
7306) "ev:www.wikidata.org:1572640220"
7307) "ev:no.wikipedia.org:1572642080"
7308) "ev:cs.wiktionary.org:1572640550"
Each key contains a integer value: the number of events for the specific
domain name, happening within aggregation_interval_sec
after the time moment,
encoded as the timestamp in the key.
Dash is an open source web framework to build interactive data-driven applications, primarily data visualizations and dashboards.
File dash_app.py contains a sample application which lets you pick one or more domain names to get te update statistics for it.
Run the script
pipenv run ./dash_app.py
As a result, you should see:
Bumps werkzeug from 2.2.2 to 2.2.3.
Sourced from werkzeug's releases.
2.2.3
This is a fix release for the 2.2.x release branch.
- Changes: https://werkzeug.palletsprojects.com/en/2.2.x/changes/#version-2-2-3
- Milestone: https://github.com/pallets/werkzeug/milestone/26?closed=1
This release contains security fixes for:
Sourced from werkzeug's changelog.
Version 2.2.3
Released 2023-02-14
- Ensure that URL rules using path converters will redirect with strict slashes when the trailing slash is missing. :issue:
2533
- Type signature for
get_json
specifies that return type is not optional whensilent=False
. :issue:2508
parse_content_range_header
returnsNone
for a value likebytes */-1
where the length is invalid, instead of raising anAssertionError
. :issue:2531
- Address remaining
ResourceWarning
related to the socket used byrun_simple
. Removeprepare_socket
, which now happens when creating the server. :issue:2421
- Update pre-existing headers for
multipart/form-data
requests with the test client. :issue:2549
- Fix handling of header extended parameters such that they are no longer quoted. :issue:
2529
LimitedStream.read
works correctly when wrapping a stream that may not return the requested size in oneread
call. :issue:2558
- A cookie header that starts with
=
is treated as an empty key and discarded, rather than stripping the leading==
.- Specify a maximum number of multipart parts, default 1000, after which a
RequestEntityTooLarge
exception is raised on parsing. This mitigates a DoS attack where a larger number of form/file parts would result in disproportionate resource use.
22a254f
release version 2.2.3517cac5
Merge pull request from GHSA-xg9f-g7g7-2323babc8d9
rewrite docs about request data limits09449ee
clean up docsfe899d0
limit the maximum number of multipart form partscf275f4
Merge pull request from GHSA-px8h-6qxv-m22q8c2b4b8
don't strip leading = when parsing cookie7c7ce5c
[pre-commit.ci] pre-commit autoupdate (#2585)19ae03e
[pre-commit.ci] auto fixes from pre-commit.com hooksa83d3b8
[pre-commit.ci] pre-commit autoupdateDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Bumps ipython from 7.16.3 to 8.10.0.
Sourced from ipython's releases.
See https://pypi.org/project/ipython/
We do not use GitHub release anymore. Please see PyPI https://pypi.org/project/ipython/
15ea1ed
release 8.10.0560ad10
DOC: Update what's new for 8.10 (#13939)7557ade
DOC: Update what's new for 8.10385d693
Merge pull request from GHSA-29gw-9793-fvw7e548ee2
Swallow potential exceptions from showtraceback() (#13934)0694b08
MAINT: mock slowest test. (#13885)8655912
MAINT: mock slowest test.a011765
Isolate the attack tests with setUp and tearDown methodsc7a9470
Add some regression tests for this changefd34cf5
Swallow potential exceptions from showtraceback()Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Full-stack Python web developer. Software development is not about code. It's about people.
GitHub Repository