Python Development with FastAPI
Ryan Day

#API
#FastAPI
#StreamLit
#AI
#Data_Science
#Cloud
#Python
#ChatGPT
#LangChain
#PyPI
#Pydantic
✨آمادهای مهارتهاتو تو هوش مصنوعی و علم داده بیشتر کنی؟
یه راه عالی برای شروع اینه که یاد بگیری توی پروژههای واقعی، چطوری API بسازی و ازشون استفاده کنی. مهارت کار با API دیگه یه چیز حیاتی برای موفقیت تو این حوزههاست، چون کاربردهای خیلی خیلی متنوعی دارن.
این کتابِ کاربردی، به دیتا ساینتیستها و توسعهدهندهها کمک میکنه تا دست به کد بشن و تجربه عملی کار با APIها رو با زبان پایتون و فریمورکهای معروفی مثل FastAPI و StreamLit به دست بیارن.
💼 همینطور که فصلهای کتاب رو جلو میری، یه سری پروژه برای پورتفولیو (نمونهکارهات) میسازی که بهت یاد میدن چطور:
🎨 APIهایی طراحی کنی که دیتا ساینتیستها و هوش مصنوعیها عاشقش بشن.
🐍 با پایتون و FastAPI، ایپیآی توسعه بدی.
☁️ APIها رو روی چندتا سرویسدهنده ابری مختلف دیپلوی (مستقر) کنی.
📊 پروژههای علم داده مثل مصورسازی (visualizations) و مدلسازی رو با استفاده از APIها به عنوان منبع داده بسازی.
🧠 با استفاده از هوش مصنوعی مولد (generative AI) و مدلهای زبان بزرگ (LLMs) به APIها دسترسی پیدا کنی.
فصل ۱: ساخت APIهایی که دیتا ساینتیستها عاشقش میشوند
فصل ۲: انتخاب معماری API
فصل ۳: ساخت دیتابیس
فصل ۴: توسعه کد با FastAPI
فصل ۵: مستندسازی API
فصل ۶: دیپلوی کردن API روی کلود
فصل ۷: همه چیز آماده: ساخت یک SDK پایتون
بخش دوم: استفاده از API در پروژههای علم داده
فصل ۸: چیزهایی که دیتا ساینتیستها باید درباره APIها بدانند
فصل ۹: استفاده از APIها برای تحلیل داده
فصل ۱۰: استفاده از APIها در پایپلاینهای داده
فصل ۱۱: استفاده از APIها در اپلیکیشنهای داده با Streamlit
بخش سوم: استفاده از API با هوش مصنوعی
فصل ۱۲: استفاده از APIها با هوش مصنوعی
فصل ۱۳: دیپلوی کردن یک API یادگیری ماشین
فصل ۱۴: استفاده از APIها با LangChain
فصل ۱۵: استفاده از ChatGPT برای فراخوانی API شما
🏆 اگه میخوای تو هوش مصنوعی عالی بشی، اول باید توی APIها قوی بشی. حرفهای شدن تو کار با APIها از همیشه با ارزشتر شده، که بخش بزرگیش به لطف رشد هوش مصنوعی، یادگیری ماشین و علم دادهست.
😅 ولی یاد گرفتن یه مهارت اینقدر گسترده، ترسناکه. چطوری باید انجامش داد؟ خیالت راحت باشه که لازم نیست همه مهارتها رو یاد بگیری، و قطعاً نه همهشو یکجا.
🧱 با تمرین عملی، یکی یکی مهارتها رو یاد بگیر. هر مهارتی که یاد میگیری، بعدی رو برات راحتتر میکنه، درست مثل ساختن یه خونه با آجرهای لگو.
🤝 چون این کتاب دقیقاً نقطه تلاقی APIها، هوش مصنوعی و علم دادهست، برای چندین گروه از خوانندهها خیلی ارزشمنده.
دیتا ساینتیستها همیشه دارن از API استفاده میکنن، برای همین شاید فکر کنن چیز جدیدی برای یادگیری وجود نداره. مگه فراخوانی یه API چند خط کد بیشتره؟ درسته که یه درخواست ساده به یه REST API کار راحتیه، و برای همین هم اینقدر محبوب شدن. ولی اینکه جوری از API استفاده کنی که هم پایدار و مقاوم باشه و هم برای ارائهدهنده سرویس دردسر درست نکنه، دقت بیشتری میخواد. این کتاب تکنیکهایی رو بهت یاد میده که شاید هنوز بلد نباشی، مثل:
توسعهدهندهها و طراحهای API یاد میگیرن چطور APIهاشون رو برای مخاطبهای جدید و مهم (مثل دیتا ساینتیستها و هوش مصنوعی) تقویت کنن. اونا با دنیای دیتا ساینتیستها آشنا میشن: چه کارهایی انجام میدن، چه وظایفی دارن و عاشق چه ویژگیهایی توی یه API هستن. همچنین یاد میگیرن که اپلیکیشنهای هوش مصنوعی مولد چطور APIها رو فراخوانی میکنن و به چه ویژگیهایی نیاز دارن. مثالهای عملی کتاب هم کلی مهارت جدید بهشون یاد میده:
مهارتهایی که بالا گفتم توی بازار کار خیلی خواهان دارن، پس یاد گرفتنشون میتونه کمکت کنه اولین شغلت رو پیدا کنی یا یه شغل جدید تو حوزه علم داده یا توسعه نرمافزار به دست بیاری. این کتاب حول محور ساختن پروژههایی برای پورتفولیو طراحی شده، که هم بهت هدف مشخصی برای انجام دادن میده و هم مدرک ملموسی از کارهایی که بلدی انجام بدی.
👍 “کتاب Hands-On APIs for AI and Data Science یه خدمت فوقالعاده به جامعه علم دادهست. دِی (Day) یه راهنمای ساختاریافته برای یه موضوع اصلی ارائه میده که دیتا ساینتیستها اغلب خیلی دیر یاد میگیرن: تحویل دادن راهکار به کاربر نهایی. شما روی APIها مسلط میشید، ولی در کنارش، یه دوجین ابزار جدید هم به جعبهابزار علم دادهتون اضافه میکنید. به خودتون لطف کنید و این کتاب رو برای پیشرفت حرفهایتون به کتابخونه علم دادهتون اضافه کنید تا یه دیتا ساینتیست بهتر و موثرتر بشید!”
— الکس گاتمن، نویسنده کتاب Becoming a Data Head
🏈 “دِی (Day) خواننده رو با یه نقشه راه کامل و در عین حال واضح برای ساخت APIها همراهی میکنه و از یه مثال خیلی بهروز و جذاب (فوتبال فانتزی) استفاده میکنه. این کتاب یه منبع ضروری برای هر کسیه که میخواد تواناییهای علم داده خودش رو به عنوان یه فرد تکمیل کنه یا به مشتریانش به عنوان یه شرکت، خدمات بهتری بده.”
— اریک ایگر، نایب رئیس تحلیل فوتبال در تیم کارولینا پنترز و نویسنده کتاب Football Analytics with Python & R
💡 “با توجه به اهمیت روزافزون APIها در علم داده و هوش مصنوعی، این کتاب یه منبع ضروری برای به دست آوردن بینش عملیه. این کتاب اولویت رو روی درک مصرفکنندههای API میذاره، که برای طراحی و ساخت APIهای عالی حیاتیه. پر از مثالهای کاربردی و راهنماییهای تخصصی. یه کتاب بینهایت ارزشمند برای هر کسیه که میخواد APIهای تاثیرگذار بسازه.”
— جیمز گاف، نویسنده کتاب Mastering API Architecture
🎯 “این کتاب یه منبع فوقالعاده برای دیتا ساینتیستهایی هست که به APIها نیاز دارن، چه بخوان API بسازن و چه بخوان از طریقشون به داده دسترسی پیدا کنن. خیلی کاربردیه، خوندنش هم لذتبخشه، و برای هر دیتا ساینتیستی که میخواد مهارتهای مهندسی نرمافزارش رو بهتر کنه، بینهایت مفیده.”
— کاترین نلسون، نویسنده کتاب Software Engineering for Data Scientists
🛠️ “کتاب Hands-On APIs for AI and Data Science از بزرگترین اشتباهی که من تو کتابهای فنی میبینم، دوری کرده: درسهای عملی میده که ریشه در نحوه استفاده واقعی از تکنولوژی دارن. رایان دِی (Ryan Day) با مثالهای باحال از دادههای ورزشی، جنبههای مختلف یه پروژه API واحد رو نشون میده. هر کسی تو حوزه علم داده عاقلانه عمل میکنه اگه مسیر شغلیش رو روی پایههایی که رایان تو این کتاب بنا کرده، بسازه.”
— آدام دوواندر، از EveryDeveloper
رایان دِی (Ryan Day) یک دانشمند داده ارشد در کنفرانس ناظران بانکهای دولتی (CSBS) است. او پیش از این، رهبری بخش خدمات دیجیتال برای یک آژانس فدرال را بر عهده داشت و طرحهای مربوط به رایانش ابری، علم داده و توسعه API را پیش میبرد.
رایان که یک توسعهدهنده باتجربه پایتون و متنباز است، در پروژه FastAPI مشارکت دارد و دارای گواهینامه معماری راهکارهای AWS (AWS Solutions Architect) است. او همچنین عضو انجمن ملی اقتصاد کسبوکار است.
Are you ready to grow your skills in AI and data science? A great place to start is learning to build and use APIs in real-world data and AI projects. API skills have become essential for AI and data science success, because they are used in a variety of ways in these fields. 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.
As you complete the chapters in the book, you'll be creating portfolio projects that teach you how to:
Table of Contents
Part I. Building APIs for Data Science
Chapter 1. Creating APIs That Data Scientists Will Love
Chapter 2. Selecting Your API Architecture
Chapter 3. Creating Your Database
Chapter 4. Developing the FastAPI Code
Chapter 5. Documenting Your API
Chapter 6. Deploying Your API to the Cloud
Chapter 7. Batteries Included: Creating a Python SDK
Part II. Using APIs in Your Data Science Project
Chapter 8. What Data Scientists Should Know About APIs
Chapter 9. Using APIs for Data Analytics
Chapter 10. Using APIs in Data Pipelines
Chapter 11. Using APIs in Streamlit Data Apps
Part III. Using APIs with Artificial Intelligence
Chapter 12. Using APIs with Artificial Intelligence
Chapter 13. Deploying a Machine Learning API
Chapter 14. Using APIs with LangChain
Chapter 15. Using ChatGPT to Call Your API
To succeed in AI, first master APIs. Becoming skilled at APIs is more valuable than ever, thanks largely to the growth of artificial intelligence, machine learning, and data science.
But learning a such wide-ranging skill is intimidating. How is it to be done? You can take comfort in the fact that you don’t have to learn every skill, and certainly not all at once. Pick up one skill at a time through hands-on practice. Each skill you learn makes the next one easier, like building blocks.
Who This Book Is For
Since this book sits at the intersection of APIs, AI, and data science, it will be valuable to several types of readers.
Data Scientists
Data scientists use APIs all the time, so there’s a temptation to think there’s nothing new to learn about using APIs. Isn’t calling an API just a few lines of code? It’s true that making one call to a REST API is a simple task, which is certainly a reason they have become so prevalent. But using an API in a way that is robust and resilient—and that doesn’t cause problems for the provider—requires more care. This book will teach some techniques you may not have learned yet, such as:
API Developers and Designers
API developers and designers can learn how to enhance their APIs for important new audiences. They’ll learn about data scientists: the jobs they do, the tasks they perform, and the API features they love. They’ll also learn about generative AI applications: how they call APIs and what features they need in an API. And the hands-on examples will teach a variety of new skills:
Job Seekers and Role Changers
The skills above are valuable in the marketplace, so learning them can help you find your first role or a new role in data science or software development. This book is arranged around building portfolio projects, which will give you specific goals to accomplish, and tangible evidence of your work.
Hands-On APIs for AI and Data Science is an awesome contribution to the data science community. Day provides a structured guide to a core topic data scientists often learn too late: delivering solutions to users. You'll master APIs, but along the way, you'll also add a dozen more tools to your data science toolbox.
Do yourself a favor—add this book to your data science library for your continued professional development and become a better, more effective data scientist!
—Alex Gutman, author of Becoming a Data Head: How to Think, Speak, and Understand Data Science, Statistics, and Machine Learning
Day takes the reader through a thorough, yet clear, roadmap of building APIs, using an extremely topical industry (fantasy football) as the example.
This is essential reading for anyone looking to round out their data science capabilities as an individual or better serve their customers as a company.
—Eric Eager, vice president of Football Analytics, Carolina Panthers and author of Football Analytics with Python & R
With the growing importance of APIs in data science and AI, this book is an essential resource for gaining practical insights.
It prioritizes understanding your consumers, which is essential for designing and building great APIs. This bookis filled with actionable examples and expert guidance. It is an invaluable read for anyone looking to create impactful APIs.
—James Gough, author of Mastering API Architecture
This book is a fantastic resource for data scientists who need to use APIs, whether you're building them or accessing data through them.
It's very practical, it's fun to read, and it'll be extremely useful to any data scientistwho wants to improve their software engineering skills.
—Catherine Nelson, author of Software Engineering for Data Scientists: From Notebooks to Scalable Systems
Hands-On APIs for AI and Data Science avoids the biggest mistake I see in technical books: it provides practical lessons grounded in how technology is actually used.
With fun examples from sports data, author Ryan Day walks through multiple angles of a single API project.
Anyone in data science would be wise to build their career on the foundations Ryan has laid out in this book.
—Adam DuVander, EveryDeveloper
Ryan Day is an advanced data scientist at the Conference of State Bank Supervisors (CSBS). Previously, he led the digital services division for a federal agency, advancing cloud computing, data science and API development initiatives.
An experienced Python and open-source developer, Ryan contributes to the FastAPI project and holds an AWS Solutions Architect certification. He is also a member of the National Association of Business Economics.









