Skip to main content

Contains a collection of shared utility functions

Project description

SAT Utilities

This repository contains a collection of shared utility functions.

  • Slack: A class to upload files to our Slack workspace
  • SATLogger: A standard logger for SAT projects

Installation

# Install the package from private PyPI (CLI)
$ pip install sat-utils

Usage

Slack

from sat.slack import Slack

message = Slack(token="abc123-8dkhnna-97hasdj-xyz")
message.upload_file(channel="support", file_path="C:/files", file_name="support.pdf", file_type="", title="Support manual v3.2", initial_comment="Woot!")

SATLogger

from sat.logs import SATLogger
logger = SATLogger(__name__)

...
logger.info("Hello, world!")

Gravity Forms

Three environment variables are required to authenticate with the Gravity Forms API.

  • GRAVITY_FORMS_CONSUMER_KEY
  • GRAVITY_FORMS_CONSUMER_SECRET
  • GRAVITY_FORMS_BASE_URL

Alternatively, these values can be passed into the GravityForms initialization as parameters.

from sat.gravity_forms import GravityForms


gravity = GravityForms()
cards_requested = gravity.get("/forms/3/entries")

Development

Setup

Ensure you are in a virtual environment with Python 3.9.6 or higher.

> make setup

Add dependencies

Updating Requirements

This project uses pip-tools to manage requirements. To update the requirements add your requirement to the pyproject.toml file.

For dependencies required to run the app in production, add them to the pyproject.toml file under the [project] section.

[project]
...
dependencies = [
    "fastapi>=0.95.1, <1.0.0",
    "pyjwt>=2.6.0, <3.0.0",
    "...",
    "<YOUR NEW REQUIREMENT HERE>",
    "...",
]

For developer dependencies required or nice to have for development, add them to the pyproject.toml file under the [project.optional-dependencies] section.

[project.optional-dependencies]
dev = [
    "pytest>=6.2.5, <7.0.0",
    "...",
    "<YOUR NEW DEV REQUIREMENT HERE>",
    "...",
]

When you have add the dependency run:

> make update-requirements

Build and Publish

Update the version in pyproject.toml before building.

Build

> flit build

Publish

As long as your PyPI credentials are set up correctly, you can publish to PyPI with the following command:

> flit publish

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

sat_utils-1.7.3.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sat_utils-1.7.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file sat_utils-1.7.3.tar.gz.

File metadata

  • Download URL: sat_utils-1.7.3.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for sat_utils-1.7.3.tar.gz
Algorithm Hash digest
SHA256 f5e7db85d486ce51786ddbb78fb50362c29611f9e14a053b96136444e125f0f5
MD5 7bb633e79a5f97969d62a27b80ae02ec
BLAKE2b-256 88287ef6f2b2d32d18d67b06212900b04b2567a8a8a2c739f4e51105fa04d6cc

See more details on using hashes here.

File details

Details for the file sat_utils-1.7.3-py3-none-any.whl.

File metadata

  • Download URL: sat_utils-1.7.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for sat_utils-1.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aa3ef9e567b4fc9f85fd7fac9fa8585d3757f0f4c1511c4e331c4203fd73bc42
MD5 93d1de947f75f9fb1627f7cd85667f69
BLAKE2b-256 f1b9c47ff0fb118f26b540e90e513cd5c7281e9314155670d261cac459d0b1d1

See more details on using hashes here.

Supported by

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