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.2.0.tar.gz (4.4 MB view details)

Uploaded Source

Built Distribution

floc-0.2.0-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: floc-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Linux/5.4.105-1-MANJARO

File hashes

Hashes for floc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a8153ee93ee802ac1b3dc6d2e7e1d0424393e4bebac7a9208a3874c7885a24b6
MD5 fde87f587ae53c016fa31556a9012ac8
BLAKE2b-256 f0474dbcf1adc1eaa7fd9726a4c6322c5ffe2338482e1019a61a0c643704c66c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: floc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Linux/5.4.105-1-MANJARO

File hashes

Hashes for floc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b2fd4806ceebeb564bb5cb894bfffe04fab4d97dfd21a1bdf6e050744d364d4
MD5 ee68689e5520869c41eefbf1cc0807de
BLAKE2b-256 0a5ef81f795b4506ff9d687c3bd1569a58e81ac9877135e20337c8bf2a785986

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