Skip to main content

Joe Gregorio originally posted about Sharded Counters for Google Appengine.

This is like a downloadable gist:

from sharc import Counter

assert not Counter('A').exists()

Counter('A', initial_value=5, shards=5)
assert Counter('A').exists()

Counter('A').increment()
Counter('A').decrement()
Counter('A') + 2
Counter('A') - 2

assert Counter('A') == 5

Counter('A').shards = 10

Counter('A').delete()   # .delete_async()
assert not Counter('A').exists()
  • Added decrement

  • Increment and decrement variable deltas (default=1)

  • Set initial value of the counter (default=0)

  • Set initial value of the num of shards (default=20)

  • Added delete()

Metadata

Release files for sharc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sharc 0.1.0
File Size Uploaded
sharc-0.1.0.zip 6.1 kB Details

Release files / sharc-0.1.0.zip

Download URL sharc-0.1.0.zip
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5efcc20ebabdb53e0cfda05d51311dce4a13ded90fb615375634ac10af891ba8
BLAKE2b-256 checksum
How to use checksums
ac4c83856d99fea78cf0c247f08cf04ca74f1317070b62f949e8da290d00b75c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page