Hands-On APIs for AI and Data Science - Helion

ISBN: 9781098164379
stron: 325, Format: ebook
Data wydania: 2025-03-04
Księgarnia: Helion
Cena książki: 177,65 zł (poprzednio: 216,65 zł)
Oszczędzasz: 18% (-39,00 zł)
To succeed in AI and data science, you must first master APIs. API skills are essential for AI and data science success. With this practical book, data scientists and software developers will gain hands-on experience developing and using APIs with the Python programming language and popular frameworks like FastAPI and StreamLit.
Part 1 takes you step-by-step through coding projects to build APIs using Python and FastAPI and deploy them in the cloud. Part 2 teaches you to consume APIs in a data science project using industry-standard tools. And in Part 3, you'll use ChatGPT, the LangChain framework, and other tools to access your APIs with generative AI and large language models (LLMs).
As you complete the chapters in the book, you'll be creating a professional online portfolio demonstrating your new skill with APIs, AI, and data science.
You'll learn how to:
- Design APIs that data scientists and AIs love
- Develop APIs using Python and FastAPI
- Deploy APIs using multiple cloud providers
- Create data science projects such as visualizations and models using APIs as a data source
- Access APIs using generative AI and LLMs
Author Ryan Day is a data scientist in the financial services industry and an open source developer.
Osoby które kupowały "Hands-On APIs for AI and Data Science", wybierały także:
- Biologika Sukcesji Pokoleniowej. Sezon 3. Konflikty na terytorium 117,27 zł, (12,90 zł -89%)
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Podręcznik startupu. Budowa wielkiej firmy krok po kroku 92,14 zł, (12,90 zł -86%)
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Prawa ludzkiej natury 75,88 zł, (12,90 zł -83%)
Spis treści
Hands-On APIs for AI and Data Science eBook -- spis treści
- Preface
- Why Should You Read This Book?
- Who This Book Is For
- Data Scientists
- API Developers and Designers
- Job Seekers and Role Changers
- Creating Portfolio Projects
- Using This Book
- What This Book Is Not
- Why Fantasy Football?
- Get More Tips on APIs, AI, and Data Science
- Conventions Used in This Book
- Using Code Examples
- OReilly Online Learning
- How to Contact Us
- Acknowledgments
- I. Building APIs for Data Science
- 1. Creating APIs That Data Scientists Will Love
- How Do Data Scientists Use APIs?
- What Tools Do Data Scientists Use?
- Designing APIs for Data Scientists
- Introducing Your Part I Portfolio Project
- Every API Has a Story
- Meeting Your Company: SportsWorldCentral
- SWC Needs an API
- Selecting the First API Products
- Identifying Potential Users
- Creating User Stories
- Additional Resources
- Summary
- 2. Selecting Your API Architecture
- API Architectural Styles
- Representational State Transfer (REST)
- Graph Query Language (GraphQL)
- gRPC
- Your Choice: REST
- Technology Architecture
- Software Used in This Chapter
- Python
- GitHub
- Getting Started with Your GitHub Codespace
- Creating Your GitHub Account
- Cloning the Part I Repository
- Launching Your GitHub Codespace
- Touring Your New Codespace
- Making Your First Commit
- Additional Resources
- Summary
- API Architectural Styles
- 3. Creating Your Database
- Components of Your API
- Software Used in This Chapter
- SQLite
- SQLAlchemy
- pytest
- Creating Your SQLite Database
- Creating Database Tables
- Understanding Table Structure
- Loading Your Data
- Accessing Your Data Using Python
- Installing SQLAlchemy in Your Environment
- Creating Python Files for Database Access
- Creating the Database Configuration File
- Creating SQLAlchemy Helper Functions
- Installing pytest in Your Environment
- Testing Your SQLAchemy Code
- Additional Resources
- Summary
- 4. Developing the FastAPI Code
- Continuing Your Portfolio Project
- Software Used in This Chapter
- FastAPI
- HTTPX
- Pydantic
- Uvicorn
- Copying Files from Chapter 3
- Installing the New Libraries in Your Codespace
- Creating Python Files for Your API
- Creating Pydantic Schemas
- Creating Your FastAPI Controller
- Testing Your API
- Launching Your API
- Additional Resources
- Summary
- 5. Documenting Your API
- Sending a Signal of Trust
- Making Great API Docs
- Core Features
- Extra Features
- Reviewing Examples of API Documentation
- Sleeper App
- MyFantasyLeague
- Yahoo! Fantasy Football
- Viewing Your APIs Built-in Documentation
- Copying Files from Chapter 4
- Documentation Option 1: Swagger UI
- Documentation Option 2: Redoc
- Working with Your OpenAPI Specification File
- Continuing Your Portfolio Project
- Adding Details to the OAS info Object
- Adding Tags to Categorize Your Paths
- Adding More Details to Individual Endpoints
- Adding Parameter Descriptions
- Viewing the Changes in Swagger UI
- Regression-Testing Your API
- Updating Your README.md
- Additional Resources
- Summary
- 6. Deploying Your API to the Cloud
- Benefits and Responsibilities of Cloud Deployment
- Benefits
- Responsibilities
- Choosing a Cloud Host for Your Project
- Setting Up Your Project Directory
- Using GitHub Codespaces as a Cloud Host
- Deploying to Render
- Signing Up for Render
- Creating a New Web Service
- Auto-Deploying a Change to Your API
- Shipping Your Application in a Docker Container
- Verifying Docker Installation
- Creating a Dockerfile
- Creating a .dockerignore File
- Building a Container Image
- Running Your Container Image Locally
- Deploying to AWS
- Creating a Lightsail Container Service
- Installing the AWS CLI
- Installing the Amazon Lightsail Container Services Plug-in
- Configuring Your Login Credentials
- Pushing Your Container Image to Lightsail
- Creating a Lightsail Deployment
- Updating Your API Documentation
- Additional Resources
- Summary
- Benefits and Responsibilities of Cloud Deployment
- 7. Batteries Included: Creating a Python SDK
- SDKs Bridge the Gap
- Picking a Language for Your SDK
- Starting with a Minimum Viable SDK
- Expert Tip: Making Your SDK Easy to Install
- Expert Tip: Making the SDK Consistent and Idiomatic
- Building a Feature-Rich SDK
- Expert Tip: Using Sane Defaults
- Expert Tip: Providing Rich Functionality
- Expert Tip: Performing Logging
- Expert Tip: Hiding Your APIs Complicated Details
- Expert Tip: Supporting Bulk Downloads
- Expert Tip: Documenting Your SDK
- Testing Your SDK
- Expert Tip: Supporting Every Task the API Supports
- Completing Your Part I Portfolio Project
- Additional Resources
- Summary
- II. Using APIs in Your Data Science Project
- 8. What Data Scientists Should Know About APIs
- Using a Variety of API Styles
- HTTP Basics
- How to Consume APIs Responsibly
- Separation of Concerns: Using SDKs or Creating API Clients
- How to Build APIs
- How to Test APIs
- API Deployment and Containerization
- Using Version Control
- Introducing Your Part II Portfolio Project
- Getting Started with Your GitHub Codespace
- Cloning the Part II Repository
- Launching Your GitHub Codespace
- Running the SportsWorldCentral (SWC) API Locally
- Additional Resources
- Summary
- 9. Using APIs for Data Analytics
- Custom Metrics for Sports Analytics
- Using APIs as Data Sources for Fantasy Custom Metrics
- Creating a Custom Metric: The Shark League Score
- Software Used in This Chapter
- httpx
- Jupyter Notebooks
- pandas
- Installing the New Libraries in Your Codespace
- Launching Your API in Codespaces
- Creating an API Client File
- Creating Your Jupyter Notebook
- Adding General Configuration to Your Notebook
- Working with Your API Data
- Calculating the League Balance Score
- Calculating the League Juice Score
- Creating the Shark League Score
- Additional Resources
- Summary
- 10. Using APIs in Data Pipelines
- Types of Data Sources for Data Pipelines
- Planning Your Data Pipeline
- Orchestrating the Data Pipeline with Apache Airflow
- Installing Apache Airflow in GitHub Codespaces
- Creating Your Local Analytics Database
- Launching Your API in Codespaces
- Configuring Airflow Connections
- Creating Your First DAG
- Coding a Shared Function
- Running Your DAG
- Summary
- 11. Using APIs in Streamlit Data Apps
- Engaging Users with Interactive Visualizations
- Software Used in This Chapter
- nfl_data_py
- Streamlit
- Installing Streamlit and nfl_data_py
- Launching Your API in Codespaces
- Reusing the Chapter 9 API Client File
- Creating Your Streamlit App
- Updating the Entrypoint File
- Running Your Streamlit App
- Creating the Team Rosters Page
- Creating the Team Stats Page
- Deploying Your Streamlit App
- Completing Your Part II Portfolio Project
- Additional Resources
- Summary
- III. Using APIs with Artificial Intelligence
- 12. Using APIs with Artificial Intelligence
- The Overlap of AI and APIs
- Designing APIs to Use with Generative AI and LLMs
- Defining Artificial Intelligence
- Generative AI and Large Language Models (LLMs)
- Creating Agentic AI Applications
- Introducing Your Part III Portfolio Project
- Getting Started with Your GitHub Codespace
- Cloning the Part III Repository
- Launching Your GitHub Codespace
- Additional Resources
- Summary
- 13. Deploying a Machine Learning API
- Training Machine Learning Models
- New Software Used in This Chapter
- ONNX Runtime
- scikit-learn
- sklearn-onnx
- Installing the New Libraries in Your Codespace
- Using the CRISP-DM Process
- Business Understanding
- Data Understanding
- Data Preparation
- Modeling
- Evaluation
- Deployment
- Additional Resources
- Summary
- 14. Using APIs with LangChain
- Calling AI Using APIs (via LangChain)
- Creating a LangGraph Agent
- Signing Up for Anthropic
- Launching Your GitHub Codespace
- Installing the New Libraries in Your Codespace
- Creating Your Jupyter Notebook
- Chatting with the LangGraph Agent
- Running the SportsWorldCentral (SWC) API Locally
- Installing the swcpy Software Development Kit (SDK)
- Creating a LangChain Toolkit
- Calling APIs Using AI (with LangGraph)
- Chatting with Your Agent (with Tools)
- Additional Resources
- Summary
- 15. Using ChatGPT to Call Your API
- Architecture of Your Application
- Getting Started with ChatGPT
- Creating a Custom GPT
- Launching Your GitHub Codespace
- Running the SportsWorldCentral (SWC) API in GitHub Codespaces
- Adding the Servers Section to Your OAS File
- Creating a GPT Action
- Testing the APIs in Your GPT
- Chatting with Your Custom GPT
- Completing Your Part III Portfolio Project
- Summary
- Index