engineering-nba-data
Extracts, transforms, and analyzes NBA statistics using the nba_api Python library. Use when working with NBA player stats, team data, game logs, shot charts, league statistics, or any NBA-related data engineering tasks. Supports both stats.nba.com endpoints and static player/team lookups.
What this skill does
**Goal**: Extract and process NBA statistical data efficiently using the nba_api library for data analysis, reporting, and application development.
**IMPORTANT**: The nba_api library accesses stats.nba.com endpoints. All data requests return structured datasets that can be output as JSON, dictionaries, or pandas DataFrames.
## Workflow
### Phase 1: Setup and Installation
- Install nba_api: `pip install nba_api` if not yet installed
- Import required modules based on task:
- `from nba_api.stats.endpoints import [endpoint_name]` for stats.nba.com data
- `from nba_api.stats.static import players, teams` for static lookups
- `from nba_api.stats.library.parameters import [parameter_classes]` for valid parameter values
### Phase 2: Data Retrieval
**For Player/Team Lookups (No API Calls)**:
- Use `players.find_players_by_full_name('player_name')` for player searches
- Use `teams.find_teams_by_full_name('team_name')` for team searches
- Both return dictionaries with `id`, `full_name`, and other metadata
- No HTTP requests are sent; data is embedded in the package
**For Stats Endpoints (API Calls)**:
- Identify the correct endpoint from [table of contents](docs/table_of_contents.md)
- Initialize endpoint with required parameters: `endpoint_class(param1=value1, param2=value2)`
- Access datasets using dot notation: `response_object.dataset_name`
- Retrieve data in desired format:
- `.get_json()` for JSON string
- `.get_dict()` for dictionary
- `.get_data_frame()` for pandas DataFrame
**Custom Request Configuration**:
- Set custom headers: `endpoint_class(player_id=123, headers=custom_headers)`
- Set proxy: `endpoint_class(player_id=123, proxy='127.0.0.1:80')`
- Set timeout: `endpoint_class(player_id=123, timeout=100)` (in seconds)
### Phase 3: Data Processing
- Extract specific datasets from endpoint responses
- Transform data using pandas for aggregations, filtering, joins
- Normalize nested data structures as needed
- Handle multiple datasets returned by single endpoint
### Phase 4: Output and Storage
- Export to CSV: `df.to_csv('output.csv', index=False)`
- Export to JSON: Use `.get_json()` or `df.to_json()`
- Store in database using pandas `.to_sql()` method
- Cache responses to minimize API calls
## Rules
- **Required packages**: `nba_api` must be installed before use
- **Static first**: Always use static lookups (players/teams) for ID retrieval before making API calls
- **Parameter validation**: Reference [parameters.md](docs/nba_api/stats/library/parameters.md) for valid parameter values
- **Endpoint selection**: Check [table of contents](docs/table_of_contents.md) to find the correct endpoint
- **Rate limiting**: Be mindful of API rate limits; cache data when possible
- **Error handling**: Wrap API calls in try-except blocks to handle network failures
- **Data formats**: Know when to use JSON, dict, or DataFrame based on downstream requirements
- **Season format**: Seasons use format `YYYY-YY` (e.g., `2019-20`)
- **League IDs**: NBA=`00`, ABA=`01`, WNBA=`10`, G-League=`20`
## Acceptance Criteria
- Data retrieved successfully from appropriate endpoint or static source
- Correct parameters used based on documentation
- Data formatted appropriately for intended use case
- Error handling implemented for API failures
- Code follows Python best practices
- Results validated against expected structure
- Documentation references included where relevant
## Reference Documentation
**Quick access to common resources**:
- [Table of Contents](docs/table_of_contents.md) - Full documentation index
- [Examples](docs/nba_api/stats/examples.md) - Usage examples for endpoints and static data
- [Parameters](docs/nba_api/stats/library/parameters.md) - Valid parameter values and patterns
- [Endpoints Data Structure](docs/nba_api/stats/endpoints_data_structure.md) - Response format and methods
- [Players](docs/nba_api/stats/static/players.md) - Static player lookup functions
- [Teams](docs/nba_api/stats/static/teams.md) - Static team lookup functions
- [HTTP Library](docs/nba_api/library/http.md) - HTTP request details
**Endpoint-specific documentation**:
Refer to `docs/nba_api/stats/endpoints/[endpoint_name].md` for detailed parameter and dataset information for each endpoint.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.