Skip to main content

Plug-n-Play Simple Tag Library

Project description

Build Status
Coverage Status

Usage

>>> import simpletag

>>> ns = simpletag.TextNS('myTextTagSpace') # Create a namespace of text IDs
... # Create integer IDs namespace with `simpletag.IntNS()`

>>> doc_1 = '/a/b'
>>> tags_1 = ['tag']

>>> doc_2 = '/b/a'
>>> tags_2 = 'tag simple!'

>>> ns.update(doc_1, tags_1)
>>> ns.update(doc_2, tags_2)

>>> print [ doc for doc in ns.query_ids('tag') ]
[u'/a/b', u'/b/a']

>>> print [ tag for tag in ns.query_tags(doc_1) ]
[u'tag']

>>> print [ st for st in ns.stats() ]
[{
    'term': u'simple', 'documents': 1, 'occurrences': 1
}, {
    'term': u'tag', 'documents': 2, 'occurrences': 2
}]

>>> ns.purge()

TODOs

  • As a Flask plug-in

  • PyPI (?

  • Benchmark

  • Further tags analytics (e.g. top-k ~ KNN classification)

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

simpletag-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file simpletag-0.1.1.tar.gz.

File metadata

  • Download URL: simpletag-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for simpletag-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b921cd8262c2b81eb8c8921a3bdd1200e8ff92b499f85ed354a5e032ffdc0876
MD5 0ff4e23c013ca8ad686f13fa98f278a6
BLAKE2b-256 dcab4228d166f3e8a4a98c397665c398361e30c99fb59ddd8aa75ef3eeacc2ab

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page