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
Metadata
Release files for sat-utils 1.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sat_utils-1.8.0.tar.gz | 9.8 kB | Without provenance | Details for sat_utils-1.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sat_utils-1.8.0-py3-none-any.whl | Python 3 | none | any | Details for sat_utils-1.8.0-py3-none-any.whl |
Total release size: 20.3 kB
Release files / sat_utils-1.8.0.tar.gz
| Download URL | sat_utils-1.8.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fb66c1ba09d4236428b6ca02555b18d31e4c3803a462f5c63869e5046cd947d
|
|
BLAKE2b-256 checksum How to use checksums |
f47765e1deef2081b2ac7680e69e96a2da9fbc1e2c5dec0897c2aedb8b13d962
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Release files / sat_utils-1.8.0-py3-none-any.whl
| Download URL | sat_utils-1.8.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d667f778e604af6a0c395f26970f6e5f38289c21c5cc043584618abdd9e0d71f
|
|
BLAKE2b-256 checksum How to use checksums |
e29a74cdc4e646d4371d47d8332c540d7ed21d8eec9c8ba83501558a6e3e3ac6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Security for sat-utils 1.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.