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.2.1.tar.gz (17.4 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.2.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fermacongress-1.2.1.tar.gz
Algorithm Hash digest
SHA256 a43398f02532cb4978f901044e6d5eec91ad5483abdc003bcc3184c91feaf887
MD5 5dd2a986b65324c5cc3c73b907345139
BLAKE2b-256 9c20c1a1bdf9e0abedcaaff0c83fef626f775e8ae90825541138860bd5a53f5d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fermacongress-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcd180c5fc8bf543a9ce89dd7dc9c7f266ae74842063fee84bd3ea217ceb2b08
MD5 fa1408296883e2f70ad86af484852c66
BLAKE2b-256 d19fb17c6af15b9d22bb7b070957c3e6086b6906117160af8049971133dd5fc4

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