Skip to Content
Python文本分析
book

Python文本分析

by Jens Albrecht, Sidharth Ramachandran, Christian Winkler
August 2022
Intermediate to advanced
441 pages
11h 26m
Chinese
China Electric Power Press Ltd.
Content preview from Python文本分析
利用
API
提取文本
|
47
2.3
案例:使用
requests
模块通过
API
提取
数据
随着
HTTP
标准驱动的
Web
的普及,
URL
成为了
API
最主要的规范。下
面,我们将使用标准
Python
发行版中包含的
requests
库,作为访问
API
和通过
API
提取数据的主要方式。在这个案例的说明中,我们将使用
GitHub API
(
https://oreil.
ly/oUIG1
)。
GitHub
是一个流行的代码托管平台,很多开源项目都托管在上面,比
如
Python
、
scikit-learn
和
TensorFlow
,还有本书的代码。假设你需要分析各种编程
语言(例如
Python
、
Java
和
JavaScript
等)的流行程度,则可以提取
GitHub
上各
个流行的存储库所使用编程语言的数据,然后再分析每种语言的流行程度。再假设
你们公司的项目托管到了
GitHub
上,而且你们希望确保用户和贡献代码的人能够
遵守行为准则。这时,你可以提取各个贡献者提交的议题和评论,并确保他们没有
使用不恰当的语言。在这个案例中,我们将阅读和理解某个
API
的文档、发送请求、
解析输出并创建一个能够满足我们的需求的数据集。
SOAP
、
REST
与
GraphQL
长期以来,API 一直是软件接口和通信的标准,而且多年来 API 的实现技
术已经发生了变化。简单对象访问协议(Simple Object Access Protocol,简
称 SOAP)是最早的软件模块间通信的标准接口之一。SOAP 使用了一种标
准的消息传递格式:可扩展标记语言(Extensible ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

工程战略的制定

工程战略的制定

Will Larson
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham
精益AI

精益AI

Lomit Patel
Excel金融建模

Excel金融建模

Posts & Telecom Press, Shmuel Oluwa

Publisher Resources

ISBN: 9787519864446