Skip to main content

A ZoomRx - Ferma Congress package for internal usage

Project description

Ferma Congress

FermaCongress is a private Python package used internally by the Planners team at ZoomRx - Ferma Congress to automate extraction and management of congress-level data. The package provides utilities for Authentication, Session & Tweet Management, Annotation & Social Workflows

Installation

pip install FermaCongress

# upgrade to the latest version
pip install --upgrade FermaCongress

🔐 FermaCongress.auth

To access Ferma, you must provide a .env file containing your authorized Ferma credentials.

Function Description
adminlogin() Authenticates with the Ferma Admin Portal and enables access to its APIs
supportlogin() Authenticates with the Ferma Support Portal and maintains an active session

Both functions expect the following variables in your .env file:

FERMA_USERNAME=<your-username>
FERMA_PASSWORD=<your-password>

Quick Start

from FermaCongress.auth import adminlogin, supportlogin

# Authenticate to the Admin portal
admin_client = adminlogin(".env")

# Authenticate to the Support portal
support_client = supportlogin(".env")

Environment Variables (.env)

FERMA_USERNAME=your_username
FERMA_PASSWORD=your_password

Encoded credentials: If your .env file contains Base64-encoded values, simply add the format="ENCODED" argument:

admin_client = adminlogin(".env", format="ENCODED")

🧠 FermaCongress.annotate

The annotate() function allows you to send a DataFrame to the Ferma Support Portal for keyword annotation and download the processed results.

Requires an authenticated Ferma Support Portal session (via supportlogin() from FermaCongress.auth)

Function

Parameter Description
client Authenticated Session instance from supportlogin()
input_df Pandas DataFrame with an id column
custom_needles_df Optional DataFrame of user-defined needles
needles List of two ints: [kb_status, nct_status]
entities Optional entity configuration (dict)
long_table Use long table format (True) or pivot table format (False)

Quick Example

from FermaCongress.auth import supportlogin
from FermaCongress.annotate import annotate

# Authenticate to the Support portal
support_client = supportlogin(".env")

# Annotate
annotated_df = annotate(support_client, input_df=input_df, needles=[1, 1], long_table=True)

📥 FermaCongress.extractferma

This module provides a set of helper functions to extract congress-level data from the Ferma Admin Portal. All functions require an authenticated Admin client (via adminlogin() from FermaCongress.auth).

Functions

Function Description
get_all_sessions() Download all session-level metadata for a given congress ID
get_skg() Download grouped session keyword data
get_fullabstracts() Download full abstracts for all sessions
get_summary() Download session summaries
get_tweets() Download tweet-level data and merge with session metadata and priorities
get_priority() Download and merge planner priority files into a consolidated DataFrame

Example

from FermaCongress.auth import adminlogin
from FermaCongress.extractferma import (
    get_all_sessions, get_skg, get_fullabstracts,
    get_summary, get_tweets, get_priority
)

# 1) Authenticate to the Admin portal
admin_client = adminlogin(".env")

# 2) Fetch Sessions / Keywords / Tweets
CONGRESS_ID = "221"

sessions_df = get_all_sessions(admin_client, CONGRESS_ID)
skg_df      = get_skg(admin_client, CONGRESS_ID)
abstracts_df = get_fullabstracts(admin_client, CONGRESS_ID)

summary_df  = get_summary(admin_client, CONGRESS_ID)
tweets_df   = get_tweets(admin_client, CONGRESS_ID)
priority_df = get_priority(admin_client, CONGRESS_ID)

🔄 FermaCongress.postferma

This module contains helper functions for posting tweet-level updates back to the Ferma Admin Portal and for triggering server-side buzz score recalculation.

Functions

Function Description
addtweets() Uploads new tweets for a specific congress ID
modifytweets() Modifies existing tweets for a specific congress ID
populatebuzz() Triggers the server to populate or update buzz scores for all sessions

All functions require an authenticated Admin client (adminlogin() from FermaCongress.auth).


Example

from FermaCongress.auth import adminlogin
from FermaCongress.postferma import addtweets, modifytweets, populatebuzz

client = adminlogin(".env")

CONGRESS_ID = "221"

# Add new tweets
addtweets(client, df, CONGRESS_ID)

# Modify tweets (if needed)
modifytweets(client, df, CONGRESS_ID)

# Recalculate buzz scores
populatebuzz(client, CONGRESS_ID)

🗂️ FermaCongress.planner

The FermaCongress.planner module provides utilities for generating congress planning files by combining session metadata, keyword information, and planner-level priorities.

Functions

Function Description
baseplanner() Builds a fully enriched planning DataFrame for a given Congress and Planner ID

Example

from FermaCongress.auth import adminlogin
from FermaCongress.planner import baseplanner

# 1) Authenticate to the Admin portal
client = adminlogin(".env")

# 2) Build a planner file
CONGRESS_ID = "221"
PLANNER_ID  = "4"

planner_df = baseplanner(client, CONGRESS_ID, PLANNER_ID)
print(planner_df.head())

⚙️ FermaCongress.formatexcel

The FormatExcel utility is used to apply styling and export your Ferma data (from a DataFrame or input file) into a clean, Ferma-styled Excel format.

from FermaCongress.formatexcel import format

format(dataframe=df, output_path="priority_report.xlsx")  # Format from a DataFrame

format(input_path="raw_sessions.xlsx", output_path="formatted_sessions.xlsx")  # Format from Excel file

format(input_path="raw_data.csv", output_path="formatted_output.xlsx")  # Format from CSV file
Parameter Type Description
input_path str Path to an input Excel or CSV file.
dataframe pandas.DataFrame DataFrame to format.
output_path str File path to save the formatted Excel output.
headers bool True to convert headers to proper casing (e.g., buzz_score → Buzz Score).
input_sheet str Name of the sheet to read from (Excel only). Optional if only one sheet.
output_sheet str Name of the sheet to write into in the output Excel file.

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

fermacongress-1.0.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

fermacongress-1.0.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file fermacongress-1.0.0.tar.gz.

File metadata

  • Download URL: fermacongress-1.0.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fermacongress-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b079a484eae3b8e294b3e48789313960e2d979dd0cfacd2a67dadab48ae859c0
MD5 b22497923c35cb74a25a68c9ac60f26a
BLAKE2b-256 5baf29080aaaacd115d9d58136bcefa70549f3896317e19b75a8b8a022817fc8

See more details on using hashes here.

File details

Details for the file fermacongress-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fermacongress-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fermacongress-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7434acf7aec3a19290fe7ade1ae2f26510dba39f83dab2961894837f5171a7b
MD5 0ad1a222255591e17ec69702f416c023
BLAKE2b-256 3ac001cb789363ad6a3bfa35f18e6bf4b57587c4f93729f1482b95e28b410c5d

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