Skip to main content

pymemcache-client

Extension of Python package pymemcache providing client configuration.

Badges

docs

Documentation Status License Status

info

Hits Contributors

tests

Travis-CI Build Status Code Coverage Status

package

PyPI Package latest release Supported versions

other

Requirements Status

Install

pip install pymemcache-client

Install Memcached

To run examples and tests locally upon “localhost”, memcached must be installed.

Install memcached using brew

$ brew install memcached

==> Installing memcached
==> Downloading https://homebrew.bintray.com/bottles/memcached-1.5.3.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring memcached-1.5.3.sierra.bottle.tar.gz
==> Caveats
To have launchd start memcached now and restart at login:
  brew services start memcached
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/memcached/bin/memcached
==> Summary
🍺  /usr/local/Cellar/memcached/1.5.3: 11 files, 198.7KB

Start memcached using brew

$ brew services start memcached

==> Successfully started `memcached` (label: homebrew.mxcl.memcached)

Architecture

Extension of Python package pymemcache returning from pymemcache.client.hash import HashClient and configured using either ~/.pymemcache.json or pymemcache.json.

Functionality

class PymemcacheClient: Prepare a Pymemcache Client using available configuration.

Configuration can be provided when creating an instance of this class by:

  • User-level file: ~/.pymemcache.json

  • Application-level file: ./pymemcache.json

  • Provided as file path value in JSON-format to parameter config_file

  • Provided as dict value in JSON-format to parameter config

Configuration

This is the expected configuration that can be provided to class PymemcacheClient is in JSON format:

{
    "client_type": "[OPTIONAL str, DEFAULT 'basic']",
    "servers": [
        {
            "host": "[str]",
            "port": [int]
        }
    ],
    "server_type": "[OPTIONAL str, DEFAULT 'standard']",
    "connect_timeout": [OPTIONAL float, Defaults to forever],
    "timeout": [OPTIONAL float, Defaults to forever],
    "no_delay": [OPTIONAL bool, DEFAULT false],
    "ignore_exc": [OPTIONAL bool, DEFAULT false],
    "default_noreply": [OPTIONAL bool, DEFAULT true],
    "allow_unicode_keys": [OPTIONAL bool, DEFAULT false]
}
  • "client_type": [OPTIONAL] Type of memcached client, DEFAULT "basic"
    • "basic": Memcached client using from pymemcache.client.base import Client. A client for a single memcached server.

    • "hash": Memcached client using from pymemcache.client.hash import HashClient. A client for communicating with a cluster of memcached servers.

  • "servers": A list of memcached servers and requiring at least one.
    • if "client_type" is "basic", then 1 server and only 1 is required.

    • if "client_type" is "hash", then 1 or more servers is required.

  • "server_type": Defining special needs for connect to memcached servers, DEFAULT "standard".
    • "standard": Pooling server connections using standard HTTP.

    • "elasticache": Pooling server connections using Auto Discovery through AWS Elasticache.

  • "connect_timeout": OPTIONAL float, seconds to wait for a connection to the memcached server. Defaults to “forever” (uses the underlying default socket timeout, which can be very long), i.e., the socket is put in blocking mode waiting to connect to memcached server.

  • "timeout": OPTIONAL float, OPTIONAL float, seconds to wait for send or recv calls on the socket connected to memcached. Defaults to “forever” (uses the underlying default socket timeout, which can be very long), i.e., the socket is put in blocking mode.

  • "no_delay": OPTIONAL bool, set the TCP_NODELAY flag, which may help with performance in some cases. DEFAULT false.

  • "ignore_exc": OPTIONAL bool, True to cause the “get”, “gets”, “get_many” and “gets_many” calls to treat any errors as cache misses. DEFAULT false.

  • "default_noreply": OPTIONAL bool, the DEFAULT value for 'noreply' as passed to store commands. DEFAULT true.

  • "allow_unicode_keys": OPTIONAL bool, support unicode (utf8) keys. DEFAULT false.

Dependencies

pymemcache-client module is built upon Python 3 and has dependencies upon several Python modules available within Python Package Index PyPI.

Release History

0.3.2 (2018-02-16)

  • Migrate to github/TuneLab

0.3.1 (2018-01-25)

  • migrate to github/tuneinc

0.3.0 (2017-12-10)

  • readthedocs.org

0.2.0 (2016-12-08)

  • Alpha

  • More robust JSON configuration

  • Handles pymemcache.client.hash.HashClient

  • Handles pymemcache.client.base.Client

0.1.0 (2016-12-07)

  • First Release

0.0.1 (2016-12-07)

  • Initial commit

Metadata

Release files for pymemcache-client 0.3.2

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

Source distribution (sdist)

Source distribution for pymemcache-client 0.3.2
File Size Uploaded Provenance
pymemcache-client-0.3.2.tar.gz 8.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pymemcache-client 0.3.2
File Interpreter ABI Platform
pymemcache_client-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / pymemcache-client-0.3.2.tar.gz

Download URL pymemcache-client-0.3.2.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
72b8520012563fa8e39b7ff02b187d723d8b1781b7a581f2b51c6ebf65331ac6
BLAKE2b-256 checksum
How to use checksums
2b9d1a65aa8487ac30c43de697c8e84935b42abff6f9769b3984f15a2606516e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymemcache_client-0.3.2-py3-none-any.whl

Download URL pymemcache_client-0.3.2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fac97bb27a596eaffb5022e3aab3b1bbe57f4c866da969d97c034057b98528f6
BLAKE2b-256 checksum
How to use checksums
4876bc22937e235d97bac9dcf6b3503674431bcbc8921f4201bf3af1aa6b19eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pymemcache-client 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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