You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mastertables

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mastertables

A Python package to interact with the mastertables.athento.com public API

1.1.0
pipPyPI
Maintainers
1

Mastertables

Website PyPI PyPI - Status PyPI - Python Version

A Python package to interact with Mastertables.

This package provides a very simple way of getting data from your mastertables through the public Rest API.

Installation

Just run the command below from the CLI:

pip install mastertables

To add the package to your local requirements.txt run:

pip freeze > requirements.txt

Install from repo

You can install Mastertables from the Github repo:

pip install git+https://github.com/athento/mastertables

Install from source

Alternatively, you can even install it from the sources:

git clone https://github.com/athento/mastertables
cd mastertables
pip install .

Updating

Update from PyPI

pip install mastertables --upgrade

Update from repo

pip install git+https://github.com/athento/mastertables --upgrade

Update from source

cd /path/to/mastertables/repo
git pull
pip install . --upgrade

API reference

# module
from mastertables import mastertables


# mastertables client instantiation
# usage:
#   mastertables.MasterTablesClient("<team_api_key>")

mt = mastertables.MasterTablesClient("OAIV9839AF893H923ONWAN3IGNAWNAUNEGIU")


# get vocabulary
# usage:
#   mastertables.MasterTablesClient.get_vocabulary("<vocabulary_uuid>" [, category="<category>"])
# output:
#   {u'foo': u'bar', u'asdf': u'qwer'}

print(mt.get_vocabulary("1234abcd-12ab-34cd-56ef-12345678abcd"))


# get vocabulary reverse (value:key, instead of key:value)
# usage:
#   mastertables.MasterTablesClient.get_vocabulary_reverse("<vocabulary_uuid>" [, category="<category>"])
# output:
#   {u'bar': u'foo', u'qwer': u'asdf'}

print(mt.get_vocabulary_reverse("1234abcd-12ab-34cd-56ef-12345678abcd"))


# get vocabulary values
# usage:
#   mastertables.MasterTablesClient.get_values("<vocabulary_uuid>")
# output:
#   [u'foo', u'asdf']

print(mt.get_values("1234abcd-12ab-34cd-56ef-12345678abcd"))


# get vocabulary entity value
# usage:
#   mastertables.MasterTablesClient.get_value("<vocabulary_uuid>", "<entity_key>" [, index=<index>])
# output:
#   u'bar'

print(mt.get_value("1234abcd-12ab-34cd-56ef-12345678abcd", "foo", 0))

Packaging and distributing

Click on this link to read the manual on how to package and upload mastertables to PyPI.

Keywords

api rest mastertables development data athento

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts