placekit
Modern Google Places API (New) client for Python, powered by a Rust core.
placekit targets the current Places API (New) end to end, with typed request building, field masks as a first-class feature, dataclass response models, and an exception hierarchy that tells you what actually went wrong. Google ships an official client for this API too, the generated google-maps-places package, and it is the right choice when you want the surface exactly as Google generates it. placekit is the hand shaped alternative over the same API, covering the five endpoints in the reference with typed models whose raw attribute is the response body itself, with the one exception of PhotoMedia, the downloaded photo form, which carries no raw.
The current release is 0.1.1, dated 2026-11-15. It changes no library behavior, and the install below is the whole evaluation path.
Documentation · Examples · Changelog · Migrating from python-google-places
Contents
- Install
- Quickstart
- Coming from googleplaces
- Why a Rust core
- Reference
- Concurrency and lifecycle
- Pointing the client somewhere else
- Building from source
- Development
- License
Install
pip install placekit
Prebuilt wheels cover CPython 3.10 and newer on Linux (x86_64 and aarch64 with glibc 2.28 or newer), macOS (Intel on 10.12 or newer, Apple silicon on 11 or newer), and Windows (x64). Installing is a single small download with zero runtime dependencies. There is nothing to compile and no Rust toolchain is needed. Only if your platform has no wheel does pip fall back to the source distribution. That happens on musl systems such as Alpine and on anything below the floors above, and a source install has its own requirements, covered under Building from source below.
Verify the install without a key. Field masks are built locally, so this runs offline, and it prints the header value a mask sends.
python -c "from placekit import FieldMask; print(FieldMask('places.displayName').header_value)"
places.displayName
Before the first live call, the key has to be able to call the API. In the Google Cloud console, enable Places API (New) on the project the key belongs to, and restrict the key to that API so it cannot be used for anything else. A key on a project without the API enabled is rejected on every call, and the project needs billing enabled, because the API charges per call and by the tier of the fields requested.
Quickstart
from placekit import Client
client = Client("YOUR_API_KEY")
result = client.text_search("cafes in Sydney")
for place in result.places:
print(place.display_text, place.rating, place.formatted_address)
details = client.place_details(result.places[0])
print(details.national_phone_number, details.website_uri)
photo = client.place_photo(details.photos[0], max_width_px=800)
photo.save("cafe.jpg")
The search loop prints one line per place. Output recorded from the live API:
Bianco Latte 4.6 Shop 1/123 George St, Sydney NSW 2000, Australia
Harbour Espresso 4.4 45 Circular Quay W, The Rocks NSW 2000, Australia
(02) 5550 1234 https://example.com/
The examples folder runs the search and details calls offline against the recorded responses, so the output above is reproducible without a key.
The photo call downloads the image itself by default. Pass skip_http_redirect=True to place_photo instead and the call returns a PhotoUriResult whose photo_uri attribute carries the photo URI, for callers who would rather fetch the image themselves or hand the URI to something else. The size is set with max_width_px, with max_height_px as the other member of the size pair beside it, and each value runs from 1 to 4800.
An AsyncClient with the identical method set is included for async code.
import asyncio
from placekit import AsyncClient
async def main():
client = AsyncClient("YOUR_API_KEY")
result = await client.text_search("cafes in Sydney")
print([p.display_text for p in result.places])
asyncio.run(main())
The sync Client refuses to run inside a running event loop, raising a ConfigError that points at AsyncClient instead of freezing the loop for the length of a request. Inside async code, use AsyncClient.
Coming from googleplaces
placekit targets Places API (New), and python-google-places wraps the retired legacy API, so the port is more than an import change. The migration guide walks the four canonical legacy examples across call by call, with the name mapping, the attribute reading contract, and the removals named plainly.
Migrating from python-google-places
Why a Rust core
- One abi3 wheel per platform serves every Python from 3.10 up, so installs on the platforms above need no compiler and no build step.
- TLS comes from rustls, never OpenSSL, so wheels do not break across system library versions.
- Requests are typed and validated locally before anything goes over the wire. Field mask grammar and photo size ranges are checked on the Python side first, and the Rust core validates coordinates, radii and charging rates again on its side, so a bad field mask or an out-of-range photo size fails locally, not at the API.
- The sync and async clients share one core, so their behavior cannot drift apart.
- Connections ignore proxy environment variables and go direct, which keeps behavior identical on a laptop, in CI, and against a local test server.
Reference
The reference lives in the docs folder, one file per subject, under one index.
- Endpoints names the five calls, what each returns, and the keyword arguments each one takes.
- Field masks covers mask construction, the curated defaults and their billing tiers, and reading attributes the mask did not request.
- Constants covers the type, language, and ranking vocabularies.
- Addresses covers the address readers and city resolution across the two carrier sets.
- Errors covers the exception hierarchy and the attributes every API exception carries.
- Normalizing addresses with placekit teaches the address handling the recorded corpus and the address module embody.
Concurrency and lifecycle
One Client may be shared across threads, and one AsyncClient may be shared across tasks and used from more than one event loop. Calls on a shared client run concurrently, and each call returns its own result.
close() gates later calls with ConfigError. It neither cancels nor waits for calls already in flight, and those calls finish with their own results. Closing is idempotent, and the context managers close on exit.
Cancelling a task that is awaiting an AsyncClient call drops the wire request, and the same client stays fully usable for the next call.
Each client instance holds its own connection pool, so a program holding a Client and an AsyncClient for the same work holds two pools. Pool sizes and the idle expiry are the inherited reqwest defaults, with no configuration surface in placekit. The idle expiry is ninety seconds under the reqwest version the current release locks, and that figure is an inherited default rather than a placekit promise, so a future reqwest update can move it. Under parallel async load the upstream pool can also open a connection that ends up carrying no request. Every client in one process shares a single Tokio runtime that is built on first use and lives for the life of the process, holding its worker threads until the process exits. Connection counts observed against a local stub also carry a transport limit, because the stub speaks HTTP 1.1 with keep alive while the real API can multiplex over HTTP 2.
A result is the holder's to mutate in place, within the shallow freeze the models document. Mutating a result while other threads read it is not safe. A reader can meet a typed view and a raw view that no longer agree, and a reader iterating a list or a raw dict while it changes can fail with a RuntimeError. Share a result between threads only when nobody mutates it, or hand each thread its own result.
A process may fork after using placekit. The bindings detect the new process on the next call and rebuild their runtime and client state for the child, so calls in the child work on fresh and inherited clients alike. The native module does not load under subinterpreters, so a host that runs application code inside subinterpreters cannot use this library. One ordering consequence is worth knowing. If a subinterpreter attempts the import before the main interpreter has imported the module, the main interpreter import afterwards fails too, so the refusal is not contained to the subinterpreter in that order. Work through the Python Client and AsyncClient classes. The native module behind them is private, and direct use of it is unsupported.
Pointing the client somewhere else
Client and AsyncClient accept base_url and timeout keyword arguments. The base URL override is how the test suite runs fully offline against a local stub server, and it works just as well for proxies you control and regional endpoints.
client = Client("YOUR_API_KEY", base_url="http://127.0.0.1:8080/v1", timeout=5.0)
Building from source
When pip finds no wheel it downloads the source distribution and builds it locally. That build needs a Rust toolchain at version 1.88 or newer (rustup installs one), network access while it downloads the crate dependencies from crates.io, and the platform C toolchain. With those in place a source install just works, only slower than a wheel.
Without a Rust toolchain the build backend tries to download and bootstrap one by itself, and when that fails the error talks about cargo metadata rather than the missing toolchain. If a source install fails, install Rust first and retry before debugging anything else. Wheels remain the recommended path wherever one exists.
Development
You need a Rust toolchain at version 1.88 or newer and Python 3.10 or newer. The dev loop builds in debug mode, so it stays fast.
python -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/maturin develop
.venv/bin/python -m pytest
cargo test -p placekit-core
On Windows the venv binaries live under .venv\Scripts, so the same steps use .venv\Scripts\pip, .venv\Scripts\maturin and .venv\Scripts\python.
maturin develop compiles the Rust core without optimizations and installs it into the venv. Iterate with the targeted commands above. The full gate is one command, and CI runs it word for word:
make check
That runs the rustfmt and clippy checks, the Rust test suite, a version coherence check across the manifests and the lockfile, an em dash scan, a maturin develop build, a stubtest pass over the type stubs, and the Python suite. The changelog joins the version comparison once it carries a release heading, and the publish form of the check enforces the changelog on the tag path.
The test suites need no Google API key and no network. The client tests run against a local stub server that serves recorded fixtures, and the Rust tests decode the same fixtures. The corpus conformance and accounting suites and the proof suites for both guides decode the recorded fixtures directly, and none of them passes through the stub server.
Build a release wheel from source
pip install "maturin>=1.7,<2.0"
maturin build --release --locked
pip install target/wheels/*.whl
In PowerShell on Windows the shell does not expand that glob, so the install step hands the wheel to pip through Get-ChildItem.
pip install (Get-ChildItem target\wheels\*.whl).FullName
You normally never need this. The Linux wheels are built by GitHub Actions inside manylinux containers, the macOS and Windows wheels are built on native runners for their architectures, and pushing a version tag publishes them to PyPI through trusted publishing from the same workflow.
A wheel built this way on a local machine is tied to that machine. On Linux it carries the local glibc as its floor, 2.39 on Ubuntu 24.04, not the manylinux 2_28 floor of the released wheels. A local build is for testing and is never a substitute for a released wheel.
Each wheel carries an embedded CycloneDX SBOM that the build generates for the Rust dependency tree, stored inside the wheel under its dist-info sboms folder. The tree it covers is the full locked tree across every platform that tree supports, so the SBOM also names components a given wheel platform never compiles, such as the Windows and WebAssembly branches of shared dependencies. The release trust story is that SBOM together with the commit SHA pin on every action in the workflow and PyPI trusted publishing, which ties each upload to this repository and workflow.
License
placekit is released under the MIT License.
Metadata
Release files for placekit 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| placekit-0.1.1.tar.gz | 688.7 kB | With provenance | Details for placekit-0.1.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| placekit-0.1.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for placekit-0.1.1-cp310-abi3-win_amd64.whl |
| placekit-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for placekit-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl |
| placekit-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for placekit-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl |
| placekit-0.1.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for placekit-0.1.1-cp310-abi3-macosx_11_0_arm64.whl |
| placekit-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for placekit-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 11.6 MB
Release files / placekit-0.1.1.tar.gz
| Download URL | placekit-0.1.1.tar.gz |
|---|---|
| Size | 688.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a93ef1bc485fa54960da20b1763877d0f316034002494e5c37aa5d3ce73d59b
|
|
BLAKE2b-256 checksum How to use checksums |
eca29c5e71f24b3a7b8073ec16ba66db8ed6dbcd3df0009abebb4bfac8cf9f7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / placekit-0.1.1-cp310-abi3-win_amd64.whl
| Download URL | placekit-0.1.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1f85dad72b1851b7c8da53cd9ac85a617468aa354189e4a07554ccbdf9bab52b
|
|
BLAKE2b-256 checksum How to use checksums |
e79070b6e9a637f5fa227b5eb05166f390b96219f4064049464b2ddd2051c157
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / placekit-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | placekit-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
42ab28e880c505de014e7cdf112ff638e7077d8ef2bae445677ed7f8d62f73c7
|
|
BLAKE2b-256 checksum How to use checksums |
429fc907dcbe58cfdb94bb8caadc3a7d22decd31b656c83239b56ef2bab66c01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / placekit-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | placekit-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a2d4b83f5d2f5fc79ed0d0a3bb0d42cb08c0ebf6e870498e8d8f33d32f6f6992
|
|
BLAKE2b-256 checksum How to use checksums |
4f2f29ab481b73cf8ecad70e609cec1871a253c2caef454a13df935f5db861ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / placekit-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | placekit-0.1.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
24d1b9d1e62a3a6a97576b6e01e3d274935a813e9c40c2352bb69658f6e14891
|
|
BLAKE2b-256 checksum How to use checksums |
3ac3d337986ba0c5a384c173cf464d73b3be33ce8bc3a0ef99bbea5a64fe7566
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / placekit-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | placekit-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c072ed903915a1f526373e0b229fd34e31e641eedc4ebf80533573d3f93ddb95
|
|
BLAKE2b-256 checksum How to use checksums |
12aace2dd5b2b7cf951c0c2ec80481fc744de9a7bd6861b8c184f6dfaadc3d0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for placekit 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for placekit-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.