Skip to main content

Overview

This repository defines the F3 data structure, used by the F3 Slack Bot, Maps, etc. The projected uses SQLAlchemy to define the tables / models.

Running Locally

To load the data structure in your database:

  1. Set up a local db, update .env.example and save as .env
  2. Clone the repo, use Poetry to install dependencies:
poetry env use 3.12
poetry install
  1. Run the alembic migration:
source .env && poetry run alembic upgrade head

Optional BigQuery Sessions

The default database session path is PostgreSQL. To explicitly request a BigQuery session, pass the optional backend argument:

from f3_data_models.utils import get_session

postgres_session = get_session()
bigquery_session = get_session(backend="bigquery")

session_scope(...) and DbManager methods also accept the same optional backend argument.

BigQuery mode requires these environment variables:

  • BIGQUERY_PROJECT
  • BIGQUERY_DATASET

Authentication should be provided through Google Application Default Credentials in the runtime environment.

Contributing

If you would like to make a change, you will need to:

  1. Make the change in models.py
  2. Make a alembic revision:
source .env && alembic revision --autogenerate -m "Your Message Here"
  1. Make any edits to the migration script in alembic/versions
  2. Run the upgrade on your local db:
source .env && alembic upgrade head
  1. Bump the version on pyproject.toml:
poetry version patch[minor][major]
  1. Tag your final commit and make sure to push those tags to trigger the pypi package build:
git tag <new_version> -a -m "Your message here"
git push origin --tags

[!NOTE] The github pages documentation will be updated when you push to main, but if you would like to preview locally, run:

poetry run sphinx-build -b html docs docs/_build/html
cd docs
poetry run python -m http.server --directory _build/html

[!TIP]
Adding new fields as nullable (ie Optional[]) has the best chance of reducing breaking changes to the apps.

Entity Overview

---
config:
    look: handDrawn
    theme: dark
---

erDiagram
    USERS ||--|{ ATTENDANCE : have
    ATTENDANCE }|--|| EVENT_INSTANCES: at
    ATTENDANCE }|..|{ ATTENDANCE_TYPES : "are of type(s)"
    EVENT_INSTANCES }|..|| EVENTS : "part of series"
    EVENT_INSTANCES }|..|{ EVENT_TYPES : "with type(s)"
    EVENTS }|..|{ EVENT_TYPES : "with type(s)"
    EVENT_INSTANCES }|--|| ORGS : "belong to"
    EVENT_INSTANCES }|..|| LOCATIONS : "at"
    EVENTS }|--|| ORGS : "belong to"
    EVENTS }|..|| LOCATIONS : "at"
    SLACK_SPACES ||..|| ORGS : "are connected to"
    USERS ||..|{ SLACK_USERS : "have one or more"
    SLACK_USERS }|--|| SLACK_SPACES : "belong to"
    USERS }|..|{ ACHIEVEMENTS : "earn"
    USERS }|..|{ ROLES : "have"
    ROLES ||..|{ PERMISSIONS : "have"
    ROLES }|..|{ ORGS : "in"
    USERS }|..|{ POSITIONS : "hold"
    POSITIONS }|..|{ ORGS : "in"

Metadata

Release files for f3-data-models 1.2.1

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

Source distribution (sdist)

Source distribution for f3-data-models 1.2.1
File Size Uploaded
f3_data_models-1.2.1.tar.gz 17.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for f3-data-models 1.2.1
File Interpreter ABI Platform
f3_data_models-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / f3_data_models-1.2.1.tar.gz

Download URL f3_data_models-1.2.1.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ac8dfba929961a06827acb3ed7c4de80323d1af22a63180672c21f63afa2697c
BLAKE2b-256 checksum
How to use checksums
d899530975fc83ef96689a157181e5dbde96e4a202cdf22767f48801ed6b0719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.1 Linux/6.17.0-1018-azure

Release files / f3_data_models-1.2.1-py3-none-any.whl

Download URL f3_data_models-1.2.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f4699067aacfebf8f433ef1db61f898abe2ef067e580ed889656f8cf4fa9acb
BLAKE2b-256 checksum
How to use checksums
c867c8efcfee673df43a581c3352c08ceb331b65363f22b1a261de2955118728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.1 Linux/6.17.0-1018-azure

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.17

2 release files

0.5.16

2 release files

0.5.15

2 release files

0.5.14

2 release files

0.5.13

2 release files

0.5.12

2 release files

0.5.10

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.6

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

2 release files

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