![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Clients originally provided requests wrappers to encourage best practices, particularly always using Sessions to connect to the same host or api endpoint. The primary goals were:
Client
object with a convenient constructorSince then httpx has emerged as the successor to requests
, and supports the above features natively. So clients.Client
can be replaced with httpx.Client
for most use cases. The project will continue to be maintained for additional features, such as the Resource
object.
Typical requests
usage is redundant and inefficient, by not taking advantage of connection pooling.
r = requests.get('https://api.github.com/user', headers={'authorization': token})
r = requests.get('https://api.github.com/user/repos', headers={'authorization': token})
Using sessions is the better approach, but more verbose and in practice requires manual url joining.
s = requests.Session()
s.headers['authorization'] = token
r = s.get('https://api.github.com/user')
r = s.get('https://api.github.com/user/repos')
Clients make using sessions easier, with implicit url joining.
client = clients.Client('https://api.github.com/', headers={'authorization': token})
r = client.get('user')
r = client.get('user/repos')
Resources extend Clients to implicitly handle response content, with proper checking of status_code and content-type.
github = clients.Resource('https://api.github.com/', headers={'authorization': token})
for repo in github.get('user/repos', params={'visibility': 'public'}):
...
Resources also implement syntactic support for methods such as getattr and call, providing most of the benefits of custom clients as is.
for repo in github.user.repos(visibility='public'):
...
Asynchronous variants of all client types are provided, e.g., AsyncClient
. Additional clients for RPC, GraphQL, and proxies also provided.
% pip install clients
100% branch coverage.
% pytest [--cov]
FAQs
High-level HTTP clients for Python.
We found that clients demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.