Skip to main content

Fluxx API Python Client

Simple wrapper around the Fluxx GMS API.

Installation

$ pip install fluxx_wrapper

TODO

  • change subdomain to full url
  • better in tool command documentation

Config

The command line tool expects three environmental variables to be set:

  • url of the fluxx instance (url segment before .fluxx.io)
  • application ID
  • application secret

It is required to set these variables using a unique identifier and the following suffixes, respectively: _INSTANCE _CLIENT _SECRET

For example, if we have a Fluxx instance with url "demo.fluxx.io", application id "ABC", and application secret "123", we would set the following:

DEMO_INSTANCE = 'demo.fluxx.io'
DEMO_CLIENT = 'ABC'
DEMO_SECRET = '123'

Example Usage as Library

from fluxx_wrapper import FluxxClient, FluxxError

# initialize client
fluxx = FluxxClient(
    os.getenv('YOUR_INSTANCE'),
    os.getenv('YOUR_CLIENT_ID'),
    os.getenv('YOUR_CLIENT_SECRET'),
    version='v2',
    style='full'
)

# list model attributes
fields = fluxx.model_attribute.list({
    cols=['attribute_type', 'description', 'legacy_name', 'model_type'],
    per_page=10000
})

  # example workflow, set empty description to regex-matching legacy names
for field in fields:
    if not 'description' in field:
        legacy_name = field['legacy_name']

        if re.match(r'\(.*`.*`\)', legacy_name):
            legacy_name = legacy_name.split('`')[1]

        desc = legacy_name.replace('_', ' ')
        desc = titlecase(desc)

        body = {'description': desc}

        try:
            updated = fluxx.model_attribute.update(field['id'], body)
        except FluxxError as e:
            print(e)


    print(updated['description'])

Metadata

Release files for fluxx_wrapper 0.0.9

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

Source distribution (sdist)

Source distribution for fluxx_wrapper 0.0.9
File Size Uploaded
fluxx_wrapper-0.0.9.tar.gz 6.8 kB Details

Release files / fluxx_wrapper-0.0.9.tar.gz

Download URL fluxx_wrapper-0.0.9.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f273c38d51c1128c47fc83be5f6bf8c70be0b4cc595059f17786d4214dbb518e
BLAKE2b-256 checksum
How to use checksums
79cd433cbb69f13b9468b5dfdd8cafffe5643e9a7568cde1ced5dfc37d53f70e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.9 This release

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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