Skip to main content

A floc simulator wrapper for Python over a Go implementation

Project description

FLoC

Build Status Documentation Status Python Versions Coverage Status License Checked with mypy wemake python styleguide


Introduction

This is a Python wrapper of this implementation for FLoC written in go!

It's easy to calculate the CohortID using this lib, see the example below:

>>> from floc import simulate
>>> host_list = [
...     'www.nikkei.com',
...     'jovi0608.hatenablog.com',
...     'www.nikkansports.com',
...     'www.yahoo.co.jp',
...     'www.sponichi.co.jp',
...     'www.cnn.co.jp',
...     'floc.glitch.me',
...     'html5.ohtsu.org',
... ]
>>> simulate(host_list)
21454

By default, we'll use the SortingLshClusters from FLoC's 1.0.6 version. If you want to use other, just pass it to the function:

>>> from floc import simulate
>>> host_list = [
...     'www.nikkei.com',
...     'jovi0608.hatenablog.com',
...     'www.nikkansports.com',
...     'www.yahoo.co.jp',
...     'www.sponichi.co.jp',
...     'www.cnn.co.jp',
...     'floc.glitch.me',
...     'html5.ohtsu.org',
... ]
>>> sorting_cluster_data = "" # READ THE DATA FROM SOMEWHERE
>>> simulate(host_list, sorting_cluster_data)
21454

We also expose some other functions, see the documentation here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

floc-0.3.1.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

floc-0.3.1-py3-none-any.whl (4.3 MB view details)

Uploaded Python 3

File details

Details for the file floc-0.3.1.tar.gz.

File metadata

  • Download URL: floc-0.3.1.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.7 Linux/5.10.68-1-MANJARO

File hashes

Hashes for floc-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5902564596fbb5d5ad396f409cbffe51da4fb417f75758d8bf02add5306b6993
MD5 512c2ebc5d42a6f76239642f22b4c66c
BLAKE2b-256 0ea9da7ec8313a3ebbb3fdbc775b2cb30a109f91548db0fc9b13b3496883c4f5

See more details on using hashes here.

File details

Details for the file floc-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: floc-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.7 Linux/5.10.68-1-MANJARO

File hashes

Hashes for floc-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87bcf7228c27c8c97c844880c31c8f68d679304453514e6209702d704e7e1539
MD5 f2957172546604de3dbd0f95822d5bbf
BLAKE2b-256 5defdc2fe98aff2d87c40eb228b0366d79a839e55de74545ee07e6de6684b8e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page