Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
Python语言及其应用(第2版)
by
Bill Lubanovic
March 2022
Intermediate to advanced
522 pages
13h 52m
Chinese
Posts & Telecom Press
Content preview from
Python语言及其应用(第2版)
网络
|
307
在许多方面,最简单的
API
就是
Web
界面,但它以结构化格式(比如
JSON
或
XML
)而
非纯文本或
HTML
形式提供数据
。
API
也可以是最小化或功能完善的
RESTful API
(参见
18.6
节)
,它为网站数据提供了另一个出口。
本书最开始的时候介绍过一款用于查询互联网网站归档的
W
eb API
。
在挖掘知名社交媒体网站(比如
T
witter
、
Facebook
和
LinkedIn
)的时候,
API
尤为有用。
这些网站都提供了可免费使用的
API
,但需要你注册并获取连接时使用的密钥
(一长串文
本字符串,有时也称为
令牌
)。密钥可供网站识别是谁在访问数据,也可以作为一种限制
服务器请求的方法。
下面是一些值得关注的服务
API
。
•
纽约时报
•
Weather Underground
•
漫威漫画
第
22
章会介绍其他
API
示例。
17.7
数据序列化
如第
16
章所述,
XML
、
JSON
和
YAML
等格式可用于存储结构化文本数据。网络应用需
要与其他程序交换数据。内存中的数据与网络上的字节序列之间的转换被称为
序列化
或
结
集
。
JSON
是一
种流行的序列化格式,尤其用于
Web
RESTful
系统,但是无法直接表达所
有的
Python
数据类型
。另外,作为文本格式,它往往比某些二进制序列化方法更冗长。下
面来看一些你可能会碰到的数据序列化方法。
17.7.1
使用
pickle
进行序列化
Python
提供了
pickle
模块来保存和恢复采用特殊二进制格式的对象。
还记得
JSON
在面对
datetime
对象时是如何手足无措的吗?这对于
pickle ...
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.
Start your free trial
You might also like
Python编程入门与实战
Posts & Telecom Press, Fabrizio Romano
Python实用技能学习指南
Posts & Telecom Press, Robert Smallshire, Austin Bingham
Python技术基础视频教程
保罗·J·戴特尔
Python面向对象编程指南
Posts & Telecom Press, Steven F. Lott
Publisher Resources
ISBN: 9787115586223